Daishy, it would help if you posted the template code you already
tried.

This is basically how you could do what you are describing:
base.html

<html>
<head>
{% block extrahead %}
<script src=some javascript></script>
<some css link>
{% endblock %}
</head>
....
</html>

sub_page.html
{% extends "base.html" %}
{% block extrahead %}
{{ block.super }}
<script src=page_specific_js>
{% endblock %}

On Feb 1, 11:56 am, Daishy <[email protected]> wrote:
> Hi,
>
> i'm pretty new to django and just stumbled upon a question i didnt
> found a solution to, despite the good docs :).
> I have a base-template which defines a block calles js and css. Now i
> can extend that template and use these blocks and block.super, to add
> javascript or css-files to those already defined in the base-template.
> But what if i have a template that is included in the base-template
> and should also add js/css-files? I tried defining those blocks within
> the included file and call block.super, but that doesnt seem to work.
> Is there anything i missed or another, better solution?
>
> (I want to include a menu within the base-template and put all the
> html and css/js-script required for it into one file, so its not
> scattered on several files)
>
> Greetings,
> Daishy

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

Reply via email to