I use this snippet in my base template. I think I picked it up from an
old post in this group:
<head>
...
$if hasattr(content, 'stylesheets'):
$for f in content.stylesheets.split():
<link rel="stylesheet" href="$f" type="text/css"/>
...
</head>
And then in a contained template:
$var stylesheets: /static/css/custom.css /static/css/print.css
On Jan 13, 3:14 am, andrei <[email protected]> wrote:
> You can define vars in inner template, and get their values in base, like
> this:
>
> page.html:
>
> $def with(title)
> $var title: $title
>
> base.html:
>
> $def with(page)
> <title>$page.get("title","Default title")</title>
> $:page
--
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.