Categorizations with tags, is it possible? Primary, Secondary tags?

Hi - I’m not sure if this is possible as I’m new to Ghost and haven’t found this in documentation.

My use-case:
Say, I’m writing Travel Guides. So, I want user to be able to filter guides by Country → City

UK → Windsor
UK → London
Canada → Waterloo
Canada → London

So, if a user clicks on “UK”, I want user to see “Windsor” and “London” filters on the sidebar.

Now, user clicks on “London”, I want user to see posts tagged with “UK” AND “London”.

I do NOT want to show posts that are non-UK. For example, Travel guide for London, Canada should not show-up.

How to do this?

Yes, this is possible. You will need a combination of Javascript, as well as helper tags. The easiest way to do this is with client side scripting. An approach is to add the specific tags the post has to the post card div’s data properties, then hide or show the posts based on which tags they have. Use filter operations to hide all the cards which don’t have the needed tags.

This could also likely be done through the admin API using integrations, thought that would require a bit more moving parts

Thanks. So, in that case, posts will still load but they’ll then be hidden? It’d be ideal for the server to not even return irrelevant results.

You’re correct, and I agree. Unless you work out an alternate front end which communicates directly with the admin API, there’s not much in the way of other options. It should be possible however to configure the admin API to send over specific entries only if you wanted to build a single-page app with Next, Gatsby or React. IMO, if you’re trying to get this sort of action, you’re best off building out your own front end.

@redscic here is a search on this forum for that topic: Search results for 'nested tags' - Ghost Forum

In my explorations with this, I would try a combination of these techniques:

Also, you can look into the filter-and-sort navigation components built into this theme (which I currently have installed on my MicroChic Ghost blog site:

http://pixelandkraft.com/blockster/demo/

I’d be interested to watch your progress on this.