Skip to content

How to show teasers of blog posts on blog category page, aggregated by tag? #787

Discussion options

You must be logged in to vote

Welcome back! 🙂
Thanks to the API you can easily filter blog pages by tag in your system/layouts/blog-start.html. Here is an example layout which only displays blog pages filed under the news tag, have a closer look at the first foreach line.

<?php $this->yellow->layout("header") ?>
<div class="content">
<div class="main" role="main">
<?php if ($this->yellow->page->get("blogWithFilter")): ?>
<h1><?php echo $this->yellow->page->getHtml("titleContent") ?></h1>
<?php endif ?>
<?php foreach ($this->yellow->page->getPages("blog")->filter("tag", "news")->paginate($this->yellow->system->get("blogPaginationLimit")) as $page): ?>
<?php $page->set("entryClass", "entry") ?>
<?php if ($page->isExisti…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@JetGum
Comment options

@JetGum
Comment options

@schulle4u
Comment options

@JetGum
Comment options

@JetGum
Comment options

Answer selected by JetGum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants