[Zope-dev] Custom dtml tag ... parameters not evaluated

Romain Slootmaekers romain@zzict.com
Thu, 12 Apr 2001 11:33:53 +0200 (CEST)


Yo,
I'm trying to create a custom dtml tag, and after the How-to on this
(http://www.zope.org/Members/z113/1) that in itself posed no problem: easy
as pie. The problem I'm having with the tag is that parameters are not
evaluated. for instance (my tag's name is 'aa')

<dtml-let y="someValue">
<dmlt-aa role="y" ...> ....</dtml-aa> 
</dtml-let>


gives me in the code:  role=="y" 
while I want it to be "someValue", playing with the quotes
doesn't help either. I think that, in the python code I need to do some
extra call to some routine that do the evaluation/substitution... but I
don't know which.

Anyway, I uncluded a code thingy below, (basically the code  from
the How-to)

Can anyone help me on this ?

TIA,

Sloot.

---------------------------- code thingy < 20 lines -----------------------
from DocumentTemplate.DT_Util import *
from DocumentTemplate.DT_String import String

TAGNAME = 'aa'

class AATag:
        name = TAGNAME
        blockContinuations = ()
        def __init__(self, blocks):
                tagname, args, section = blocks[0]
                args = parse_params(args,
                                    role="dont-know",
                                    property=None,
                                    id="no-id-given")
                self.args, self.section = args, section

        def render(self, md):
		# some code here...


        __call__ = render

String.commands[TAGNAME] = AATag