Hab einen read more code geschrieben und bin mir unsicher, wo ich ich in in der article index.php einbauen soll ?
mein code
$strCut =substr($desc,0,150); $desc =substr($strCut,0,strrpos($strCut,' ')).' Read more'; echo $content = $article->getContent();
index.php
<?php if ($article->getTeaser()): ?> <h3><?=$this->escape($article->getTeaser()) ?></h3> <?php endif; ?> <h2><a href="<?=$this->getUrl(['action' => 'show', 'id' => $article->getId()]) ?>"><?=$this->escape($article->getTitle()) ?></a></h2> <?php if (!empty($image)): ?> <figure> <img class="article_image" src="<?=$this->getBaseUrl($image) ?>"> <?php if (!empty($imageSource)): ?> <figcaption class="article_image_source"><?=$this->getTrans('imageSource') ?>: <?=$this->escape($imageSource) ?></figcaption> <?php endif; ?> </figure> <?php endif; ?> <?php $content = $article->getContent(); ?> <?php if (strpos($content, '[PREVIEWSTOP]') !== false): ?> <?php $contentParts = explode('[PREVIEWSTOP]', $content); ?> <?=reset($contentParts) ?> <br /> <a href="<?=$this->getUrl(['action' => 'show', 'id' => $article->getId()]) ?>" class="pull-right"><?=$this->getTrans('readMore') ?></a> <?php else: ?> <?=$content ?> <?php endif; ?> <hr />
muss der code in zeile 14 eingebaut werden ?
verwendete ilch Version: 2.x