Practical examples showing how to accomplish common tasks with Bengal's templating system.
Content Queries
Work with pages, sections, and taxonomies.
| Example | What You'll Learn |
|---|---|
| List Recent Posts | where,sort_by,limitfilters |
| Group by Category | group_byfilter, nested loops |
| Filter by Multiple Tags | Chaining filters,inoperator |
Page Features
Add features to individual pages.
| Example | What You'll Learn |
|---|---|
| Add Table of Contents | page.toc, scroll highlighting |
| Show Reading Time | reading_timefilter |
Quick Reference
The Essentials
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Common Filters
| Filter | Purpose | Example |
|---|---|---|
where |
Filter by field | pages \| where('draft', false) |
sort_by |
Sort results | pages \| sort_by('title') |
limit |
Take first N | pages \| limit(10) |
group_by |
Group by field | pages \| group_by('category') |
first |
Get first item | pages \| first |
See Template Functions for the complete reference.
In This Section
List Recent Posts
Query and display recent content using Bengal's filters
Group by Category
Organize content into groups using Bengal's group_by filter
Filter by Multiple Tags
Query content matching multiple criteria using Bengal's filters
Show Reading Time
Display estimated reading time using Bengal's reading_time filter
Add Table of Contents
Use Bengal's auto-generated page.toc for navigation
Related Pages
Advanced Filtering
Build dynamic pages that filter content by multiple tags or criteria