I am building out an about page for a website. The ABOUT page has a subpages ( TEAM ) which have their own subpages (FEATURE) .
I would like each TEAM subpage to have it’s own container with it’s own FEATURE subpages displayed inside of them. I know there’s a way to call all of the grandchildren of the About page using Kirby but how would I specify to only call specific subpages of each for each section.
Here is my code thus far. I’m modifying the about template of the kirby starter kit. I get no error code but nothing shows up at all.
About.PHP
<?php foreach($page->children()->visible() as $feature): ?>
<section class="team wrap wide">
<h2><?= $feature->title()->html() ?></h2>
<ul class="team-list grid gutter-1">
<?php foreach($feature->children()->visible() as $member): ?>
<li class="team-item column">
<figure class="team-portrait">
<img src="<?= $member->image()->url() ?>" alt="Portrait of <?= $member->title()->html() ?> " />
</figure>
<div class="team-info">
<h3 class="team-name"><?= $member->title()->html() ?></h3>
<div class="team-about text">
<?= $member->about()->kirbytext() ?>
</div>
</div>
</li>
<?php endforeach ?>
</ul>
</section>
<?php endforeach ?>
about.yml
title: About
pages:
template: team
num: zero
files: false
options:
template: false
status: false
fields:
title:
label: Title
type: title
intro:
label: Intro
type: textarea
text:
label: Text
type: textarea
team.yml
title: Team Member
pages: true
template: feature
num: zero
files: false
icon: user
preview: parent
fields:
title:
label: Name
type: title
about:
label: About
type: textarea
Feature.yml
title: Feature
pages: false
template: feature
icon: user
preview: parent
fields:
title:
label: Name
type: title
about:
label: About
type: textarea
—K