On Sep 18, 9:48 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 18, 2008, Daniel Roseman <[EMAIL PROTECTED]> wrote: > >On Sep 18, 8:50 am, "Daniele Procida" <[EMAIL PROTECTED]> > >wrote: > >> I have a base.html template. > > >> In it I've inserted: > > >> {% block stylesheets %}{% endblock %} > > >> and in stylesheets.html in the same directory: > > >> {% extends "base.html" %} > >> {% block stylesheets %} > >> <--- my styles ---> > >> {% endblock %} > > >> But the {% block stylesheets %} in stylesheets.html isn't filling in the > >> block in base.html - obviously I'm missing something simple here; what > >is it? > > >> Thanks, > > >> Daniele > > >Please start a new thread, rather than piggy-backing onto an existing > >one. > > Oh - this is using References: - oops, sorry. I didn't realise my mail > client was going to be posting References:. > > >You don't show how you're calling this template from your view. Are > >you sure you're rendering the child template (stylesheets.html) rather > >than base.html? > > base.html is successfully rendered. > > This is the views.py - it's part of Django CMS (<http://django-cms.org/): > > <http://trac.django-cms.org/trac/browser/trunk/cms/views.py> > > I'm not quite sure what's going on in there. > > Daniele
That view code doesn't help, as you don't seem to be rendering either base or stylesheet there, and I don't know enough about your project to know what it does. But the fact that you're saying 'base.html is successfully rendered' leads me to suspect that you're doing something like: return render_to_response('base.html', context) This will only ever show the contents of base.html, since inheritance works in the other direction. If you want to display the contents of stylesheet.html, you need to call render or render_to_response on *that* template, and Django will walk up the chain of 'extends' tags to include base.html as well. -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---