user11005819
user11005819

Reputation:

Unable to add different block tag to my template

I am trying to add different block tags inside a for loop but it raise an error

Did you forget to register or load this tag?

But I register it

{% for todo in todo_list %}
{% if todo.complete %}{% else %}

        {{todo.text|capfirst|truncatechars:150}} </a> <br>
        <small class="text-muted">{{todo.content|capfirst}}{% empty %} {% endif %} </small> <hr>

{% endif %}   {% endfor %}

Thanks

Upvotes: 0

Views: 29

Answers (1)

Sanip
Sanip

Reputation: 1810

Looking into your problem, I think you need to try this:

{% for todo in todo_list %}
    {% if todo.complete %}
    {% else %}
        {{todo.text|capfirst|truncatechars:150}} </a> <br>
        {% if todo.content %}
            <small class="text-muted">{{todo.content|capfirst}} </small> <hr>
        {% else %}
            //do something 
        {% endif %}  
    {% endif %} 
{% endfor %}

Upvotes: 1

Related Questions