Re: Modifizieren eines ATDocuments vor dem Rendern

Robert Barsch <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

args - nochmal aber diesmal in Deutsch ;)

hmm ATDocument.CookedBody ist in Plone 3 wohl nicht mehr dafür
nutzbar - welche Methode kann ich den dann dafür "gefahrlos" patchen?

Danke,
Robert

>> ich möchte gerne in Plone 3 vor dem Rendern einer Page (ATDocument) den
>> von Plone generierten HTML Output des Body Textes modifizieren können.
>>
>> In Plone 2.1 geht sowas via Monkey Patch:
>>
>>> from Products.ATContentTypes.types.ATDocument import ATDocument
>>>
>>> def CookedBody(self, stx_level=None, setlevel=0):
>>>     text = self.getText()
>>>     # do someting with the text
>>>     text = text.upper()
>>>     return text
>>>
>>> ATDocument.CookedBody = CookedBody
>>>     
>> Wie würde ich sowas machen ohne Einführung eines neuen ContentTypes und
>> auf möglichst eleganter Art & Weise mit Zope 3 Techniken?

> Monkeypatching ist "good enough". Zope 3 Techniken helfen Dir hier auch
> nicht viel weiter.
> 
> Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKGTJ5IVowwEY4LjQRAo/DAJ0e9mMd22+WmD4S2SbcUypFJUnleACg05wa
vgve9Q5SxZuJRT3qSi5MBmY=
=FZSw
-----END PGP SIGNATURE-----


_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.