[Zope] Re: Photo Update

Andrew Lahser andrew@apl-software.com
11 Jan 2000 18:16:58 -0000


> Sounds interesting! I hope it will work seamlessly with my other 
> things stored in ZCatalogs...
ZPhotoAlbum will be its own ZCatalog. If you want to search it by 
itself you can, or you can select multiple ZCatalogs to search.
This should be what you want, let me know otherwise.

> 
> The new format of referencing photos in dtml gives me headaches...
> 
> If I try to step through an unknown number of photos in a folder, I would do:
> 
>   <dtml-in "objectIds('Photo')">
>     <dtml-var "_['sequence-item'](REQUEST, pdcookie='true', border=0)">
>   </dtml-in>
> 
Sure. I can see that. Try this.
<dtml-in "objectValues('Photo')">
  <dtml-var "tag(REQUEST, pdcookie='1', border=0)">
</dtml-in>

> But this does not work. I tried several versions of this - nothing. 
> How would you do this???

Let me know right away if this does not work.

> 
> Next, I have Articles that store the name of a top-image in a 
> property called topimage. How can I reference the original photo 
> object? The old way was :
> 
>     <img src="/<dtml-var "getpath(data_record_id_)">/<dtml-var 
> topimg>/thumbnail" border="0" alt="<dtml-var title>" align=right>
> 
> How can I transform this to the new way???
> 
This came up on the list last night. Try this.

<dtml-with "_.getitem(topimage,0)">
  # Return a reference to the Photo object that is named in topimage
  # Place the Photo on top of the namespace stack
  <dtml-var "tag(display='thumbnail', border=0)"> 
  # Call the tag method of the current object with parameters.
  # The REQUEST variable isn't necessary because we only want thumbnails.
  # Note that the alt tag defaults to the title
  # Further note that the /thumbnail method-interface is deprecated, all
  # displays are set through the display parameter.
</dtml-with>

I am open to suggestions on making this dtml-interface better, but
I found this to be the most flexible so far. It also reads more like
Zope code, but it takes a little getting used to. I may still have
much to learn here.

Drew