I think a couple of possible solutions might help:

>>> render = web.template.render('templates/pages/', base='col1')
>>> output = render.__getattr__(name)()

>>> base = web.template.frender('templates/base.html')
>>> template = web.template.frender('templates/{0}.html'.format(name))
>>> output = base(template())

To reiterate the expected usage:

>>> render = web.template.render('templates/pages/', base='col1')
>>> output = render.page()

where page is the *name* of the html file. [1] [2]

[1] http://webpy.org/docs/0.3/templetor
[2] http://webpy.org/cookbook/layout_template

On Fri, Sep 11, 2009 at 7:46 AM, Angelo Gladding <[email protected]>wrote:

> It sounds like you want to use render instead of frender. To clarify:
>
> frender does not accept a base template. It is a single file wrapper for
> Template.
>
> *Template(text, filename='<template>', filter=None, globals=None,
> builtins=None)*
>
> render, on the other hand, accepts a directory loc as well as a basetemplate.
>
> *render(loc='templates', cache=None, base=None, **keywords)*
>
>
> On Fri, Sep 11, 2009 at 1:29 AM, Piyawan T. <[email protected]>wrote:
>
>>
>> have you ever used frender() mix with layout ? I tried already but not
>> work:
>>
>> web.template.frender('templates/pages/' + name + '.html',
>> base='col1.html')
>>
>> how to make this work ?
>> Please help me~~ Thank you very much.
>>
>> >>
>>
>
>
> --
> Angelo Gladding
> [email protected]
> http://angelo.gladding.name/
> E69E 47E8 5C3A 96E5 C70F
> D931 F35C ACBA 6F39 9611
>



-- 
Angelo Gladding
[email protected]
http://angelo.gladding.name/
E69E 47E8 5C3A 96E5 C70F
D931 F35C ACBA 6F39 9611

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