# Need help: How to get list page when click on a tag shared by different sections?

**URL:** <https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858>\
**Category:** support\
**Created:** [May 6, 2018, 2:44pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858 "2018-05-06T14:44:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bin951](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bin951/32/5003_2.png) [@Bin951](https://discourse.gohugo.io/u/Bin951)\
**Post date:** [May 6, 2018, 2:44pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/1 "2018-05-06T14:44:28Z")

</div>

For the two Sections : Jobs and Events , there are tags shared between them,

```auto
.
└── content
    ├── jobs 
    │ ├── job-1.md #with tags: golang, big-data
    │ ├── job-2.md #with tags: golang
    │ └── job-3.md
    └── events 
        ├── event-1.md #with tags: golang, big-data, awsome
        └── event-2.md

```

when I visit job-1 and click the tag: `golang`, I would like to list all jobs with this tag. [--NOT list all jobs+events tagged with `golang`. by DEFAULT]

How should I do this ?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [May 12, 2018, 3:45am UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/2 "2018-05-12T03:45:25Z")

</div>

Depending on your theme, you’ll look up the template that is rendering your tag pages, and change the range on it to only show pages from your `jobs` section.

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [May 14, 2018, 8:09pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/3 "2018-05-14T20:09:13Z")

</div>

> [@Bin951](#):
>
> when I visit job-1 and click the tag: `golang` , I would like to list all jobs with this tag. [--NOT list all jobs+events tagged with `golang` . by DEFAULT]

I don’t think that can be done elegantly… the only way that I can think of is that you manually create templates for each **section + tag** combination.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [May 15, 2018, 7:44pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/4 "2018-05-15T19:44:24Z")

</div>

I was thinking they didn’t want `events` to show up at all, in which case they could just edit the single template to only show the `jobs` section. Then they’ll know if that is what they really want. 🙂

---

<div class="post-metadata">

**Author:** ![Bin951](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bin951/32/5003_2.png) [@Bin951](https://discourse.gohugo.io/u/Bin951)\
**Post date:** [May 16, 2018, 2:28pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/5 "2018-05-16T14:28:15Z")

</div>

@maiki and @kaushalmodi thanks for your quick help.

For content organization and status of my side-project (still developed on my mac-pc locally), I could point a theme for reference so that you can understand my question clearly: [https://themes.gohugo.io/minimal/](https://themes.gohugo.io/minimal/), and its github repository located at [https://github.com/calintat/minimal](https://github.com/calintat/minimal)

No matter in which section `POSTS` or `PROJECTS`, when you click the Golang tag, you will get a list page as shown [https://themes.gohugo.io/theme/minimal/tags/golang](https://themes.gohugo.io/theme/minimal/tags/golang)

what I would like to get is:  
1, when I visit [Post Section](https://themes.gohugo.io/theme/minimal/post/) and click Golang tag, list all Post Section pages tagged with Golang  
2, when I visit [Projects Section](https://themes.gohugo.io/theme/minimal/project) and click Golang tag, list all Project Section pages tagged with Golang

Almost same as what I am working on, so I take this theme as a example.  
Thank you all again.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [May 16, 2018, 6:56pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/6 "2018-05-16T18:56:09Z")

</div>

That can’t be done with a single taxonomy. You can use multiple taxonomies, though.

---

<div class="post-metadata">

**Author:** ![vassudanagunta](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vassudanagunta/32/4113_2.png) [@vassudanagunta](https://discourse.gohugo.io/u/vassudanagunta)\
**Post date:** [May 16, 2018, 8:29pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/7 "2018-05-16T20:29:57Z")

</div>

You can certainly do this, but not without customization of the theme, or finding a theme that is designed to do this (though I don’t know if any exist), unless you are willing to go with Option C below. Hugo’s tags work site-wide, and most if not all existing themes stick with that.

The approach you take depends on whether you want these tags to work only per section or work both ways, site-wide and per section.

#### Option A: per section tags

You probably should just use separate taxonomies as @maiki suggests, but then you’d have to override the theme to list on each page the section specific taxonomy rather than the global “tags” taxonomy.

#### Option B: global and per section tags

1. the global tags indexes would be generated at `/tags` as they normally would
2. as @kaushalmodi suggests, you have to figure out how to, under `/jobs/tags` and `/projects/tags`, generate the same kinds of pages generated under `/tags`, but filtered by section. Not trivial.
3. change the page templates so that the tags for the page link to the section specific index.

#### Option C: per section tags (alternate approach)

Treat each section with its own tag space as a separate Hugo site, which you would publish to a subdirectory in your webroot so that the end result would be a single site. You might have to make the right settings in Hugo for that to work (base URL? relative paths?).

I think A or C is easiest, depending.

---

<div class="post-metadata">

**Author:** ![Bin951](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bin951/32/5003_2.png) [@Bin951](https://discourse.gohugo.io/u/Bin951)\
**Post date:** [May 17, 2018, 2:02pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/8 "2018-05-17T14:02:51Z")

</div>

@maiki thanks for instruction.

> [@maiki](#):
>
> That can’t be done with a single taxonomy. You can use multiple taxonomies, though.

Still cannot get your point to work it out, sorry. any example of it?

**Could it be a feature request?** @bep

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [May 17, 2018, 7:28pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/9 "2018-05-17T19:28:39Z")

</div>

Hey, please don’t tag people, especially Bjørn like that. This is a #support thread, start a #feature topic if you have a request.

> [@Bin951](#):
>
> Still cannot get your point to work it out, sorry. any example of it?

Instead of having `tags`, create a taxonomy called `posttags`. Then do the same for the other section. Now you have two separate taxonomies. They will have their own lists of content tagged `golang`: `/posttags/golang` and `/projecttags/golang`.

---

<div class="post-metadata">

**Author:** ![Bin951](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bin951/32/5003_2.png) [@Bin951](https://discourse.gohugo.io/u/Bin951)\
**Post date:** [May 17, 2018, 10:10pm UTC](https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858/10 "2018-05-17T22:10:54Z")

</div>

> [@maiki](#):
>
> Hey, please don’t tag people, especially Bjørn like that. This is a #support thread, start a #feature topic if you have a request.

Apologize for my bad action.
