... kaum postet man einen Beitrag, findet man raus wie es geht
Hab jetzt hier eine super Lösung gefunden:
https://docs.contao.org/dev/framework/templates/
Für alle die es interessiert, das ist meine Lösung:
PHP-Code:
// so sieht bei mir das Button-Template ('button.html5') aus:
<a href="<?= $this->link ?>" class="<?= $this->customClass ?> btn">
<span class="btn__inner">
<?php if($this->icon): ?>
<?php echo file_get_contents("files/theme/img/icons/".$this->icon.".svg"); ?>
<?php endif; ?>
<span class="btn__label"><?= $this->more ?></span>
</span>
</a>
// und so wird es im Template 'news_latest.html5' eingefügt:
<?php
$this->insert('button', [
'link' => $this->link,
'more' => 'Mehr erfahren',
'customClass' => 'news_latest__more',
'icon' => 'chevron-right'
]);
?>
Lesezeichen