30 lines
831 B
PHP
30 lines
831 B
PHP
<?php
|
|
snippet('header');
|
|
|
|
// Display news entries where [newshere] appears in the kirbytext.
|
|
$marker = '<p>[newshere]</p>';
|
|
$left = strstr($page->text()->kirbytext(), $marker, true);
|
|
$right = substr($page->text()->kirbytext(), strlen($left) + strlen($marker));
|
|
|
|
print $left;
|
|
|
|
foreach($page->children()->listed()->flip() as $article):
|
|
?>
|
|
|
|
<article class="news">
|
|
<h3><?= $article->title()->html() ?></h3>
|
|
<?php if ($article->image()) { ?>
|
|
<img src="<?= $article->image()->resize(100, 100)->url() ?>" class="imageright"/>
|
|
<?php } ?>
|
|
<p class="newspublished">Published: <span class="newsdate"><?= $article->date()->toDate('d-M-Y') ?></span></p>
|
|
<p><?= $article->text()->excerpt(300) ?></p>
|
|
<a href="<?= $article->url() ?>">Read more...</a>
|
|
</article>
|
|
|
|
<?php
|
|
endforeach;
|
|
|
|
print $right;
|
|
|
|
snippet('footer');
|
|
?>
|