By keeping the footer separate from the header I can make my app more
modular, and more segregated. It is more common in django than web2py
I guess...but I find it is a good habit.

The blocks are a great addition, I have no need yet, as the method I
mentioned above works exactly as I need it to. There are LOTS of uses
for blocks though, so I am very happy they are included now. I will
definitely make much use of them.

Thanks!



On Oct 23, 11:31 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> Why keep them in separate files? You may also want to check the new
> {{block name}}..{{end}} feature. It is described in the book.
>
> On Oct 24, 1:10 am, b00m_chef <r...@devshell.org> wrote:
>
>
>
>
>
>
>
> > My desired result was achieved...Thanks to your explanation above. I
> > wanted to have 1 html file linking the two header.html and footer.html
> > files. This example would be good to have in the book as it really
> > shows how the extend & includes work...at least it explained it better
> > for me (the book's example is too simple). I wanted to have 1 extend
> > at the top of the body.html file...here is what I did:
>
> > header.html
> > <html><head></head><body>
>
> > footer.html
> > </body></html>
>
> > main.html
> > {{include 'header.html'}} <div> my body stuff here </div>{{include
> > 'footer.html'}}
>
> > body.html
> > {{extend 'main.html'}}<div> my body stuff here!</div>
>
> > On Oct 23, 11:02 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > If this worked was a bug. You cannot extend two views.
>
> > > You can do this:
>
> > > layout.html
> > > <html><head></head><body>{{include}}</body></html>
>
> > > main.html
> > > {{extend 'layout.html'}} <div> my body stuff here </div>
>
> > > Or you can do this:
>
> > > header.html
> > > <html><head></head><body>
>
> > > footer.html
> > > </body></html>
>
> > > main.html
> > > {{include 'header.html'}} <div> my body stuff here </div>{{include
> > > 'footer.html'}}
>
> > > You can have various combination of the two but not the one you used.
> > > As explained in the manual the view hierarchy is a try. Extend points
> > > to a parent. A node in a tree cannot have two parents.
>
> > > On Oct 24, 12:37 am, b00m_chef <r...@devshell.org> wrote:
>
> > > > I noticed my app from a few releases back stopped working with regard
> > > > to the view. I had a file that extended 2 files (a header.html, and a
> > > > footer.html), it then included (in-between the 2 extends) a body.
>
> > > > Only the last extend will execute in the below main.html file in the
> > > > current release (1.87.3), however, in previous versions (a few months
> > > > ago) this would work as expected:
>
> > > > header.html
> > > > <html><head></head><body>{{include}}
>
> > > > footer.html
> > > > {{include}}</body></html>
>
> > > > main.html
> > > > {{extend 'header.html'}} <div> my body stuff here </div>{{extend
> > > > 'footer.html'}}

Reply via email to