User Tools

Site Tools


thumb_html

thumb.html

   <table>
    <tr height="100px">
      <td colspan="2" valign="top" style="padding-right:10px">
         <a target="_blank" tal:attributes="href python:'./'+here.filename+'/zogilib_zsql?fn='+here.ImageViewerPath+'/'+here.filename">	
            <span tal:replace="structure here/REQUEST/SESSION/string"/>
         </a>
      </td>
      
      <!-- see note 1 -->
      <tal:block tal:repeat="foundMD python:here.ZSQLInlineSearch(_table='tablename',idfield=here.filename,_op_idfield='eq')">
      <span tal:condition="not:python:here.ZSQLisEmpty(foundMD.text)">
         <td valign="top" tal:content="python:here.decode(foundMD.text)"/>
      </span>
      <!-- /note 1 -->
      
      <!-- see note 2 
      <tr tal:condition="not:python:here.ZSQLisEmpty(foundMD.object_title)">
         <td class="fieldname">Title: </td>
         <td tal:content="python:here.decode(foundMD.object_title)"/>
      </tr>
      <tr tal:condition="not:python:here.ZSQLisEmpty(foundMD.inscription)">
         <td  class="fieldname">Description: </td>
         <td tal:content="python:here.decode(foundMD.inscription)"/>
      </tr>
      <tr tal:condition="not:python:here.ZSQLisEmpty(foundMD.property)">
         <td class="fieldname">Copyright: </td>
         <td tal:content="python:here.decode(foundMD.property)"/>
      </tr>
      -->
      <!-- this is a second database query, use this section if you want a secondary search in another database
      <tr tal:repeat="foundBooks python:here.ZSQLInlineSearch(_table='vision_lit',id=foundMD.id_book,_op_id='eq')" >
         <td>
            <a tal:condition="python:here.checkResource(foundBooks.ordnername)" tal:attributes="href python:here.checkResource(foundBooks.ordnername)[0][1].absolute_url()" target="_blank">show source</a>
         </td>
      </tr>
      -->
      </tal:block>
    </tr>
   </table>

Note 1

The function ZSQLInlineSearch searches in the table given (here tablename) in the field given (here idfield) for the specified expression (here here.filename). If you don't change the specified expression, the given field is searched for the name of the image.

Replace tablename with the name of your table.
Replace idfield with the name of the field that holdes the image names/ image ids.
_op_idfield specifies the type of comparison (e.g. equals (eq), contains (ct), …)
In foundMD.text replace text with the name of the field you want to be displayed.

Note 2

If you want more than one field to be displayed, comment in this section and replace foundMD.whatever with the appropriate fieldnames of the fields.

thumb_html.txt · Last modified: 2020/10/10 14:13 by 127.0.0.1