Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Taxonomy

Started by Muut Archive 10 years ago · 2 replies · 469 views
10 years ago

Hi, I have a taxonomy question. The basic premise is that I have 2 folders: Artists and Songs. I have a taxonomy called ‘artists’ and set that for both the artist page and then any song by that artist in the songs folder.

On the ‘artist’ page I want to pull any song that is tagged with that Artist into the page.

I was thinking something like this (which works):

TWIG
{% for post in taxonomy.findTaxonomy({'artist':'Foo Fighters'}) %}
    <li>{{ post.title }}</li>
{% endfor %}

This works but I don’t want it hard coded so I was thinking something like:

TXT
{'artist':'page.taxonomy.artist'}

Where I tag the 'artist' page with the same artist taxonomy as the songs.

But this doesn’t work.

Can someone suggest a) either what will work or b) a way better way of approaching this problem.

:)

Thanks

10 years ago

Ok I answered my own question with a page collection.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 676 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5338 9 years ago
Archive · by Muut Archive, 9 years ago
1 4135 9 years ago