Re: [Bulk] Re: Template Inheritance doubt

2013-05-21 Thread Parin Porecha
Yes, this approach is also good. Besides, I have no problem in letting the html tags remain in header and footer. Thanks :) On Tue, May 21, 2013 at 3:58 AM, Sam Solomon wrote: > If you are mainly using this for splitting stuff into multiple files, here > is what we do to accomplish the same thi

Re: [Bulk] Re: Template Inheritance doubt

2013-05-20 Thread Sam Solomon
If you are mainly using this for splitting stuff into multiple files, here is what we do to accomplish the same thing but keep it so that templates always inherit base.html instead of sidebar.html: base.html: {% extends 'header.html' %} {% block main %} {% endblock main %} header.html: {%

Re: [Bulk] Re: Template Inheritance doubt

2013-05-20 Thread Parin Porecha
Dow, I am using the chained approach which you suggested ( base -> topbar -> sidebar -> view1 ). It works perfectly as i wanted :) Thanks! On Sun, May 19, 2013 at 10:50 PM, Dow Street wrote: > Hi. I'm not sure, but we may be using the terms 'parent' and 'child' > differently (i.e. what you're

Re: [Bulk] Re: Template Inheritance doubt

2013-05-20 Thread Dow Street
Hi. I'm not sure, but we may be using the terms 'parent' and 'child' differently (i.e. what you're calling a child I'm calling a parent?). I have only used django template inheritance where a given template file has at most one {% extends %} tag in it - that is what I am referring to when I sa

Re: Template Inheritance doubt

2013-05-18 Thread Parin Porecha
Dow, I am trying to have multiple children of the same parent. And thats why I'm not able to decide which child to load. Anyways, the sidebar and topbar are more or less static, so I guess there isn't much need to have separate files for them. I want to have them different so that developing that s

Re: Template Inheritance doubt

2013-05-18 Thread Artem Zinoviev
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 - yo

Re: Template Inheritance doubt

2013-05-18 Thread Dow Street
It sounds like you are trying to have a template inherit code from multiple parents. One option is to stay with a simple inheritance hierarchy where each child template extends at most one parent template. If you want to use different code for different sub-sections of your project then just a

Template Inheritance doubt

2013-05-18 Thread 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