I am building a faq-list using the kirby builder plugin by Tim Oetting.
Everything works fine, as long as I loop through the whole fieldset.
Now I’m trying to access only the ‘question’ field,
which generates an empty li element before the actual content.
I guess, it’s because there is also the ‘faq_headline’ in the blueprint,
or the ‘antwort’ field, but I don’t know how to get this right…
Any help is much appreciated!
#faq.yml builder: label: FAQ-Abschnitt type: builder fieldsets: faq_headline: label: Überschrift snippet: sections/faq_headline fields: headline: label: Überschrift text: type: simplemde faq: label: Frage / Antwort snippet: sections/faq fields: frage: label: Frage type: text antwort: label: Antwort type: simplemde
#templates/faq.php <ol> <?php foreach($page->builder()->toStructure() as $section): ?> <li><?= $section->frage()->kt() ?></li> <?php endforeach ?> </ol>