Hi,

I'm a Django developer since more or less 3 years. Some time ago I had the
need for the extends templatetag to have more funcionality.

The funcionality I mean is that a template can extends from "itself". I'm
going to try to explain it better, so I will put Django admin as an example,
although I needed it in others places. In many projects I wanted to
customize the admin site, I wanted to tiny modify the change_list template
or the change_form template, etc. I.E. like the following:

file:templates/admin/change_list.html

{% extends "admin/change_list.html" %}

{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL
}}css/my_change_list_css.css" />
{% endblock %}


{% block breadcrumbs %}
<div class="breadcrumbs">
    <a href="../../">
    {% trans "My Project" %}
    </a>
    &rsaquo;
    <a href="../">
        {{ app_label|capfirst }}
    </a>
    &rsaquo;
    {{ cl.opts.verbose_name_plural|capfirst }}
</div>
{% endblock %}


To perform something like this, we should copy all the change_list template
(i.e. 100 lines of code), in order to add this two changes. For this subject
I created a google-code project [1], wich is working in a little project of
Universidad de Granada [2] succesfully.

I wait for yours feedback, and I hope this could be usefull

Regards,

--

REF's

1. http://code.google.com/p/django-smart-extends/
2. http://spinoff.ugr.es/

--

Pablo Martín

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

Reply via email to