Another way is to define render function in the template globals, like
this:
template_globals = {}
render_partial = web.template.render(rootdir+'/templates/',
globals=template_globals)
render = web.template.render(rootdir+'/templates/',
globals=template_globals, base='layout')
template_globals.update(render=render_partial)
Then you will be able to call $:render.any_template() in templates.
On Sep 29, 2:30 pm, Ranganath s <[email protected]> wrote:
> Thanks a lot guys, i really appreciate your time in explaining the concept.
>
> Thank you
> Ranganath.S
>
> On Wed, Sep 29, 2010 at 3:58 PM, Anand Chitipothu <[email protected]>wrote:
>
>
>
>
>
> > 2010/9/29 Ranganath s <[email protected]>:
> > > 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
> > > throw light on this.
>
> > Templates really like python functions.
>
> > If you want to support something like layout template, then you need
> > to do like this:
>
> > render.layout(render.page(page))
>
> > Anand
>
> --
> I blog athttp://ranganaths.wordpress.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.