# If block not working in partial

**URL:** <https://discourse.gohugo.io/t/if-block-not-working-in-partial/13243>\
**Category:** support\
**Created:** [July 30, 2018, 10:31pm UTC](https://discourse.gohugo.io/t/if-block-not-working-in-partial/13243 "2018-07-30T22:31:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesTheHacker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jamesthehacker/32/6919_2.png) [@JamesTheHacker](https://discourse.gohugo.io/u/JamesTheHacker)\
**Post date:** [July 30, 2018, 10:31pm UTC](https://discourse.gohugo.io/t/if-block-not-working-in-partial/13243/1 "2018-07-30T22:31:42Z")

</div>

I can’t seem to get if blocks working in my partials. For example, I have the following if block in my `how-it-works.html` file:

```
{{ if .Site.Params.how_it_works }}
<h2>How It Works</h2>
<p>This is how it works</p>
{{ end }}

```

And in `config.toml` I have:

```
logo = "img/logo.svg"

[params.how_it_works]
    enable = true

```

I haven’t written a block to check `enabled` just yet as I haven’t been able to progress past this issue. If I remove the if block it loads the partial onto the page.

Where am I going wrong?

---

<div class="post-metadata">

**Author:** ![JamesTheHacker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jamesthehacker/32/6919_2.png) [@JamesTheHacker](https://discourse.gohugo.io/u/JamesTheHacker)\
**Post date:** [July 30, 2018, 11:19pm UTC](https://discourse.gohugo.io/t/if-block-not-working-in-partial/13243/2 "2018-07-30T23:19:21Z")

</div>

Solved. The theme I was modifying is based on an older version of Hugo. I just updated the theme to use `with` and all works fine.
