PHP-Code:
<?php
$news = \Contao\NewsModel::findById($this->id);
$author = \Contao\UserModel::findById($news->author);
?>
<div class="row layout_latest arc_<?= $this->archive->id ?> block<?= $this->class ?>" itemscope itemtype="http://schema.org/Article">
<?php if ($this->addImage): ?>
<figure class="image_container col-12 col-md-6"<?php if ($this->margin): ?> style="<?= $this->margin ?>"<?php endif; ?>>
<?php if ($this->hasText && $this->hasTeaser): ?>
<a href="<?= $this->link ?>" title="">
<?php endif; ?>
<?php $this->insert('picture_default', $this->picture); ?>
<?php if ($this->hasText && $this->hasTeaser): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<figcaption class="caption"><?= $this->caption ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<div class="postcontent col-12 col-md-6">
<div class="postdate">
<div class="postdate-day"><?php echo $this->parseDate("d", $this->timestamp); ?></div>
<div class="postdate-monthyear"><?php echo $this->parseDate("M Y", $this->timestamp); ?></div>
</div>
<h2><?= $this->linkHeadline ?></h2>
<?php if ($this->hasMetaFields): ?>
<div class="info container">
<div class="row">
<div class="postauthor col-12 col-md-5"><i class="far fa-user-edit mr-1"></i><?= $author->firstname ?></div>
<div class="postcategories col-12 col-md-6"><i class="far fa-tags mr-1"></i>
<?php if ($this->categories): ?>
<ul class="categories">
<?php foreach ($this->categories as $category): ?>
<li class="category_<?php echo $category['id']; ?>"><?php echo $category['title']; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<div class="ce_text block" itemprop="description">
<?php echo StringUtil::substr($this->teaser, 200); ?>
</div>
<?php if ($this->hasText || $this->hasTeaser): ?>
<p class="more mt-5"><?= $this->more ?></p>
<?php endif; ?>
</div>
</div>
Lesezeichen