Jump to content

Get the bunch of pages and children in one move


Manaus
 Share

Recommended Posts

Hello,

I need to grab the bunch of pages and their children, I wonder if I can do it in one shot, or do for each page "do you have children? if so, get them". My fear is in making too many db hits, and slow down the page load

Thanks!

Link to comment
Share on other sites

  • 2 months later...
$getTheseAndItsChildren = "1236|1244|1264|1768|1456";

$myPages = $pages->find("id={$getTheseAndItsChildren}, parent={$getTheseAndItsChildren}");

edit: I have to wake up before posting :)

$myPages = $pages->find("id=1236|1244|1264|1768|1456");

echo $myPages->import($pages->find("parent={$myPages}"));
Link to comment
Share on other sites

This is working for me in the latest dev!

$pages->find("id|parent=1236|1244|1264|1768|1456")

The pipe is working also on the left side of the operator. When did Ryan add this? I completely missed it!  :) :) :)

  • Like 2
Link to comment
Share on other sites

Well, damn it! I will refrain from posting for the rest of the day. Maybe tomorrow I will be awaken...

Anyway Manaus, there is your answer. Parent and children in one go.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...