Categories > TinyButStrong general >

Missing blocks, I cannot see why if/else would result in neither

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: RwD
Date: 2004-02-21
Time: 14:32

Missing blocks, I cannot see why if/else would result in neither

consider the previously posted code by me:

<td width="100" valign="top" nowrap class="wsback1">
   {tbs_check.1;if '{lst.image_thumb}' != '';block=td}
   <a href="/data/article/images/{lst.image;htmlconv=no;friendb=a}" target="_blank">
      <img src="/data/article/images/thumbnails/{lst.image_thumb;htmlconv=no;friendb=img}" border="0">
   </a>
</td>
<td width="100" valign="top" nowrap class="wsback1">
   {tbs_check.1;else;block=td}
   <a href="/data/article/images/{lst.image;htmlconv=no;friend2=a}" target="_blank" class="fade art_links">
   Click here for a larger image
   </a>
</td>

Now, I would say this displays either one or the other block....

but it is part of a larger block, and when previous images did have a thumbnail, and the current one does not, then it has neither of the two td cells :(

below is the entire piece (I replaced the { to [ for you)
<table width="100%" border="0" cellpadding="0" cellspacing="3">
<tr>
   <td>
      <table width="100%" border="0" cellpadding="1" cellspacing="3">
      <tr>
         <td valign="top" colspan="2" class="wsheader">
            [lst.title_id;block=row;htmlconv=no;encaps=2]
         </td>
      </tr>
      <tr>
         <td width="100" valign="top" nowrap class="wsback1">
            [tbs_check.1;if '[lst.image_thumb]' != '';block=td]
            <a href="/data/article/images/[lst.image;htmlconv=no;friendb=a]" target="_blank">
            <img src="/data/article/images/thumbnails/[lst.image_thumb;htmlconv=no;friendb=img]" border="0">
            </a>
         </td>
         <td width="100" valign="top" nowrap class="wsback1">
            [tbs_check.1;else;block=td]
            <a href="/data/article/images/[lst.image;htmlconv=no;friend2=a]" target="_blank" class="fade art_links">
            Click here for a larger image
            </a>
         </td>
         <td width="90%" height="50" valign="top" class="wsback2">

            Description<br/>
            [lst.descr_id;htmlconv=wsp;.]
         </td>
      </tr>
      </table>
   </td>
</tr>
<tr class="wsback1">
   <td>No article was found for the current category.[lst;block=row;nodata]</td>
</tr>
</table>
By: RwD
Date: 2004-02-21
Time: 14:44

I am master a solving my own problems 5 minutes after posting

Sorry for this post, I answered my own question 5 minutes after posting:

the tbscheck field and its little else friend need to have the same UNIQUE id, and that wasn't the case... by adding a unique field (article_id) into the equation I solved the puzzle:

<td width="100" valign="top" nowrap class="wsback1">
   {tbs_check.a{lst.article_id};if '{lst.image_thumb}' != '';block=td}
   <a href="/data/article/images/{lst.image;htmlconv=no;friendb=a}" target="_blank">
   <img src="/data/article/images/thumbnails/{lst.image_thumb;htmlconv=no;friendb=img}" border="0">
   </a>
</td>
<td width="100" valign="top" nowrap class="wsback1">
   {tbs_check.a{lst.article_id};else;block=td}
   <a href="/data/article/images/{lst.image;htmlconv=no;friend2=a}" target="_blank" class="fade art_links">
   Klik hier voor een afbeelding
   </a>
</td>