Nested/hierarchical tags, subtags

👍🏼-planned

#1

As recently discussed on Slack, hierarchical tags and subtags would be very useful for tags like:

  • United States > California > San Francisco
  • People > Philosophers > Bertrand Russell
    etc.

That would allow links to parent and children tags from the tag pages. Just that would be enough and great, there is no need for long nested URLs with multiple tags, the current URLs are OK in the case of tags. (Of course more general publishing channels or sections like “News”, “Opinion”, etc. would be a different, complementary case with specific channel URLs).

All what is needed for the hierarchical tags functionality is the parent_id field that already exists -though not yet used- in Ghost’s tags database table, and also people hopefully contributing pull requests to make possible the use of the parent_id field.

The PRs to use the parent_id field could create, for example, a “Parent” input field for tags in admin, an e.g. tagTree object in memory with parents and children, and {{parent_tag}} and {{children_tags}} helpers for the tag links on theme templates. That would be one of the possible ways.


Show child tags under parent tags (Nested Tags)
Linked/related tags
Child and parent tags
Child and parent tags
#2

Nice - we’re definitely going to do this!


I18n and custom theme
#3

I’d love to see this. I have a couple of tags that are “version specific” like “Visual Studio > Visual Studio 2017” I’d live to be able to show the list of child tags and their featured posts (similar to the end-of post jump list in casper) on every tag page.

Similarly I’d expect that the end-of-post jump list would also show child tags and featured posts there where there aren’t any recent posts in the parent tag.


#4

great idea!


#5

Another vote for nested tags! Hugely valuable for blogs with tons of content.


#6

I’m out of votes (maybe the system needs a check, I had very few votes from the very start, about 4 or so, and several months later I still don’t get any additional votes to use) but I also want to support this idea.

I assume it will be part of the custom channels functionality but, ayways, hierarchical taxonomies is something that I’m very much looking forward to.