Hi Leute,
wie lässt sich in Contao 5.3 die Teaser als Akkordeon aufklappen?
Unbenannt-1.jpg
Dazu wurde in den vorherigen Contao-Versionen das Template "news_latest" geändert, und zwar so hier:
Wie kann das Ganze jetzt in Contao 5.3 umgesetzt werden?PHP-Code:<div class="layout_latest arc_<?= $this->archive->id ?> block<?= $this->class ?>">
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?= $this->datetime ?>"><?= $this->date ?></time> <?= $this->author ?> <?= $this->commentCount ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?>
<?php $this->insert('image', $this->arrData); ?>
<?php endif; ?>
<h2><?= $this->linkHeadline ?></h2>
<div class="ce_text block">
<?= $this->teaser ?>
<div class="layout_latest arc_<?= $this->archive->id ?> block<?= $this->class ?>" itemscope itemtype="http://schema.org/Article">
<div class="toggler"><h2 itemprop="name">
<?= $this->headline ?></h2>
</div>
<?php if ($this->hasText || $this->hasTeaser): ?>
<p class="more"><?= $this->more ?></p>
<?php endif; ?>
<div class="ce_text block" itemprop="description">
<div class="accordion">
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?= $this->datetime ?>" itemprop="datePublished"><?= $this->date ?></time> <?= $this->author ?> <?= $this->commentCount ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?> <?php $this->insert('image', $this->arrData); ?> <?php endif; ?>
<div class="ce_text block" itemprop="description">
<?php if ($this->teaser): ?>
<?php echo \StringUtil::substr($this->teaser,120); ?>
<?php else: ?>
<?php echo \StringUtil::substr($this->text,120); ?>
<?php endif; ?>
</div>
<?php if ($this->hasText || $this->hasTeaser): ?>
<p class="more"><?= $this->more ?></p>
<?php endif; ?>
</div>
</div>
</div>
<?php
// This template is used as a news list template by default, so we only add
// JSON-LD data in case this is a news article without a reader
if (!$this->hasReader) {
$this->addSchemaOrg($this->getSchemaOrgData());
}
Was muß da an dem neuen "news_latest" in Contao 5.3 wie und wo geändert oder ergänzt werden, damit das klappt?
Ich steh da bissl uffn Schlauch mangels technischen Wissen :-/

Zitieren
Für Dinge die man mit html5 und css3 lösen kann, braucht man kein javascript.