Jump to content

Check same field value in all children's page ?


PWaddict
 Share

Recommended Posts

Something like this?

if(count($page->children('my_field=0')) == 0) {
    echo "Sold out";
}

Did you edit it? The first one you posted which I got in my email is working perfectly:

if(count($pages->get("$page->id")->children("my_field=0"))) {
    echo "Sold out";
}

Thank you guys both for the help!

Link to comment
Share on other sites

Did you edit it? The first one you posted which I got in my email is working perfectly:

if(count($pages->get("$page->id")->children("my_field=0"))) {
    echo "Sold out";
}

Yes, I noticed that you mentioned "current page" so I thought there's no need to use get().

@kongondo

Thanks, I always suspected this but never really dived into it :)

  • 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...