Jump to content

Recommended Posts

Posted

Hi!
I have many pages-childrens of my main page with name=rates and i want to get all the childrens of my rates page by their input field value.
My input field is checkbox and i want to get the page if checkbox is checked.
Any help?

Posted
$children = $pages->find('parent=/path/to/parent/, checkbox=1');

foreach($children as $child) {
}

Is this what you are looking for?

Posted

If I understand your question correctly something like this should work.

$foo = $pages->get("name=rates")->children("checkbox=1");

I see Tom got there before me, and we are heading along similar lines.

Posted

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

Posted

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){

.

.

.

}

}

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
×
×
  • Create New...