Take a look at this page that describes site layout templates:
http://webpy.org/cookbook/layout_template

However, I find that this isn't quite enough for more complex layouts,
and have started using Jinja2 templates, which support template
inheritance. It's not as "python" like as templator templates, but it
makes complicated layouts much easier IMHO.

On Fri, Jan 23, 2009 at 4:05 PM, haskellian <[email protected]> wrote:
>
> I don't quite understand templates. I know how to render hhtml-pages
> with
> render = web.template.render('templates/')
> and then for example:
> return render.frontpage()
>
> But I'm coding a site which has the same header on each page:
>
> <div id="header">
>  <b>NameOfSite</b>
> </div>
> <div id="options">
>  <ul id="optionslist">
>    <li><a href="http://localhost:8080/addepisode"; style="text-
> decoration:none">
>        Add a new episode
>    </a></li>
>    <li>|</li>
>    <li><a href="http://localhost:8080/searchpage"; style="text-
> decoration:none">
>        Advanced search
>    </a></li>
>    <li>|</li>
>    <li><a href="http://localhost:8080/signup"; style="text-
> decoration:none">
>        Signup</a></li>
>    <li>|</li>
>    <li><a href="http://localhost:8080/login"; style="text-
> decoration:none">
>        Login</a></li>
>  </ul>
> </div>
>
>
> How can I add that into a function or something so that instead of
> cutting and pasting this to each file I can just call a function that
> generates this html?
> (It uses CSS btw.)
> >
>



-- 
http://www.apgwoz.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to