On Wed, Sep 29, 2010 at 8:29 AM, Ranganath s <[email protected]> wrote:
> Hi group,
>       I need some clarification on template inheritance of templator
> template of webpy. say i have basic.html and xyz.html. If i need to extend
> xyz.html from basic.html, how do i go about doing that ? can some one please

Basic concept is that any template accepts any variable you define in
the ``$def with`` line. That includes templates, naturally. For any
template, you can also define attributes with ``$var`` line. So, if
you have this in xyz:

    $var title: My tempalte's title

and this in base:

    $def with (child_template)

You can pass the child template as a variable to base template:

    render.base(render.xyz())

and in base you can:

    $:child_template

or:

    <title>$child_template.title</title>

It's actually quite flexible, as you can see.

-- 
Branko Vukelić

[email protected]
[email protected]

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group

-- 
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