Custom Tags and Includes, invalid block !

173 views
Skip to first unread message

upmauro

unread,
Jun 18, 2012, 6:37:29 PM6/18/12
to django...@googlegroups.com
Hello, sorry my english !

I have one question, i create one custom tag and this works fine.

But i have a situation :

site.html

{% include "header.html" %}

Django looks the best framework for web !

{% include "footer.html" %}

If, i use {% load %} in site.html, tag works, but if i {% load %} tag in "header.html", when i try use custom tag in site.html raise Invalid block tag.

In short, if I load the page included a tag on it is not recognized in the current page.

Meant to be?

Ernesto Guevara

unread,
Jun 18, 2012, 6:47:50 PM6/18/12
to django...@googlegroups.com
Hi!
Try {% load name_of_custom_tag %} after the extends tag in template.



2012/6/18 upmauro <upm...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/E7i9EQSjhCoJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

bruno desthuilliers

unread,
Jun 19, 2012, 5:35:20 AM6/19/12
to django...@googlegroups.com


On Tuesday, June 19, 2012 12:37:29 AM UTC+2, upmauro wrote:
Hello, sorry my english !

I have one question, i create one custom tag and this works fine.

But i have a situation :

site.html

{% include "header.html" %}

Django looks the best framework for web !

{% include "footer.html" %}


Just as a side note : Django template system has template inheritance which is a way better solution than PHP-ish includes wrt/ site-wide page layout.

(snip - Guevara already answered the question).
Reply all
Reply to author
Forward
0 new messages