Created
November 11, 2013 13:38
-
-
Save starckio/7413310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php snippet('header') ?> | |
<section class="content cf"> | |
<?php if(param('tag')) { | |
$articles = $pages->find('blog') | |
->children() | |
->visible() | |
->filterBy('tags', param('tag'), ',') | |
->flip() | |
->paginate(10); | |
} else { | |
$articles = $pages->find('blog') | |
->children() | |
->visible() | |
->flip() | |
->paginate(5); | |
} ?> | |
<?php if ( $page->children()->visible()->count() ) : foreach($articles as $article): ?> | |
<article> | |
<time datetime="<?php echo $article->date('c') ?>" pubdate="pubdate"> | |
<?php echo $article->date('d.m.Y') ?> | |
</time> | |
<h3><a href="<?php echo $article->url() ?>"><?php echo html($article->title()) ?></a></h3> | |
</article> | |
<?php endforeach; else : ?> | |
<article class="no-items"> | |
<?php echo kirbytext($page->text()) ?> | |
</article> | |
<?php endif; ?> | |
<?php if($articles->pagination()->hasPages()): ?> | |
<nav class="pagination cf"> | |
<?php if($articles->pagination()->hasNextPage()): ?> | |
<a class="next" href="<?php echo $articles->pagination()->nextPageURL() ?>">‹ Newer</a> | |
<?php endif ?> | |
<?php if($articles->pagination()->hasPrevPage()): ?> | |
<a class="prev" href="<?php echo $articles->pagination()->prevPageURL() ?>">Older ›</a> | |
<?php endif ?> | |
</nav> | |
<?php endif ?> | |
</section> | |
<?php snippet('footer') ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment