[Twisted-web] Re: Redering common patterns
Sridhar Ratna aka Srid
sridharinfinity at gmail.com
Sun Feb 13 07:15:51 MST 2005
> I have sequence of Posts to render. The Post object has an involved
> xml-template as show below
[snip ... code]
>
>
> Now, I need to re-use this Post pattern (below 'A Post comment) in
> multiple places. If you place them in a seperate file, it would be
> imposibble to use them in this example (sequence renderer).
>
> Do you think of any solution?
I just looked at Fragments (rend.Fragment). The problem with fragment
is Post data comes from outside the fragment (outer tag's 'data'
attribute). How is it possible to send the data to fragment
Please note that this DOES NOT work
<n:invisible n:data="recentPosts" n:render="sequence">
<n:invisible n:render="content">
<n:slot name="content" />
</n:invisible>
</n:invisible>
actually 'content' has the patterns for the 'recentPosts' sequence,
but nevow throws exception
"The pattern named 'item' wasn't found in the template."
--
Sridhar Ratna - http://srid.bsdnerds.org
More information about the Twisted-web
mailing list