So, in base.html, if i had: $def with (var1, var2, render.xyz()) it will globally render against any template that is evaluated in the base.html (called from the render in code)? If so, it would be curious to know if variables for pagination, current link, other base-type functions could be passed in. i'll play with the first part first :)
On Wed, Sep 29, 2010 at 5:20 AM, Branko Vukelic <[email protected]> wrote: > 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] <webpy%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/webpy?hl=en. > > -- 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.
