Jump to content

SOLVED: Can I use children() with $pages


Recommended Posts

I am looking to display Scorecards on a rider_profile.php page.  I am using a event_results.php page that has a pagetable field that generated the scorecards.  The settings of the pagetable field has the pages being created under a page called scorecards. 

There are going to be multiple cards throughout the year for each rider depending on how many events they attend.  Since there are multiple cards per rider I set the pagetable setting for Automatic Page Name Format to Ymd:His to create different folders for each scorecard. 

When I did that my code below doesn't work of course.  How do I search the children folders?  I am using $pages so I don't think I can use children() .

$event_hx = $pages->get("/2014-season/scorecards/")->find("template=scorecard, Competitor~=$rider");
foreach($event_hx as $hx) 
    echo "<li><a href='{$hx->url}'>{$hx->Event_Name}</a></li>";

Link to Dr Frankenstein's monster.


I noticed this thread suggested by the forum as related and changed the code to below and it works.

 $pages->get("/2014-season/scorecards/, include=all")
  • 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

  • Create New...