# Specific title for taxonomies pages

**URL:** <https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131>\
**Category:** support\
**Created:** [August 26, 2017, 8:56am UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131 "2017-08-26T08:56:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geonov](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@Geonov](https://discourse.gohugo.io/u/Geonov)\
**Post date:** [August 26, 2017, 8:56am UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131/1 "2017-08-26T08:56:22Z")

</div>

Hi,

I’m using the two default taxonomies : tag & category

I want specific titles for pages from \layouts\taxonomy\tag.html & \layouts\taxonomy\category.html  
For tags, I want : “Tag [tag]” and for categories, I want : “Category [category]”

For now I’m using this in my header.html :

```
{{ if eq .Kind "taxonomy" }}
<title>Taxonomy {{ .Title }}</title>
{{ else }}
<title>{{ .Title }}</title>
{{ end }}

```

So actually titles for tags are “Taxonomy [tag]” and titles for categories are “Taxonomy [category]”.  
But I want “Tag [tag]” & “Category [category]”.

Regards.

---

<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:** [August 26, 2017, 8:36pm UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131/2 "2017-08-26T20:36:32Z")

</div>

I don’t think there is a variable for taxonomy name. You will need to add more conditional logic, or create your own array and pull from that.

You can probably keep it simple using [`with`](https://gohugo.io/functions/with/) instead of `if`.

---

<div class="post-metadata">

**Author:** ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)\
**Post date:** [August 27, 2017, 3:43pm UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131/3 "2017-08-27T15:43:23Z")

</div>

Try `content/taxonomy/_index.md` and put front matter `title` in. Have the same and it works.

---

<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:** [August 27, 2017, 8:03pm UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131/4 "2017-08-27T20:03:48Z")

</div>

I don’t think that is what the OP is asking for. I know they use confusing examples, but I think they are trying to get the “Taxonomy” in their code snippet to say either Tag or Category, depending on the name of the taxonomy, _not_ the term title.

So when they say:

> So actually titles for tags are “Taxonomy [tag]” and titles for categories are “Taxonomy [category]”.  
> But I want “Tag [tag]” & “Category [category]”.

I believe they mean:

> So actually titles for tags are “Taxonomy [Earth]” and titles for categories are “Taxonomy [Planet]”.  
> But I want “Tag [Earth]” & “Category [Planet]”.

Or I misunderstanding. 🙂

---

<div class="post-metadata">

**Author:** ![guayom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/guayom/32/3732_2.png) [@guayom](https://discourse.gohugo.io/u/guayom)\
**Post date:** [August 28, 2017, 2:44am UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131/5 "2017-08-28T02:44:23Z")

</div>

@Geonov Since you’re on a taxonomy template, you can use `{{ .Data.Singular | title }}`.

To generate the full title string you could do `{{ print (.Data.Singular | title) " " .Title }}`

---

<div class="post-metadata">

**Author:** ![Geonov](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@Geonov](https://discourse.gohugo.io/u/Geonov)\
**Post date:** [August 28, 2017, 7:47am UTC](https://discourse.gohugo.io/t/specific-title-for-taxonomies-pages/8131/6 "2017-08-28T07:47:54Z")

</div>

Thanks guys. Maiki is right.

```
{{ if eq .Kind "taxonomy" }}
<title>{{ .Data.Singular }} {{ .Title }}</title>
{{ else }}
<title>{{ .Title }}</title>
{{ end }}

```

did the trick.

Thanks guayom.
