[Zope] String to object ID

Goodrichs nbd95@macconnect.com
Sat, 4 Dec 1999 20:13:03 -0500


>One way might be to forego the use of the dtml-var tag to display the
>image and just do:
>
><dtml-with "_.namespace(imagename='images.hd' + section)">
>   <IMG SRC="<dtml-var imagename>">
></dtml-with>
>
>
>Chris McDonough     mailto:chrism@digicool.com
>Digital Creations   http://www.digicool.com

That won't work because it only returns the string we created,
'images.hd.mysection' which is not a path.

We are trying to create a method where we can dynamicly display an image
based on the folder the page exists in. The images are named according to
their location within the website;

hd = top level
section = sublevel

ideally;
top level
  images
  mysection
     would have an image of 'hdmysection'
  yoursection
     would have an image of 'hdyoursection'

I want a tag I can put in any page and display the correct image without
having to create a new unique property in all 2000 pages/ 200 folders.

<dtml-var myimage>

I can create to string that matches the id of the image
'images.hdmysection' but i cannot get Zope to go and fetch that object.

Did I explain that properly?

DAve.