2017-11-08 23:12:58 +01:00
|
|
|
<!-- Section -->
|
|
|
|
<section class="content">
|
2018-09-08 18:26:20 +02:00
|
|
|
<?php foreach ($content as $page): ?>
|
2017-11-08 23:12:58 +01:00
|
|
|
<article class="page">
|
|
|
|
<header>
|
2020-07-23 11:07:28 +02:00
|
|
|
<?php if ( $page->title() ): ?>
|
2020-07-21 01:13:56 +02:00
|
|
|
<h2>
|
|
|
|
<a href="<?php echo htmlentities($page->permalink(), ENT_QUOTES | ENT_HTML401)?>">
|
|
|
|
<?php
|
2020-07-23 11:07:28 +02:00
|
|
|
echo htmlentities( $page->title() );
|
2020-07-21 01:13:56 +02:00
|
|
|
?>
|
|
|
|
</a>
|
|
|
|
</h2>
|
2020-07-23 11:07:28 +02:00
|
|
|
<?php endif; ?>
|
2017-11-08 23:12:58 +01:00
|
|
|
</header>
|
2018-09-08 18:26:20 +02:00
|
|
|
<?php if ($page->coverImage()): ?>
|
|
|
|
<img src="<?php echo $page->coverImage() ?>" alt="<?php echo $page->slug() ?>">
|
|
|
|
<?php endif ?>
|
2017-11-08 23:12:58 +01:00
|
|
|
|
|
|
|
<?php echo $page->content() ?>
|
|
|
|
|
|
|
|
<footer>
|
2020-07-23 11:07:28 +02:00
|
|
|
<a href="<?php echo htmlentities($page->permalink(), ENT_QUOTES | ENT_HTML401)?>">
|
|
|
|
<?php echo htmlentities( $L->get('Read this article.') ); ?>
|
|
|
|
</a>
|
|
|
|
<br/>
|
2017-11-08 23:12:58 +01:00
|
|
|
<?php echo $page->date() ?>
|
|
|
|
</footer>
|
|
|
|
</article>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<!-- Pagination -->
|
|
|
|
<ul class="pagination">
|
2020-07-22 22:14:36 +02:00
|
|
|
<?php
|
2017-11-08 23:12:58 +01:00
|
|
|
|
2020-07-22 22:14:36 +02:00
|
|
|
$isPage = $WHERE_AM_I === 'page';
|
|
|
|
$isHome = $WHERE_AM_I === 'home';
|
|
|
|
$pageHandler = new Pages();
|
|
|
|
$previousLink = null;
|
|
|
|
$nextLink = null;
|
|
|
|
$areTherePages = !!count($content);
|
|
|
|
if ( $isPage && $areTherePages ) {
|
|
|
|
$currentPage = $content[0];
|
|
|
|
if( isset($currentPage) ) {
|
|
|
|
if ( $currentPage->previousKey() ) {
|
|
|
|
$previousLink = buildPage($currentPage->previousKey())->permalink();
|
|
|
|
}
|
|
|
|
if ( $currentPage->nextKey() ) {
|
|
|
|
$nextLink = buildPage($currentPage->nextKey())->permalink();
|
|
|
|
}
|
2020-07-22 22:10:13 +02:00
|
|
|
}
|
2020-07-22 22:12:56 +02:00
|
|
|
}
|
2020-07-22 22:14:36 +02:00
|
|
|
if ( $isHome ) {
|
|
|
|
if ( Paginator::showPrev() ) {
|
|
|
|
$previousLink = Paginator::previousPageUrl();
|
|
|
|
}
|
|
|
|
if ( Paginator::showNext() ) {
|
|
|
|
$nextLink = Paginator::nextPageUrl();
|
|
|
|
}
|
2020-07-22 22:12:56 +02:00
|
|
|
}
|
2020-07-22 22:14:36 +02:00
|
|
|
?>
|
2020-07-22 22:43:47 +02:00
|
|
|
<?php if ( isset($previousLink) ): ?>
|
|
|
|
<li class="float-left">
|
2020-07-22 22:10:13 +02:00
|
|
|
<a href="<?php echo htmlentities( $previousLink, ENT_QUOTES | ENT_HTML401 ); ?>">
|
|
|
|
<?php echo $L->get('Previous page') ?>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
2020-07-22 22:43:47 +02:00
|
|
|
<?php if ( isset($nextLink) ): ?>
|
2020-07-22 22:10:13 +02:00
|
|
|
<li class="float-right">
|
|
|
|
<a href="<?php echo htmlentities( $nextLink, ENT_QUOTES | ENT_HTML401 ); ?>">
|
|
|
|
<?php echo $L->get('Next page') ?>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
2017-11-08 23:12:58 +01:00
|
|
|
</ul>
|