[Zope] Copying a dtml method when creating a ZClass instance
kamon ayeva
kayeva@hotmail.com
Fri, 01 Sep 2000 17:45:21 GMT
Thanks Tino and Chris for your feedback.
>From: Tino Wildenhain <tino@wildenhain.de>
>To: kamon ayeva <kayeva@hotmail.com>
>CC: zope@zope.org
>Subject: Re: [Zope] Copying a dtml method when creating a ZClass instance
>Date: Fri, 01 Sep 2000 14:18:25 +0200
>
>Hi Kamon,
>
>kamon ayeva wrote:
> >
> > Hi,
> >
> > I need some help.
> > I have a DTML method at the root of Zope called 'Template'.
> > How can I make the constructor of a ZClass (folderish) to copy this
>method
> > to each of its instances ? Can someone provide me with a complete
>snippet to
> > add in the ZClass constructor ?
>
>Copy? Why?
>aquisition should make it 'visible' in every subfolder automatically.
>
>Regards
>Tino
I have several reasons whay I need to attach a template to each ZClass.
Among them are:
1/ cases like high level folders where I might want to customize the page's
rendering and/or skin,
2/ cases like contained objects which uses a generic skin (but you can still
customize the skin of one among them, if you want)
3/ my site needs to be easily designed / modified by Web Designers that do
not understand Acquisition.
Thanks for the tip Chris, I was able to do it by adding my
ZClass-specific-template in the Zope Product folder and adding a call to
manage_clone(ZClass-specific-template, 'standard_template', [REQUEST]) in
the ZClass constructor method. I use the same id 'standard_template' to
exploit acquisition globally on the site (the Web designer would not have to
care about that).
Next thing is generalising this method to also allow multiple templates
available for each object i.e. the Content Manager can choose a prefered
skin when instanciating an object.
Best Regards,
Kamon
Ecubateur
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.