Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Creating Tags to filter posts

first-time

Started by Mason 9 years ago · 1 replies · 1445 views
9 years ago

Hi,
I am trying to filter a collection of posts by tags. Unfortunately I am new to this, and am struggling to understand much of the documentation and forums have provided.

image|690x260

Say for example I have this here, and I want to filter all the posts shown below by each tag, and have a "Show All" filter. How would I do this? (The tags that exist there are just placeholders).

My code for blog.html.twig is here: https://pastebin.com/HkGy5kYF

I have installed the Taxonomy plugin, but am unsure of how to set each of those "filters" as a tag that can filter blog posts.

Also, how would I go about displaying the tag in the blue box in each blog post?

Thanks.

last edited 03/31/18 by Mason
9 years ago

The usual way to get a list of blog posts by tag is to append your site url with /tag:TAGNAME. See my Tag Cloud plugin as an example. (Damn Discourse! It's making it hard for me to post links. Go to the Grav website's download page, the plugin tab, and find the plugin Tagcloud. Grrr.)

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 4 weeks ago
4 483 3 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 808 3 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 667 2 months ago
Themes & Styling · by Sebadamus, 3 months ago
5 688 2 months ago
Themes & Styling · by martynfoster735, 3 months ago
1 647 3 months ago