You can do something like this: The following REQUEST.set's are only necessary to have some placeholder variables, you'd probably get the values from somewhere else, maybe a property on a folder, or a form value, or a SQL field, whatever. <dtml-call expr="REQUEST.set('v1', 'Members')"> # equivalent to Python's "v1 = 'Members'" <dtml-call expr="REQUEST.set('v2', 'ZQR')"> # equivalent to Python's "v2 = 'ZQR'" <A HREF="http://www.zope.org/<dtml-var v1>/<dtml-var v2>"> to make it look a little nicer, you can also use DTML "entity syntax": <A HREF="http://www.zope.org/&dtml-v1;/&dtml-v2;"> You could even do something like this: <dtml-call expr="REQUEST.set('myURL', 'http://www.zope.org/%s/%s' % (v1, v2))"> <dtml-var myURL> Jatwood@bwanazulia.com wrote:
Here is the question (after a few too many hours of messing with this)
I am trying to figure out the best way to populate links with variables. In raw python I would just declare the links like
link = "<a href="http://www.somewhere.com/cgi/%(v1)s/somthingelse/%(v2)s "
and populate the link with tuples when I was going to use it.
link % variable
For the life of me I can't figure out how to do this in Zope. Any help would be great.
I am sure this is easy but I am at a complete loss.
Thanks, JMA
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Chris McDonough Digital Creations, Inc. Zope - http://www.zope.org