Hier noch das Template (Contao 3.5) dazu:
HTML-Code:
<?php $this->extend('block_unsearchable'); ?>
<?php $this->block('content'); ?>
<?php if (empty($this->items)): ?>
<p class="empty"><?= $this->empty ?></p>
<?php else: ?>
<ul class="level_1">
<?php foreach ($this->items as $year=>$months): ?>
<li class="year submenu">
<?php if ($year == $this->activeYear): ?>
<span class="active"><h3><?= $year ?></h3></span>
<?php else: ?>
<a href="<?= $this->url ?>year=<?= $year ?>"><h3><?= $year ?></h3></a>
<?php endif; ?>
<ul class="level_2">
<?php $months = array_reverse($months); ?>
<?php foreach ($months as $month): ?>
<?php if($month['isActive']): ?>
<li class="active<?php if ($month['class']) echo ' ' . $month['class']; ?>"><span class="active"><?= mb_substr($month['link'],0,3) ?><?php if ($this->showQuantity): ?> <span class="quantity">(<?= split($month['quantity'], ' ')[0] ?>)</span><?php endif; ?></span></li>
<?php else: ?>
<li<?php if ($month['class']): ?> class="<?= $month['class'] ?>"<?php endif; ?>><a href="<?= $this->url ?>month=<?= $month['date'] ?>" title="<?= $month['title'] ?>"><?= mb_substr($month['link'],0,3) ?><?php if ($this->showQuantity): ?> <span class="quantity">(<?= trimsplit(' ',$month['quantity'])[0] ?>)</span><?php endif; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php $this->endblock(); ?>
Lesezeichen