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

Tags in hierarchical web site

Started by Muut Archive 10 years ago · 1 replies · 342 views
10 years ago

My website isn't a blog, it is structured as a hierarchy of topics and subtopics. But I would still like to use tags.

If I am on the top level page, the tag links on the page point to example.com/tag:whatever and it works fine.

If I am viewing a page further down the hierarchy, eg /computers/laptops/windows the tag links point to example.com/computers/laptops/windows/tag:whatever and the link is not found (404).

This happens with the tag links at the bottom of the article, and also the links in the Popular Tags in the sidebar.

I am using twentyfifteen (theme only, not the skeleton) and all my pages are using the item template.

Any ideas?

10 years ago

It's just a matter of adjusting your theme's output to link to the appropriate page. The twentyfifteen theme probably assumes the collection is on the current page, so it just links to the current page no matter where you are.

Tags work by filtering the page collection already defined in the page. So you need to point to a page where that collection is defined.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1362 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2959 9 years ago
Archive · by Muut Archive, 9 years ago
3 1124 9 years ago