wishbone Posted July 22, 2021 Share Posted July 22, 2021 very strange behaviour: - pages created before work and render foreach data. - new pages with the same template show header and footer and nav ok, but don't render foreach-data any more. - foreach-data in the head-navigation is rendered ok. - child pages (without foreach) work ok I checked and compared all settings. Must be a very stupid simple setting. I'm confused. Any idea, where else I could look? this is the code for the template: <?php include('_head.php'); // include header markup foreach ($page->children as $child) { echo "<section>"; echo "<div class='contentWrap uebersicht'>"; echo "<a href='$child->url'><h1>{$child->arbeiten_block->first()->headline}</h1>"; if($child->teaserBildTh) echo "<p><img src='{$child->teaserBildTh->url}' alt='{$child->teaserBildTh->description}' class='bildNeben'></p>"; echo "<p>{$child->arbeiten_block->first()->details}</p></a>"; echo "</div>"; echo "</section>"; }; include('_foot.php'); // scripts ?>; thx! Link to comment Share on other sites More sharing options...
BillH Posted July 22, 2021 Share Posted July 22, 2021 One possibility is that the pages are hidden, unpublished or no-access, which are ignored by default by $page->children. Try adding an 'include=all' selector to see if the material from the pages then appears: foreach($page->children("include=all") as $child) { 1 Link to comment Share on other sites More sharing options...
wishbone Posted July 23, 2021 Author Share Posted July 23, 2021 omg, that's it! unpublished children don't show. (which is sensible) Big thx! yes, thank you, shows! But why? Why do old pages show without? Anyway, now not published pages show as well. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now