RE: [Zope] - Problem evaluating <!--#var URL0--> in DTML
I can't seem to access <!--#var URL0--> directly in my DTML file though <!--#var "REQUEST['URL0']"--> works just fine. I'm using the DocumentTemplate that came with Zope 1.9.0. I'm calling the document template instance with REQUEST as one of the parameters.
Any suggestions?
Thanks,
Skip Montanaro
Skip, Are you calling the template with REQUEST as the default mapping parameter, or as another keyword param? This is the only thing I can see that might be causing this (in Zope, the REQUEST is passed as the mapping param, and <!--#var URL0--> works). Given a template's constructor: def __init__(self, source_string='', mapping=None, __name__='<string>', **vars): ...if you instantiated it using: my_doc=TemplateClass(src, REQUEST, var1='', var2='') then <!--#var URL0--> _should_ work. If, however, you were to use: my_doc=TemplateClass(src, some_other_mapping, REQUEST=REQUEST, ...) or even: my_doc=TemplateClass(src, REQUEST=REQUEST, ...) then <!--#var URL0--> wouldn't work, because REQUEST isn't being used as the default mapping for name lookup (though <!--#var "REQUEST['URL0']"--> would work as expected). Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
Brian> Are you calling the template with REQUEST as the default mapping Brian> parameter, or as another keyword param? That must be it. I'm passing the REQUEST in as a keyword parameter when calling the template. Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/ skip@mojam.com | Musi-Cal: http://www.musi-cal.com/ 518-372-5583
participants (2)
-
Brian Lloyd -
skip@calendar.com