[Zope] filtering Photo objects in Photofolder - View

Roel Van den Bergh roel@planetinterior.com
Thu, 5 Jun 2003 13:44:38 +0200


Hi all,

I'm using the Photo Folder product and it works fine.
Now I want to filter the objects in a Photofolder.

I've added a metatag to each photo object.

Filtering the thumbnail page isn't hard.
In the index_html (Sample Folder View) file I've altered the table:


<table width="100%" border="0" align="CENTER" cellspacing="0"
cellpadding="5">
  <dtml-in expr="_.range(_.math.ceil(_.len(objectIds(['Photo'])) / 5.0))">
  <dtml-let start="_['sequence-item'] * 5 + 1">
  <tr>
    <dtml-in expr="objectValues(['Photo'])" sort="id" size="5" orphan="0"
start="start">

<dtml-if expr="metatag == 'x'">
    <td align="CENTER" valign="center" width="20%"><a
href="&dtml.url-sequence-item;/view">
      <dtml-var expr="tag(display='thumbnail', border=0, cookie=0)">
      <br>
      <font size ="-1"><dtml-var name="title_or_id"></font>
      </a></td>
<dtml-elif expr="metatag == 'y'">
    <td align="CENTER" valign="center" width="20%"><a
href="&dtml.url-sequence-item;/view">
      <dtml-var expr="tag(display='thumbnail', border=0, cookie=0)">
      <br>
      <font size ="-1"><dtml-var name="title_or_id"></font>
      </a></td>
<dtml-else>
      </dtml-if>

    </dtml-in>
  </tr>
  </dtml-let>
  </dtml-in>
</table>

When someone clicks on a thumbnail the View page is loaded, the image is
displayed and at the bottom there is a navigation bar with 'PREV' < 'INDEX'
> 'NEXT'

Now here comes my problem: prevPhoto() and nextPhoto() are retrieved from a
python script and calculated from the image shown at that moment.
How can I resolve 'PREV' & 'NEXT' filtering with the metatag?
If I use if - elif -else - /if 'PREV' and/or 'NEXT' are not shown if they
have an invalid metatag.

Is there a solution to this?

TIA,Roel.