[Zope-dev] Tag DTML

Aitor Grajal Crespo Aitor.Grajal@inetsysonline.com
Thu, 02 Nov 2000 21:12:30 +0100


Yeahhh, thanks.

But , one more step.....:-) ....can i do it in the init method ???
The init method no have the md parameter. no???


>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
>>  
>> /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>> 
>>


/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
Aitor Grajal Crespo
Director General
e-mail: Aitor.Grajal@inetsysonline.com

INETSYS, S.L.
ETSI Informática
Ctra. Colmenar, km. 15,500
28049 MADRID
SPAIN
Tfno : (34) 91 348 22 66 - Fax : (34) 91 348 22 66
http://www.inetsysonline.com
 
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/