[Zope] Wrapping pre-existing content
Phil Harris
phil.harris@zope.co.uk
Thu, 8 Mar 2001 10:52:18 -0000
All,
I'm looking for ideas, so don't be afraid to shout any comments out.
I have a hierarchy of 'documents', lots of them circa. 300 and the number
will continue to grow (dramatically).
These 'documents' could be of any type, XML/HTML/Images etc.
What I want to do is to have some way of wrapping these documents to include
a header and footer, but I want to do this at render time not before.
I've got a naive Python Script (restricted) that looks like this:
#===================
import string
a=context.restrictedTraverse(string.join(traverse_subpath,'/'),0)
if a.meta_type == 'Folder':
a=a.default_html
h=context.aspire_html_header_orig(None,context)
f=context.aspire_html_footer_orig(None,context)
c=a(None,context)
return h+c+f
#===================
However this has problems when rendering the header and footer (h & f), it's
somehow losing the namespace and things such as PARENTS are no longer
available.
Any ideas?
tia
Phil
phil.harris@zweb.co.uk