# Modify a display according to the context

**URL:** <https://discourse.gohugo.io/t/modify-a-display-according-to-the-context/33935>\
**Category:** support\
**Tags:** taxonomy\
**Created:** [July 22, 2021, 10:13am UTC](https://discourse.gohugo.io/t/modify-a-display-according-to-the-context/33935 "2021-07-22T10:13:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![heloisel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/heloisel/32/14841_2.png) [@heloisel](https://discourse.gohugo.io/u/heloisel)\
**Post date:** [July 22, 2021, 10:13am UTC](https://discourse.gohugo.io/t/modify-a-display-according-to-the-context/33935/1 "2021-07-22T10:13:18Z")

</div>

Hello,

I currently need help to modify a display according to the context.  
I am using Hugo (v. 0.84.3 extended), and I am using the [GeekDoc theme](https://github.com/thegeeklab/hugo-geekdoc). This one doesn’t support tags, so I’m implementing them to contribute.  
Currently, whether I display the list of tags or the list of articles corresponding to the selected tags  
the CSS remains the same 🙂

 ![imageonline-co-merged-image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/1/1a395bede23457cf8b8e7c349cca243b479f9462.jpeg)  
I’ve read the documentation, but I don’t know how to do it.  
I would like to be able to differentiate the CSS according to what my page displays :

```auto
{{ define "main" }}
  {{ partial "page-header" . }}

  {{ range (.Paginator 100).Pages.ByTitle }}

  <div class="tags gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}">
    <a class="tag-link" href="{{ .RelPermalink }}">{{ partial "title.html" . }}</a>
  </div>

  {{ end }}
{{ end }}

```

Thank you for your time and your help.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [July 22, 2021, 2:11pm UTC](https://discourse.gohugo.io/t/modify-a-display-according-to-the-context/33935/2 "2021-07-22T14:11:10Z")

</div>

There are at least a couple of ways to approach this:

1. Create a unique template using the rules described here:  
[https://gohugo.io/templates/lookup-order](https://gohugo.io/templates/lookup-order)

2. Use conditional logic within the template based on the page’s [kind](https://gohugo.io/templates/section-templates/#page-kinds). For example:

```auto

```

---

<div class="post-metadata">

**Author:** ![heloisel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/heloisel/32/14841_2.png) [@heloisel](https://discourse.gohugo.io/u/heloisel)\
**Post date:** [July 26, 2021, 7:21am UTC](https://discourse.gohugo.io/t/modify-a-display-according-to-the-context/33935/3 "2021-07-26T07:21:36Z")

</div>

Hello,  
Thanks for your help !

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [July 28, 2021, 7:21am UTC](https://discourse.gohugo.io/t/modify-a-display-according-to-the-context/33935/4 "2021-07-28T07:21:57Z")

</div>

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