Jump to content

How can I make children visible on parent page?


Bia
 Share

Recommended Posts

Hello,

I created childrens but they don’t show up on the parent - page overview . I’m new with this and can’t figure it out. Any help is welcomed. Thank you!

Link to comment
Share on other sites

Hi @bia welcome to the forum,

ProcessWire will not output anything automatically. It will only output what you tell it to. Usually that is HTML (websites), but you could also use it to output PDFs or an API or whatever.

You tell it what to output in so called template files. So for the template "events" it would call /site/templates/events.php, for example.

In that template file, you would then place something like this to show children of your events page:

<ul>
  <?php
  foreach($page->children as $event) {
  	echo "<li>{$event->title}</li>";
  }
  ?>
</ul>

This would output an unordered list (<ul>) of events.

Then you could add links to directly view those event pages:

echo "<li><a href='{$event->url}'>{$event->title}</a></li>";

 

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