TLDR Bolt CMS makes it easy to filter entries by category.
Bolt CMS makes it easy to filter entries by category. Here’s how:
This file contains hidden or 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
{% setcontent records = "blog/latest/10" where { 'entry_categories': 'Development' } %} | |
{% for record in records %} | |
<h1><a href="{{ record.link }}">{{ record.title }}</a></h1> | |
{% endfor %} |
Let’s have a closer look at the individual elements and what they so.
- blog # is where you’re getting the entries from (contenttypes.yml)
- latest # well, yeah. We want the latest entries!
- 10 # number of entries you’d like to show, assuming you have that many
- where # serves as a condition
- entry_categories # the group of categories we’re pulling from (taxonomy.yml)
- Development # FINALLY set the category you’d like to show