[Zope] Decorator pattern

Tom Jenkins tjenkins@devis.com
Wed, 17 Jan 2001 16:43:03 EST


Hello folks,
I have a situation where as I go down my hierarchy I need to modify the
<BODY> tag.

Assume this structure:
/
/level1
/level1/level2
/level1/level2/level3

  At level 1 the <BODY> tag would be like:
<BODY  BGCOLOR="#00FFFF">
and at level 2 the <BODY> tag would have the color setting at level1
plus additional information:
<BODY BGCOLOR="#ooFFFF"  LINK="#FF0000">
and at level 3 the <BODY> tag would be enhanced further:
<BODY BGCOLOR="#ooFFFF" LINK="#FF0000" onLoad=myLoadFunction()>

I was thinking that I could change <standard_html_header> to something
like:
<HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY <dtml-var body_tag_guts>  

Then each level would define body_tag_guts as a call to its parent's
body_tag_guts and tack on its stuff... but I don't know how to do that
<grin>

Am I going down the right path here or is there a better way?

Tom Jenkins
devIS - Development InfoStructure
http://www.devis.com