Answers.Body: <p>5th line: <code>category.videoLink|length%}</code>
  Could you try to insert a space between "length" and "%"?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-21T13:32:26.993Z
Answers.LastActivityDate: 2020-04-21T13:32:26.993Z
Answers.UserDisplayName: Kota.M
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-21T09:32:07.943Z
Comments.Text: Could you add the error you are getting to your question?
Comments.UserDisplayName: Oli
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-21T17:37:34.530Z
Comments.Text: What does this {{ category.postType }} or this {{ category.videoLink|length }} show for a value?
Comments.UserDisplayName: Jim Wyse
Tags: <craft3><entries><categories>
Title: if statement in a template not working
ThreadText: # 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 "%"?
  
  
  ---
  
  