[ZPT] Lots of HTML in a frame - ZPT or Python script?

David Mitchell djmitchell@optushome.com.au
Thu, 13 Mar 2003 00:16:12 +1100


On Thursday 13 March 2003 12:23 am, Geir B=E6kholt wrote:
> David Mitchell wrote
>
> DM> I'm at a point in my project where I have to code up the following,
> which will DM> be presented as a single frame of a page:
>
> DM> if variable =3D=3D 'A':
> DM>     render about 500 bytes of HTML
> DM> elsif variable =3D=3D 'B':
> DM>     render a different 500 bytes of HTML
> DM> elsif variable =3D=3D 'C':
> DM>     ...

...snip...

> or even cleaner:
> have a folder "monkeyChunks" with all the templates (named A,B,C
> etc..same as the values for 'variable' ) :
> then do :
>
> return getattr(context.monkeyChunks, variable)()
>
> :)

I like that - simple and elegant.  I'm still trying to get my head around=
 the=20
finer points of Zope design, and it's solutions like this that invoke a=20
sudden flash of further enlightenment!

Thanks Geir

Dave M.