Filtered author taxonomy does not work if it is defined in the page header


What is the difference between having the author taxonomy defined in site.yaml and If I use the author taxonomy from site.yaml, I can filter blog pages by author, however, if I use the taxonomy in the page header, that filter doesn’t work.

The following code

{% if %}
{% for author in %}
       <a href="{{ base_url }}/author{{ config.system.param_sep }}{{ author }}">{{ author }}
{% end for %}
{% endif %}

Filter correctly by taxonomy if site.yaml is like this:

   - category
   - tag
   - author

DO NOT filter by taxonomy if is like this:

         - Peter

I have defined the taxonomy according to this post:

Set Category and Tag (Taxonomies) as required

How can I solve this problem?


In site.yaml you just define the types of taxonomies you like to use. And in you define the taxonomy value for exactly that page.

E.g. I have in a similar use case:

Add desired taxonomies to site.yaml

  - author
  - category
  - tag

Use it in blog_item.html.twig

  {% if %}
    {% set author = %}
  {% else %}
    {% set author = array([0] %}
  {% endif %}

which uses the data from frontmatter

    author: abc
    category: blog
    tag: [2020, anyname]

Does that answer your question?

The saying goes that a picture is worth a thousand words.

I have modified some pages in the Future2021 theme demo to be able to show this error.

We have two pages, with the author “Ana”, one with the author defined in the header of the page, Post Five,


and another with the author defined in the author taxonomy (previously defined in site.yaml), Grav Install.

Now, if we visit the blog, filtering the author “Ana”, we get only one post, the post that has the author defined in the taxonomy (Grav Install) and NOT in the page header (Post Five)

The question is the following: How can I get all the posts of an author, regardless of whether it is defined in taxonomies or in page header?

Sorry I can’t express it better. Thanks in advance

OK, now I understand your issue. As far as I know …/author:Ana only works when the author is defined as taxonomy, but not when it’s simply in the header.