8

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?

AppleGrew
  • 9,302
  • 24
  • 80
  • 124

1 Answers1

27

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

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • 15
    TIL. For anybody else coming here from google like I did, this applies just as readily when you want to use `{% static 'somefile' %}`; every template must contain `{% load staticfiles %}` even if it extends a template that already contains that. – chucksmash Jan 18 '13 at 02:41