# Liquid if statement error

**URL:** <https://talk.jekyllrb.com/t/liquid-if-statement-error/2953>\
**Category:** Help\
**Created:** [May 30, 2019, 9:27pm UTC](https://talk.jekyllrb.com/t/liquid-if-statement-error/2953 "2019-05-30T21:27:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinjh99](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@martinjh99](https://talk.jekyllrb.com/u/martinjh99)\
**Post date:** [May 30, 2019, 9:27pm UTC](https://talk.jekyllrb.com/t/liquid-if-statement-error/2953/1 "2019-05-30T21:27:15Z")

</div>

The menu.yml file is similar to the one in the Navigation document apart from the fact that I have added an nd item to control the displaying of the title as I don’t want the title on the first item

This is the html in the include file:

```
<div class="menu">
{% for item in site.data.menu.toc %}
{% if item.nd = true}
<h3>{{ item.title }}</h3>
{% endif %}
{% for entry in item.subfolderitems %}
<a href="{{ entry.url }}">{{ entry.page }}</a>
{% endfor %}
</div>

```

I am always getting the following from Jekyll when rebuilding…

```
Liquid Exception: Liquid syntax error (/home/martin/jeykll/prototype/_includes/menu.html line 18): 'if' tag was never closed included in /_layouts/default.html
Error: Liquid syntax error (/home/martin/jeykll/prototype/_includes/menu.html line 18): 'if' tag was never closed included

```

I’m not sure what the problem is and where the actual error is. AFAIK there are enough end loops…

Realised I had structured the yml wrong, changed that but it still won’t work…

Full code is on Github at [https://github.com/martinjh99/jekyllsite](https://github.com/martinjh99/jekyllsite)

Anyone got any ideas?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [May 30, 2019, 11:19pm UTC](https://talk.jekyllrb.com/t/liquid-if-statement-error/2953/2 "2019-05-30T23:19:56Z")

</div>

you are missing an endfor I think - you have two for loops but only one is closed…

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [May 31, 2019, 2:05am UTC](https://talk.jekyllrb.com/t/liquid-if-statement-error/2953/3 "2019-05-31T02:05:03Z")

</div>

> [@martinjh99](#):
>
> {% if item.nd = true}

You’re missing a %, should be:

```yaml
{% if item.nd = true %}

```
