[Zope-dev] Tag DTML
Aitor Grajal Crespo
Aitor.Grajal@inetsysonline.com
Thu, 02 Nov 2000 18:17:52 +0100
--=====_97318547241=_
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
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
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
--=====_97318547241=_
Content-Type: text/html; charset="us-ascii"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff style="FONT-FAMILY: Arial" text=#000000>
<DIV><FONT size=2>Hello, I have coded my own DTML tag and i want to catch a
property of the folder where the DTML-Coded is. </FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>How can i do this??? </FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT size=2>from DocumentTemplate.DT_Util import * # useful
parsing methods you'll need <BR>from DocumentTemplate.DT_String import
String # explained later </FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>class FuenteTag:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> name = 'fuente'
blockContinuations=()<BR> expand=None</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> def __init__(self,
blocks):<BR> tname, args, section =
blocks[0]<BR>
self.tname=tname<BR>
self.section=section<BR>
args=parse_params(args, font='Verdana',
size='2')<BR>
self.args=args<BR> self.font =
args.get('font','Verdana')<BR>
self.size = args.get('size','2')<BR></FONT></DIV>
<DIV><FONT size=2> def render(self,
md):<BR> cadena = '<FONT
FACE="'+self.font+'" SIZE="' + self.size + '">'
+self.section(md)+'</FONT>'<BR>
<BR> return cadena</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><BR> __call__ = render</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>String.commands['fuente'] = FuenteTag
<BR></FONT></DIV></BODY></HTML>
<BR>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff style="FONT-FAMILY: Arial" text=#000000><FONT size=2>
<DIV><FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/_<FONT
size=2>/_/</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Aitor Grajal Crespo</DIV>
<DIV><FONT size=2>Director General</FONT></DIV>
<DIV><FONT size=2>e-mail: <A
href="mailto:Aitor.Grajal@inetsysonline.com">Aitor.Grajal@inetsysonline.com</A></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>INETSYS, S.L.</FONT></DIV>
<DIV><FONT size=2>ETSI Informática</FONT></DIV>
<DIV><FONT size=2>Ctra. Colmenar, km. 15,500</FONT></DIV>
<DIV><FONT size=2>28049 MADRID</FONT></DIV>
<DIV><FONT size=2>SPAIN</FONT></DIV>
<DIV><FONT size=2>Tfno : (34) 91 348 22 66 - Fax : (34) 91 348 22
66</FONT></DIV>
<DIV><FONT size=2><A
href="http://www.inetsysonline.com/">http://www.inetsysonline.com</A></FONT></DIV>
<DIV><FONT size=2><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/_<FONT size=2>/_/_<FONT
size=2>/_/</FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV></FONT></BODY></HTML>
--=====_97318547241=_--