Displaying all taxonomies for a specific type of content only


#1

Given 2 different content types exist, say “publication” and “post”, both containing tags taxonomy parameter, how can I retrieve a list of tags used only in the “publication” content?

I think I’m close with what I have below, but it’s returning a list of all publication pages rather than a specific list of tags used in the publication content:

{{ range $key, $taxonomy := (where .Data.Pages "Type" "publication") ".Params.tags" "intersect" .Site.Taxonomies.tags }} Key: {{ $key }} Taxonomy: {{ $taxonomy }} {{ end }}

Any help is much appreciated :slightly_smiling:


#2

Hi @neutreno! How could you solve this case?


#3

@rougeth is this as same as what I need help here?
https://discourse.gohugo.io/t/need-help-how-to-get-list-page-when-click-on-a-tag-shared-by-different-sections/11858


#4

@Bin951 yes, it is! We want the same thing :slight_smile:


#5

@rougeth Same here, I still cannot find an elegant method to work it out till now.