[Zope-dev] Tag DTML
Paul Erickson
erickson@kaivo.com
Thu, 2 Nov 2000 12:30:19 -0700 (MST)
I think that all you have to do is get your property out of md.
ie:
some_prop=md['some_prop']
>
> Hello, I have coded my own DTML tag and i want to catch a property of the=
> folder where the DTML-Coded is.
>
> How can i do this???
>
>
> from DocumentTemplate.DT_Util import * # useful parsing methods you'll need=
>
> from DocumentTemplate.DT_String import String # explained later
>
> class FuenteTag:
>
> name =3D 'fuente' blockContinuations=3D()
> expand=3DNone
>
> def __init__(self, blocks):
> tname, args, section =3D blocks[0]
> self.tname=3Dtname
> self.section=3Dsection
> args=3Dparse_params(args, font=3D'Verdana', size=3D'2')
> self.args=3Dargs
> self.font =3D args.get('font','Verdana')
> self.size =3D args.get('size','2')
>
> def render(self, md):
> cadena =3D '<FONT FACE=3D"'+self.font+'" SIZE=3D"' + self.size +=
> '">' +self.section(md)+'</FONT>'
>
> return cadena
>
>
> __call__ =3D render
>
> String.commands['fuente'] =3D FuenteTag
> /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>
> Aitor Grajal Crespo
> Director General
> e-mail: Aitor.Grajal@inetsysonline.com
>
> INETSYS, S.L.
> ETSI Inform=E1tica
> Ctra. Colmenar, km. 15,500
> 28049 MADRID
> SPAIN
> Tfno : (34) 91 348 22 66 - Fax : (34) 91 348 22 66
> http://www.inetsysonline.com
>
> /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>
>