0

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 %}
  • 1
    Could you add the error you are getting to your question? – Oli Apr 21 at 9:32
  • 1
    What does this {{ category.postType }} or this {{ category.videoLink|length }} show for a value? – Jim Wyse Apr 21 at 17:37
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.