Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - Why am I getting TemplateSyntaxError?

I have included a new app django_colorbox in my Pinax project. For some reason the following code throw TemplateSystaxError: Invalid block tag: 'include_colorbox', expected 'endblock' or 'endblock extra_head'.

{% block extra_head %} <!-- Defined in base html template -->
    {% include_colorbox %} <!-- Simple tag defined in django_colorbox -->
{% endblock %}

The source code for the errand simple tag is - https://github.com/aljosa/django-colorbox/blob/master/django_colorbox/templatetags/colorbox_tags.py.

If I can embedded other build-in tags (e.g. blocktrans) inside block then why not the custom simple tags?

like image 249
AppleGrew Avatar asked Mar 05 '12 19:03

AppleGrew


1 Answers

You need to have {% load colorbox_tags %} in every template where you use one of the tags.

like image 145
Daniel Roseman Avatar answered Oct 05 '22 08:10

Daniel Roseman