if you have base.html and sidebar.html, base.html file just declare {%
block sidebar %} section and sidebar.html make implementation of it, if you
have SidebarView, then you load sidebar.html and this file take all from {%
extends base.html %}. And if you try load base.html from SidebarView - you
get it :-), but {% block sidebar %} section be blank...
суббота, 18 мая 2013 г., 12:14:37 UTC+3 пользователь Parin Porecha написал:
>
> Hi,
>
> I have just started to learn Django's template inheritance and I am stuck
> due to this problem -
> In my application's 'base.html', I have defined two blocks -
> {% block topbar %}{% endblock topbar %}
> and
> {% block sidebar %}{% endblock sidebar %}
>
> I have 2 templates - 'sidebar.html' which extends {% block sidebar %}
> and 'topbar.html' which extends {% block topbar %}
>
> The 'sidebar.html' is also divided into further blocks which are extended
> by other templates.
>
> Now, my question is -
> in 'views.py', i have a view which is supposed to render the whole
> homepage ( i.e.- including the sidebar, topbar and content ). So, which
> template should I load in the view, so that both sidebar and topbar plus
> the content defined in other templates gets shown ?
> because 'base.html' contains many children, I'm confused which one to load
>
> Thanks to mattmc who tried to help me with this in IRC. Sorry, didn't get
> it completely :)
>
> --
> Regards,
> Parin Porecha
>
> say Kifflom! <http://www.epsilonprogram.com/> and look forward to 17.09.13!
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.