
Zitat von
Spooky
Warum es nicht geht.
Poste den gesamten Inhalt deines Templates wo du deinen Versuch mit Controller:getArticle() drin hast 1:1 hier.
Um welche Contao Version genau geht es hier überhaupt?
es ist eine 4.13.54
Es ist ein mod_article template wo lediglich am Ende die Ausgabe stattfinden soll vor dem letzten </div> was mit inserttag klappt mit Controller:getArticle() nicht. :
Übrigen habe ich das auch mit dem fe_page template getestet - auch da dasselbe Verhalten
PHP-Code:
<?php if ($this->teaserOnly): ?>
<?php $this->block('alias'); ?>
<article class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div class="ce_text block">
<h2><?= $this->headline ?></h2>
<div class="teaser">
<?= $this->teaser ?>
<p class="more"><a href="<?= $this->href ?>" title="<?= $this->readMore ?>"><?= $this->more ?> <span class="invisible"><?= $this->headline ?></span></a></p>
</div>
</div>
</article>
<?php $this->endblock(); ?>
<?php elseif ($this->noMarkup): ?>
<?php $this->block('content'); ?>
<?= implode('', $this->elements) ?>
<?php $this->endblock(); ?>
<?php else: ?>
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<?php if ($this->printable): ?>
<?php $this->block('syndication'); ?>
<!-- indexer::stop -->
<div class="syndication">
<?php if ($this->printButton): ?>
<a href="<?= $this->print ?>" class="print" title="<?= $this->printTitle ?>" onclick="window.print();return false" data-skip-search-index><?= Contao\Image::getHtml('assets/contao/images/print.svg') ?></a>
<?php endif; ?>
<?php if ($this->pdfButton): ?>
<a href="<?= $this->href ?>" class="pdf" title="<?= $this->pdfTitle ?>" data-skip-search-index><?= Contao\Image::getHtml('assets/contao/images/pdf.svg') ?></a>
<?php endif; ?>
<?php if ($this->facebookButton): ?>
<a href="<?= $this->route('contao_frontend_share', ['p' => 'facebook', 'u' => $this->encUrl]) ?>" class="facebook" rel="nofollow" title="<?= $this->facebookTitle ?>" onclick="var w=window.open(this.href,'','width=640,height=380,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');w.opener=null;return false"><?= Contao\Image::getHtml('assets/contao/images/facebook.svg') ?></a>
<?php endif; ?>
<?php if ($this->twitterButton): ?>
<a href="<?= $this->route('contao_frontend_share', ['p' => 'twitter', 'u' => $this->encUrl, 't' => $this->encTitle]) ?>" class="twitter" rel="nofollow" title="<?= $this->twitterTitle ?>" onclick="var w=window.open(this.href,'','width=640,height=380,modal=yes,left=100,top=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');w.opener=null;return false"><?= Contao\Image::getHtml('assets/contao/images/twitter.svg') ?></a>
<?php endif; ?>
</div>
<!-- indexer::continue -->
<?php $this->endblock(); ?>
<?php endif; ?>
<?php $this->block('content'); ?>
<?= implode('', $this->elements) ?>
<?php $this->endblock(); ?>
<?php if ($this->backlink): ?>
<?php $this->block('backlink'); ?>
<!-- indexer::stop -->
<p class="back"><a href="<?= $this->backlink ?>" title="<?= $this->back ?>"><?= $this->back ?></a></p>
<!-- indexer::continue -->
<?php $this->endblock(); ?>
<?php endif; ?>
<?= Contao\Controller::getArticle(85) ?>
</div>
<?php endif; ?>