# How to add the image for the taxonomy term?

**URL:** <https://discourse.gohugo.io/t/how-to-add-the-image-for-the-taxonomy-term/23793>\
**Category:** support\
**Created:** [March 3, 2020, 8:16am UTC](https://discourse.gohugo.io/t/how-to-add-the-image-for-the-taxonomy-term/23793 "2020-03-03T08:16:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![serii366](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/serii366/32/10693_2.png) [@serii366](https://discourse.gohugo.io/u/serii366)\
**Post date:** [March 3, 2020, 8:16am UTC](https://discourse.gohugo.io/t/how-to-add-the-image-for-the-taxonomy-term/23793/1 "2020-03-03T08:16:07Z")

</div>

Hi, I create the taxonomy drinkscategories, and add it in the config.toml.  
Also i create the terms in content/drinkscategories/ and display the list of this terms on the home page.

```
<div class="categories-block">
    {{ range .Site.Taxonomies.drinkscategories }}
    <div class="categories-block__item" style="background-image: url('')">
        <div class="categories-block__footer">
            <h4 class="title">{{ .Page.Title }}</h4>
            <a class="link" href="#">
                <span> Vai al catalogo</span>
                <i class="fas fa-chevron-circle-right"></i>
            </a>
        </div>
    </div>
    {{ end }}
</div>

```

But, how can i add the image for the term to display it on the home page in cycle.  
Thanks.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 3, 2020, 9:44am UTC](https://discourse.gohugo.io/t/how-to-add-the-image-for-the-taxonomy-term/23793/2 "2020-03-03T09:44:04Z")

</div>

Please read the support guidelines and provide a sample repo with your project: [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132)

---

<div class="post-metadata">

**Author:** ![serii366](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/serii366/32/10693_2.png) [@serii366](https://discourse.gohugo.io/u/serii366)\
**Post date:** [March 3, 2020, 9:48am UTC](https://discourse.gohugo.io/t/how-to-add-the-image-for-the-taxonomy-term/23793/3 "2020-03-03T09:48:40Z")

</div>

But i am resolve my problem, thanks.

```auto
    <div class="categories-block">
        {{ $drinkscategories := .Site.Taxonomies.drinkscategories }}
        {{ range $drinkscategories }}
            <div class="categories-block__item" style="background-image: url('{{ .Page.Params.imageForBlocks | absURL }}')">
                <div class="categories-block__footer">
                    <h4 class="title">{{ .Page.Title }}</h4>
                    <a class="link" href="#">
                        <span> Vai al catalogo</span>
                        <i class="fas fa-chevron-circle-right"></i>
                    </a>
                </div>
            </div>
        {{ end }}

    </div>

```

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 5, 2020, 9:48am UTC](https://discourse.gohugo.io/t/how-to-add-the-image-for-the-taxonomy-term/23793/4 "2020-03-05T09:48:40Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
