# Conditionals with this style \[\[params.user\_defined\]\]

**URL:** <https://discourse.gohugo.io/t/conditionals-with-this-style-params-user-defined/12774>\
**Category:** support\
**Created:** [July 6, 2018, 5:01pm UTC](https://discourse.gohugo.io/t/conditionals-with-this-style-params-user-defined/12774 "2018-07-06T17:01:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hakuoku](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hakuoku/32/6342_2.png) [@hakuoku](https://discourse.gohugo.io/u/hakuoku)\
**Post date:** [July 6, 2018, 5:01pm UTC](https://discourse.gohugo.io/t/conditionals-with-this-style-params-user-defined/12774/1 "2018-07-06T17:01:03Z")

</div>

Hello,

I’m trying to output params wrapped by p tag or a tag by whether they have links in their values.  
Here are my config.toml.

```auto
[[params.footer]]
    name = "Address"
    url = false
[[params.footer]]
    name = "GitHub"
    url = "https://github.com/"

```

And my code is this.

```auto
<ul class="footer-contents">
    {{ range .Site.Params.footer }}
        {{ if ne .Params.footer.url false }}
            <li class="footer-contents__item"><a href="{{ .url }}">{{ .name }}</a></li>
        {{ else }}
            <li><p class="footer-contents__item">{{ .name }}</p></li>
        {{ end }}
    {{ end }}
</ul>

```

I expeced that first Address should be rendered as p and second be a. But Hugo rendered both as a.  
Is there any mistake for my logic or do I take wrong way at all?

Thank you,

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [July 7, 2018, 12:31am UTC](https://discourse.gohugo.io/t/conditionals-with-this-style-params-user-defined/12774/2 "2018-07-07T00:31:15Z")

</div>

Your `if` block is inside the `range` [context](https://gohugo.io/templates/introduction/#context-aka-the-dot) :

> Inside of an iteration, however, it will have the value of the current item in the loop; i.e., {{ . }} will no longer refer to the data available to the entire page.

So:

```auto
{{ range .Site.Params.footer }}
  {{ if ne .url false }}
    ...

```

---

<div class="post-metadata">

**Author:** ![hakuoku](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hakuoku/32/6342_2.png) [@hakuoku](https://discourse.gohugo.io/u/hakuoku)\
**Post date:** [July 7, 2018, 1:38pm UTC](https://discourse.gohugo.io/t/conditionals-with-this-style-params-user-defined/12774/3 "2018-07-07T13:38:34Z")

</div>

It completely works! Thanks a lot for replying such beginner’s question! 🙇‍♂️
