Templates webpy模板多重继承,可能吗?

Templates webpy模板多重继承,可能吗?,templates,inheritance,web.py,Templates,Inheritance,Web.py,我想将索引页分成几个独立的.html小部分,如: up_bar.html: 家 菜单: down_bar.html: 等等。 现在,要构建一个新页面,是否可以使用defaultwebpytemplator将这些片段嵌入到其他页面中 也许是那样的?: 在admin.html中: $def带有(一些参数): 管理面板 $include('side_bar.html') 。。。身体材料… $include('down_bar.html')在这里找到了答案:http://groups.google

我想将索引页分成几个独立的.html小部分,如:

up_bar.html:

家
菜单:

down_bar.html:

等等。

现在,要构建一个新页面,是否可以使用defaultwebpytemplator将这些片段嵌入到其他页面中

也许是那样的?:
在admin.html中:
$def带有(一些参数):

管理面板

$include('side_bar.html')

。。。身体材料…


$include('down_bar.html')
在这里找到了答案:
http://groups.google.com/group/webpy/msg/ea6da02dfb9eedc4?dmode=source

一些解释会很好。

在这里找到了答案:
http://groups.google.com/group/webpy/msg/ea6da02dfb9eedc4?dmode=source

一些解释会很好。

这里可以找到模板继承的基本但很好的介绍:

这里可以找到模板继承的基本但很好的介绍:

我对我的代码做了这些

def GET(self,*args):
    param= {'name':'jackie'}
    view = web.template.frender("views/someview.html")
    content = view(**param)
    layout = web.template.frender("views/index.html")
    return layout(content=content)
现在您只需在
index.html

中插入
$:content
,我这样做是为了我的代码

def GET(self,*args):
    param= {'name':'jackie'}
    view = web.template.frender("views/someview.html")
    content = view(**param)
    layout = web.template.frender("views/index.html")
    return layout(content=content)
现在您只需在
index.html