I’m using hugo to create an archive of articles, videos, whatever. I would like to use taxonomies and add parameters to it, that are not the same as metadata in the taxonomy page.
For example: I would like to have a taxonomy for ‘persons’, and in an article’s front matter write something like this:
In my example, each of this person would have his automatic page built by hugo, and then from the article’s template we could access the taxonomy terms with their params in the context of the page. It would be analogous to page’s resources, but this doesn’t work:
Invalid persons in "archives/this-is-a-test/index.md"
Is there a secret way to do that? I couldn’t find anything like this in the documentation nor this forum.
The theory should work, but I don’t quite follow how you are trying to do it. It’s easier to help if we can see your site code. Please read Requesting Help .
Please note that in the interval i updated my version of hugo and tried to use the new way to get taxonomy terms in my template, alongside the old one.
Of interest here is the ‘archives’ section where I link to the example page and try to access the page’s categories (works) and tags with a ‘role’ parameter (doesn’t work but doesn’t break either contrary to my initial post).
Then the page, the template of which tries to access tags and categories with the two methods I now know of. I can only access something with the new method (.GetTerms), and it is not the term but the taxonomy itself!
And finally in the tags taxonomy page, there is no content shown, contrary to the categories page.
In fact it is especially what I want to avoid. Here the ‘role’ is not an attribute of the taxonomy (for example ‘person’), it is an attribute of the relationship between the content and the taxonomy. A same ‘person’ may have different ‘roles’ in different content.