On 08/06/2010 12:22 PM, Alessandro Ronchi wrote:
It's useful to have some templates with the same name of another one,
like you can do with YOURPROJECT/templates/admin/base_site.html that
override the base site django default.
but If I want to add a word in the title of my base_site.html I need
to copy the entire content of the base_site.html I am overriding, and
I cannot extend it to avoid that with am {% extend
"admin/templates/base_site.html" %}
or an {% extend super %}

I'm not sure if it's what you want, but... I've got a base ui application with a ui/base.html. Several blocks for the title, logo, the sidebar, footer, javascript, etc.

Several applications extend that base template. But multiple sites also want to extend it to change the global logo and footer... The sites effectively have to override the base template.


The solution: in my ui project I have a ui/realbase.html that is extended by ui/base.html. The only code in ui/base.html is the "extends" line! So overriding that one is inexpensive.

The other applications can happily extend ui/base.html and fill in the blocks that are really from ui/realbase.html. And my site can override ui/base.html and fill in the logo block and the footer block (which are normally not touched by the applications).


I hope I'm clear enough without a code example. The code, should you want to take a look, is at http://pypi.python.org/pypi/lizard-ui



Reinout


--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Programmer at http://www.nelen-schuurmans.nl
"Military engineers build missiles. Civil engineers build targets"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to