How to make a template if there is a nested builder and there are multiple fieldsets under the second level builder?
My blueprint: (PLS notice there are multiple field sets in the nested builder)
title: manuals
icon: π
status:
draft: true
listed: true
fields:
heading:
label: Heading
type: text
subheading:
label: SubHeading
type: text
builder:
label: Builder
type: builder
fieldsets:
cardset:
label: Card
fields:
card_heading:
label: Card Heading
type: text
card_content:
label: Card Content
type: textarea
stepset:
label: Step
fields:
stepheading:
label: Step Heading
type: text
steplist:
type: builder
label: Step List
columns: 2
fieldsets:
step:
label: Step
fields:
title:
label: Title
type: text
text:
label: Description
type: textarea
steptip:
label: Step Tip
fields:
text:
label: Content
type: textarea
Template:
<?php snippet('header') ?>
<section class="uk-section">
<div class="uk-container uk-text-center">
<h2><?= $page->heading() ?></h2>
<h4><?= $page->subheading()->kirbytextinline() ?></h4>
</div>
</section>
<?php
foreach($page->builder()->toBuilderBlocks() as $block):
snippet('blocks/' . $block->_key(), array('data' => $block));
endforeach;
?>
<?php snippet('footer') ?>
block stepsetβs template:
<section class="uk-section">
<div class="uk-container">
<div class="uk-card uk-card-body">
<h2 class="uk-card-title"><?= $data->card_heading() ?></h2>
<p><?= $data->card_content()->kirbytext() ?></p>
</div>
</div>
</section>
block stepsetβs template:
<section class="uk-section">
<div class="uk-container uk-text-center">
<h2 class="uk-card-title"><?= $data->stepheading() ?></h2>
<ol class="uk-text-left">
<?php foreach($data->steplist()->toBuilderBlocks() as $step): ?>
<li>
<h4><?= $step->title()->kirbytext() ?></h4>
<?= $step->text()->kirbytext() ?>
</li>
<?php endforeach ?>
</ol>
</div>
</section>
But I want to treat the step and step-tip units differently.