Jump to content

How to get content of children pages on parent template?


OpenBayou
 Share

Recommended Posts

Hello,

I'm new at ProcessWire and I'm starting to learn the ropes. Please forgive me if this question has been asked but how do you display children pages on a parent template? Only items I'm looking for is the title and the text area called 'text_area'.

 

Thanks.

Link to comment
Share on other sites

Something like this:

foreach($page->children() as $child) {
    echo "<p>{$child->title}</p><p>{$child->text_area}</p>";
}

You can also use a selector in the children() method if you want to limit which child pages are shown, or to sort them, etc.

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