# Get Primary Tags List

**URL:** <https://forum.ghost.org/t/get-primary-tags-list/920>\
**Category:** Ideas\
**Created:** [April 16, 2018, 2:04am UTC](https://forum.ghost.org/t/get-primary-tags-list/920 "2018-04-16T02:04:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluefalcon](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/bluefalcon/32/436_2.png) [@bluefalcon](https://forum.ghost.org/u/bluefalcon)\
**Post date:** [April 16, 2018, 2:04am UTC](https://forum.ghost.org/t/get-primary-tags-list/920/1 "2018-04-16T02:04:07Z")

</div>

Hello - I would like to create a widget/side menu that displays a list of tags, but I only want certain tags that I plan to use a categories.

First off this is my second day using ghost and trying to learn handlebars etc… So I’m drowning or barley keeping a float. So far I love what Ghost has to offer.

1. My first idea is to use a pattern where all stories the first tag/primary tag would be the category and display those so it’s dynamic in a sense.
2. My second Idea is to simply hard code the tags using conditional logic I want as I’m looping through them.

How do I go about doing this. Any help is appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [April 16, 2018, 4:46pm UTC](https://forum.ghost.org/t/get-primary-tags-list/920/2 "2018-04-16T16:46:05Z")

</div>

Hi there,

Have you had a look at the [get helper](https://themes.ghost.org/docs/get)? It’s designed for exactly this kind of thing. You can use a filter to fetch all tags in a group, like this

`{{#get "tags" filter="slug:[tag-1, tag-2, tag-3]"}}{{/get}}`

You’d combine this with a foreach loop, and some markup, something like this:

```auto
{{#get "tags" filter="slug:[tag-1, tag-2, tag-3]"}}
  {{#foreach tags}}
    <a href="{{url}}">{{name}}</a>
  {{/foreach}}
{{/get}}

```

This gives you your option 2 - a hard coded list.

Currently it’s not possible in a performant/sensible way to make a request for all the tags that are used as primary tags, but we’re working on advanced blog structures like this, so I’d highly recommend using the hardcoded version for now, and updating your code later when we have the ability to do what you need more easily.

---

<div class="post-metadata">

**Author:** ![bluefalcon](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/bluefalcon/32/436_2.png) [@bluefalcon](https://forum.ghost.org/u/bluefalcon)\
**Post date:** [April 16, 2018, 6:19pm UTC](https://forum.ghost.org/t/get-primary-tags-list/920/3 "2018-04-16T18:19:00Z")

</div>

Hi - Thank you for the response.

Yes - I finally came across the ghost api docs and landed up doing something similar.

```auto
{{#get "tags" filter="name:tag-1,name:tag-2,name:tag-3"}}
  {{#foreach tags}}
    <a href="{{url}}">{{name}}</a>
  {{/foreach}}
{{/get}}

```

Thank you for letting me know about not being able to get primary tags in a performant/sensible way. I still wanted to tackle that. 🙂

---

<div class="post-metadata">

**Author:** ![Kheo](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@Kheo](https://forum.ghost.org/u/Kheo)\
**Post date:** [January 5, 2019, 6:34am UTC](https://forum.ghost.org/t/get-primary-tags-list/920/4 "2019-01-05T06:34:31Z")

</div>

Hello,  
I’m interested in having this option

> a request for all the tags that are used as primary tags

has anything changed since?  
thank you!

---

<div class="post-metadata">

**Author:** ![Hyst\_Cast](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hyst_cast/32/3977_2.png) [@Hyst\_Cast](https://forum.ghost.org/u/Hyst_Cast)\
**Post date:** [July 3, 2019, 6:30pm UTC](https://forum.ghost.org/t/get-primary-tags-list/920/5 "2019-07-03T18:30:59Z")

</div>

I second that request for the ability to return all tags that are used as primary tags for a drop down selector of major topics.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [July 4, 2019, 7:40pm UTC](https://forum.ghost.org/t/get-primary-tags-list/920/6 "2019-07-04T19:40:34Z")

</div>

I’ve moved this topic to ideas where it can be voted on. It’s not trivial to implement, so it would be interesting to know how many people are interested.
