<p>5th line: <code>category.videoLink|length%}</code>
Could you try to insert a space between "length" and "%"?</p>

CC BY-SA 4.0
2020-04-21T13:32:26.993Z
2020-04-21T13:32:26.993Z
Kota.M
<p>I am making a condition to use a certain template for a specific article category, but it's not working and giving me an error.</p>

<pre><code>{% extends "_layout" %}

{% set title = category.title %}

{% block head %}
{% endblock %}

{% block content %}


    {% if category.postType=="video" or category.videoLink|length%}
        {% include 'news/hiwar.html' %}
    {% elseif category.postType=="file" %}
        {% include 'news/file.html' %}
    {% else %}
        {% include 'news/articless.html' %}
    {% endif %}


{% endblock %}
</code></pre>

CC BY-SA 4.0
2020-04-21T09:32:07.943Z
Could you add the error you are getting to your question?
Oli
CC BY-SA 4.0
2020-04-21T17:37:34.530Z
What does this {{ category.postType }} or this {{ category.videoLink|length }} show for a value?
Jim Wyse
<craft3><entries><categories>
if statement in a template not working
# if statement in a template not working

(Asked by: username_0 on 2020-04-21)

I am making a condition to use a certain template for a specific article category, but it's not working and giving me an error.
{% extends "_layout" %}

{% set title = category.title %}

{% block head %}
{% endblock %}

{% block content %}


    {% if category.postType=="video" or category.videoLink|length%}
        {% include 'news/hiwar.html' %}
    {% elseif category.postType=="file" %}
        {% include 'news/file.html' %}
    {% else %}
        {% include 'news/articless.html' %}
    {% endif %}


{% endblock %}

**Tags:** craft3, entries, categories
> **Comments:**
> **username_1**: Could you add the error you are getting to your question?  
> **username_2**: What does this {{ category.postType }} or this {{ category.videoLink|length }} show for a value?  

---

## 1 answers

### Answer by username_3 on 2020-04-21. Score: -1

5th line: `category.videoLink|length%}`
Could you try to insert a space between "length" and "%"?


---

