Liste der Anhänge anzeigen (Anzahl: 1)
SOLVED: Ein-/Ausblendbarer CODE Block in Nachrichtenliste mit Akkordeon
Guten Abend,
ich habe mein news_latest.html5 Template so bearbeitet, das die Newsliste als Akkordeon angezeigt wird.
Um Syntaxhighlightning in Nachrichten verwenden zu können, nutze ich die Erweiterung Syntaxhighlightning.
Ich hätte nun gerne, das die CODE Blöcke beim Laden der Nachricht als Standard ausgeblendet sind, mit dem Hinweis (siehe auch Bild im Anhang):
Code angehängt. Klicke hier zum Ein- / Ausblenden
Wie kann ich das bewerkstelligen, bzw. wie kann ich folgendes einbauen?
Hier mein Template news_latest.html5:
PHP-Code:
<div class="toggler"<?php if ($this->headlineStyle): ?> style="<?php echo $this->headlineStyle; ?>"<?php endif; ?>>
<h2><?php echo $this->headline; ?></h2>
</div>
<div class="layout_latest block<?php echo $this->class; ?>"><div class="accordion">
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->parseDate("d. F Y", $this->timestamp); ?></time> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->addImage): ?>
<div class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>" />
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<div class="caption"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<p class="teaser"><?php echo $this->teaser; ?></p>
<?php if ($this->text): ?>
<p class="more"><?php echo $this->more; ?></p>
<?php endif; ?>
</div>
<div>
</div>
</div>
und news_full.html5
PHP-Code:
<div class="layout_full block<?php echo $this->class; ?>">
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->parseDate("d. F Y", $this->timestamp); ?></time> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<?php if ($this->hasSubHeadline): ?>
<h2><?php echo $this->subHeadline; ?></h2>
<?php endif; ?>
<div class="ce_text">
<?php if (!$this->addBefore): ?>
<?php echo $this->text; ?>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>">
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<figcaption class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if ($this->addBefore): ?>
<?php echo $this->text; ?>
<?php endif; ?>
</div>
<?php if ($this->enclosure): ?>
<div class="enclosure">
<ul class="downloads">
<?php foreach ($this->enclosure as $enclosure): ?>
<?php
$filepath = substr($file['href'], strrpos($file['href'],'=')+1 );
$mydate = date ($GLOBALS['TL_CONFIG']['dateFormat'] , filemtime(TL_ROOT . "/" . $filepath));
$mytime = date ($GLOBALS['TL_CONFIG']['timeFormat'] , filemtime(TL_ROOT . "/" . $filepath));
?>
<li><img src="<?php echo $enclosure['icon']; ?>" width="18" height="18" alt="<?php echo $enclosure['mime']; ?>" class="mime_icon"> <a href="<?php echo $enclosure['href']; ?>" title="<?php echo $enclosure['title']; ?>"><?php echo $enclosure['link']; ?></a> <span class="size">(<?php echo $enclosure['filesize']; ?></span><span class="date"> | <?php echo $mydate; ?></span><span class="time"> | <?php echo $mytime; ?>)</span></li>
<?php endforeach; ?>
</div>
<?php endif; ?>
</ul>
</div>
Für Ideen und Tips wäre ich dankbar.
ToM
Liste der Anhänge anzeigen (Anzahl: 1)
Hi,
lange her... :D
Ich bin gerade dran, meine Version 2.11.17 auf 4.6.11 upzudaten und stosse hier auf Probleme:
Ich habe die hier genannte Erweiterung SyntaxHighlighter in /system/modules/ eingespeist und den Cache geleert, dann erhalte ich eine Fehlermeldung:
[2018-12-17 19:53:13] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundExc eption: "Attempted to load class "SyntaxHighlighter" from the global namespace. Did you forget a "use" statement?" at /www/htdocs/w011c26c/_neu/vendor/contao/core-bundle/src/Resources/contao/library/Contao/System.php line 182 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ClassNotFou ndException(code: 0): Attempted to load class "SyntaxHighlighter" from the global namespace.\nDid you forget a "use" statement? at /www/htdocs/w011c26c/_neu/vendor/contao/core-bundle/src/Resources/contao/library/Contao/System.php:182)"} []
Was muss ich jetzt wo und wie ändern, um das zum Laufen zu bekommen? :(
Als Anhang die Erweiterung aus meinem 2.11er System rauskopiert.
Ich wäre dankbar für Hilfe...
Mit den Templates komm ich auch noch nicht ganz klar, aber erstmal Schritt für Schritt. :cool:
ToM