The content template will be passed as an argument into the base
template so at the top of the base template file use:

$def with (content)

where you want to insert the content into the template use:

$:content

so your template should look something like:

$def with (content)

<head>
<title>TITLE</title>
</head>

<body>
$:content
</body>


On May 23, 5:05 am, Bruce <[EMAIL PROTECTED]> wrote:
> I'm new to web.py and trying to borrow from this recent example ..
>
> On May 8, 4:11 pm, Eric Talevich <[EMAIL PROTECTED]> wrote:
>
> > Not sure about Mako, but the built-in templating engine lets you pipe
> > the output of one template rendering into another rendering call. Such
> > as (for v0.23):
> >   some_calculation = 46 + 2
> >   print render.base("RedBaron's Homepage",
> >           render.layout(
> >                   render.sidebar1(some_calculation),
> >                   render.article("Why Python Rules", article_text)))
>
> > This pipes the sidebar1.html and article.html templates into
> > layout.html, which goes into base.html, and sends the resulting string
> > to the browser. (In web.py version 0.3 replace the print statement
> > with return.) ...
>
> ... but the inner template (I have just 'base' and 'content') isn't
> rendering. Is there something I need to do in the base template to
> render that content?
>
> Bruce
--~--~---------~--~----~------------~-------~--~----~
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