Jump to content

Recommended Posts

Posted

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!

  • 2 months later...
Posted
$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}"));
Posted

Diogo, wouldn't work with that logic. Either two queries or OR selectors (as simple as parenthesis there). On mobile now.

Posted

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
Posted

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
Posted

Of course, clever one Diogo! Rarely needed with page IDs, that's probably reason it looked like a new solution :)

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
  • Recently Browsing   0 members

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