Skip to content

Instantly share code, notes, and snippets.

@sashtown
Last active February 12, 2017 21:24
Show Gist options
  • Save sashtown/6292453 to your computer and use it in GitHub Desktop.
Save sashtown/6292453 to your computer and use it in GitHub Desktop.
<?php
if(param('tag')) {
$tag = urldecode(param('tag'));
$articles = $pages->find('articles')
->children()
->visible()
->filterBy('tags', $tag, ',')
->flip()
->paginate(10);
echo '<h1>Beiträge verschlagwortet mit: <em>' . $tag . '</em></h1>';
}
elseif(param('author')) {
$author = urldecode(param('author'));
$articles = $pages->find('articles')
->children()
->visible()
->filterBy('author', $author)
->flip()
->paginate(10);
echo '<h1>Beiträge verfasst von: <em>' . $author . '</em></h1>';
}
else {
$articles = $pages->find('articles')
->children()
->visible()
->flip()
->paginate(10);
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment