Hello,
New user here, enjoying Kirby A LOT so far.
I tried to search in the forum for my issue, but couldn’t find a solution that works, so I’ll post my code.
I’m using the “restaurant menu” structure and controller and trying to adapt it to fit an old static site I had for a client, here is the code:
<?php
$index = $page->categories();
?>
<section class="menu menu-3 pad-small-menu">
<div class="tabbed-menu offix">
<div class="row">
<div class="small-11 medium-11 medium-centered columns text-center">
<ul class="menu-filters">
<?php foreach ($categories as $category): ?>
<li data-menu-type="<?= $category ?>" class="<?= $index->is($index->first()) ? 'active' : '' ?>" ><span><?= $category ?></span></li>
<?php endforeach ?>
</ul>
</div>
</div>
I just need to add the ‘active’ on the first category when the page is loaded.
with the code I just posted, it just put and ‘active’ class to every category and I can’t figure it out.
Thanks in advance for your help.