<html>
<head>
<title>Patterns</title>
</head>
<body>
<p>
<span nevow:render="message">
<span nevow:pattern="greeting">Welcome to </span>
<span nevow:pattern="staying">I hope you are still enjoying </span>
</span>
the wonderful world of Nevow,
<span nevow:data="group_name" nevow:render="string" />!</p>
</body>
</html>
class Page(rend.Page):
docFactory = loaders.htmlfile('hellohtml.html')
ctr = 0
def data_group_name (self, context, data):
return "Chipy"
def render_message(self, context, data):
if self.ctr == 0: msg = "greeting"
else: msg = "staying"
self.ctr += 1
return context.onePattern(msg)