Jump to content

Get page children by children's field value


grigorisk
 Share

Recommended Posts

i try both but nothing...

my page tree is (i can't upload image so i'll describe it...)

pricing (my parent page)

     heraklion (1st child)
            heraklion pricelist1(1st child of heraklion)
             .
             .
             .

     Chania (2nd child)
           chania pricelist1(1st child of chania)
           chania pricelist2(2nd child of chania)
             .

             .
             .
     .

     .
     .

and i want to get all the children of the pricing page (heraklion, heraklion pricelist, chania, chania pricelist,....) if their checkbox is checked

Link to comment
Share on other sites

i found a solution:

$my_page=$pages->get("name=pricing"); // get pricing

$childrens = $my_page->children; //get childrens

foreach ($childrens as $children){

$tables = $children->children("fcheckbox=1"); // get the childrens with checked checkbox

foreach ($tables as $locationTable){

.

.

.

}

}

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

×
×
  • Create New...