Cheetah base templates
You can define a base class:
class base:
def __init__(self):
web._compiletemplate('default.html', base='base')
Use it:
class page1(base):
def GET(self):
web.render('page1.html')
Your templates:
#DEFAULT.HTML
< html >
< body >
#block content
CONTENT
#end block
< / body >
< / html >
#PAGE1.HTML
#extends base
#def contentPAGE 1
You're on the 1st page.
#end def
#PAGE2.HTML
#extends base
#def contentPAGE 2
You're on the 2nd page.
#end def
No comments:
Post a Comment