Skip to content
Grav 2.0 is officially stable. Read the announcement →
Content & Markdown

Taxonomy filter not working

Solved by Amaury Hanser View solution

Started by Zuzana Fenclová 7 years ago · 2 replies · 720 views
7 years ago

Hi guys,

I have been trying to make use of taxonomy and it is not working on my site.

I have carefully followed the steps described at https://learn.getgrav.org/16/content/taxonomy - since I am experimenting, I opted for the most straightforward way and used taxonomy tag in my frontmatter.

Then I created a new page (default.cz.md) and copied in

<h2>Kevin Smith's Posts</h2>
<ul>
{% for post in taxonomy.findTaxonomy({'author':'ksmith'}) %}
<li>{{ post.title }}</li>
{% endfor %}
</ul>

from the Grav manual, only modifying the title and replacing author with tag and ksmith with spravce. However, instead of a list of topics (i. e. the two pages that have tag: [spravce] in their frontmatter), I am getting this:

bonbon|600x343

Why is this happening? Is there an option in system.yaml or site.yaml (somewhere else?) that I forgot to switch on? I am using a theme based on Learn2.

Thanks for pointing me in the right direction.

Sue

7 years ago Solution

Hello,

You're using twig in your markdown file.
By default, twig in markdown is not processed.

You should enable it: Process twig

7 years ago

Hello,
thanks for your insight, it did help. :fireworks: I enjoy taxonomies way more now and are on my way to build more of them. Thanks again, I very much appreciate your help.

Sue

👍 1

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 10 months ago
6 726 10 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 625 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 547 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 472 1 year ago
Content & Markdown · by belthasar, 2 years ago
4 817 2 years ago