Hi all, I have a question about The dtml-if. I would like to call an image depending on the url I am at. Lets say Somsone searches for an article on school I have the folowing URL: http://codenamefuture.hurrah.com/nieuws/zoek?SearchableText=&Subject%3Atoken s=school If I wnated to write a dtml-method telling it should load the school image in stead of the standard image how would I call that image? Hope someone can help me on this. James
<dtml-if "'zoek' == _.string.split(URL1,'/')[-1]"> <dtml-var special_image_to_this_folder_gif> <dtml-else> <dtml-var usual_image_gif> </dtm-if> ----- Original Message ----- From: "James van der Veen" <james@codenamefuture.nl> To: <Zope@zope.org> Sent: Tuesday, June 12, 2001 1:57 PM Subject: [Zope] dtml-if question
Hi all,
I have a question about The dtml-if.
I would like to call an image depending on the url I am at.
Lets say Somsone searches for an article on school I have the folowing URL:
http://codenamefuture.hurrah.com/nieuws/zoek?SearchableText=&Subject%3Atoken
s=school
If I wnated to write a dtml-method telling it should load the school image in stead of the standard image how would I call that image?
Hope someone can help me on this.
James
_______________________________________________ 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 )
Well, from what I can think a good method is to have the images in the names of the variable passed into the tokens querystring. Thus: <dtml-if "_.has_key('tokens')"> <dtml-let getimage='_.getitem('tokens')"> <dtml-var getimage> </dtml-let> </dtml-if> Or something along the lines of that. So as long as you have all of the images present for the variable that is passed in the querystring, you'll get the image that is correct for it. Hope that helps, Paz -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of James van der Veen Sent: 12 June 2001 13:57 To: 'Zope@zope.org' Subject: [Zope] dtml-if question Hi all, I have a question about The dtml-if. I would like to call an image depending on the url I am at. Lets say Somsone searches for an article on school I have the folowing URL: http://codenamefuture.hurrah.com/nieuws/zoek?SearchableText=&Subject%3Atoken s=school If I wnated to write a dtml-method telling it should load the school image in stead of the standard image how would I call that image? Hope someone can help me on this. James _______________________________________________ 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 )
participants (3)
-
James van der Veen -
Paul Zwarts -
Peter Bengtsson