Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Taxonomy

Started by Muut Archive 10 years ago · 2 replies · 306 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 Deleted User, 9 years ago
0 1369 9 years ago
Archive · by Muut Archive, 9 years ago
2 942 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago