Hello,
I need a timetable with two information sections a) bus stops an b) departure times.
In the panel I want to add diffrent bus stops and the departure times for each bus stop.
How can I insert this in my template? (The bus stops should display as accordion)
#/site/bluprints/pages/about.yml
columns:
width: 1/1
fields:
fahrplan:
label: Fahrplan
type: structure
fields:
haltestellen:
label: Haltestellen
type: text
zeiten:
extends: sections/zeiten
label: Zeiten
Reusable zeiten field
label: Zeiten
type: structure
fields:
zeit:
label: Zeit
type: time
step: 1
The template looks like that
<?php foreach ($page->fahrplan()->toStructure() as $fahrplan): ?>
<button class="accordion">
<?= $fahrplan->haltestellen() ?></button>
<div class="panel">
<ul>
<?php foreach ($page->zeiten()->toStructure() as $zeit): ?>
<li>
<?= $zeit() ?>
</li>
<?php endforeach ?>
</ul>
</div>
<?php endforeach ?>
Thanks for your help.