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

**URL:** <https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323>\
**Category:** Developer help\
**Created:** [February 22, 2021, 1:52pm UTC](https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323 "2021-02-22T13:52:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![redscic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/redscic/32/11555_2.png) [@redscic](https://forum.ghost.org/u/redscic)\
**Post date:** [February 22, 2021, 1:52pm UTC](https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323/1 "2021-02-22T13:52:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![spectral](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/spectral/32/11724_2.png) [@spectral](https://forum.ghost.org/u/spectral)\
**Post date:** [February 22, 2021, 6:10pm UTC](https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323/2 "2021-02-22T18:10:12Z")

</div>

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](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes), 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

---

<div class="post-metadata">

**Author:** ![redscic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/redscic/32/11555_2.png) [@redscic](https://forum.ghost.org/u/redscic)\
**Post date:** [February 22, 2021, 6:59pm UTC](https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323/3 "2021-02-22T18:59:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![spectral](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/spectral/32/11724_2.png) [@spectral](https://forum.ghost.org/u/spectral)\
**Post date:** [February 22, 2021, 8:44pm UTC](https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323/4 "2021-02-22T20:44:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![denvergeeks](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/denvergeeks/32/7401_2.png) [@denvergeeks](https://forum.ghost.org/u/denvergeeks)\
**Post date:** [February 22, 2021, 11:25pm UTC](https://forum.ghost.org/t/categorizations-with-tags-is-it-possible-primary-secondary-tags/20323/5 "2021-02-22T23:25:45Z")

</div>

@redscic here is a search on this forum for that topic: [Search results for 'nested tags' - Ghost Forum](https://forum.ghost.org/search?q=nested%20tags)

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

> [@Are complex URL hierarchy possible?](https://forum.ghost.org/t/are-complex-url-hierarchy-possible/5877):
>
> Hi, i want to create a product review site and I’m wondering if complex URL hierarchy is possible. I’m aware of the Ideas [Nested/hierarchical tags, subtags](https://forum.ghost.org/t/nested-hierarchical-tags-subtags/382), but my understanding is that this nested/hierarchical tags subtags don’t apply to URL. Am I wrong? Because the same products are not available in North America and Europe and also people can speak more than one language in one specific country, I want to be able to adapt to the market with this kind of hierarchy. I want to achieve a struc…

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](https://microchic.com) site:

[http://pixelandkraft.com/blockster/demo/](http://pixelandkraft.com/blockster/demo/)

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