Errors adding slider (snippet)

Got it! Love how this CMS works.
Will be buying a license! Totally worth it

1 Like

Hi texnixe. I got allot stuff manageable in the cms now trough the docs.
1 question.

I have this agenda slider snippet:

<?php foreach (page('agenda')->agendaitem()->toStructure() as $item): ?>
    <div class="swiper-slide">
        <div class="agenda__row">
            <div class="agenda__column">
                <span class="agenda__item-date"><?= $item->date() ?></span>
            </div>
            <div class="agenda__column">
                <h2 class="agenda__item-title"><?= $item->title() ?></h2>
            </div>
            <div class="agenda__column">
                <p class="agenda__item-location"><?= $item->location() ?></p>
            </div>
            <div class="agenda__column">
                <a class="agenda__item-link" href=""><?= $item->linktext() ?></a>
            </div>
        </div>
    </div>
<?php endforeach ?>

Now I want a checkbox in the panel or a setting for a individual slide that adds a class to the “agenda__row” how do I do this?

For an individual row (= structure item), maybe a an additional field to your structure field?

Ofcourse! thanx

Hmm it works, but a bit un user friendly.
Can I make a checkbox (its like a on/off function) that adds/removes the class?

Now customer would have to type a classname. Not really user friendly

Kirby comes with many different field types, for on/off, a toggle field is the obvious choice.

All field types: Fields | Kirby CMS

Toggle: Toggle | Kirby CMS

1 Like

Thanx!!! :slight_smile:

Hi Texnixe.

I have a folder in my content called 2_updates
Thats just a simple blog overview page and every blog is a update (I dont have blog pages yet).

Now from the docs (and video) its just unclear to me what I need to add. Collections | Kirby CMS

I used the exact code from /site/collections/articles.php in the example and also. This one in my template:

$kirby->collection("articles");

Changed articles to updates but nothing rendering.
What am I missing.
Can you give me code examples?