Categories > TinyButStrong general >

Is there a nicer way to skip subtitles in groupings when subsequent fields are empty ?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: kle_py
Date: 2010-09-24
Time: 19:25

Is there a nicer way to skip subtitles in groupings when subsequent fields are empty ?

When i add a "register" in the array of the example tbs_us_examples_grouping.php like:
$result[4] = array('country'=>'United States', 'city'=>'Alabama', 'winner'=>Null, 'score'=>Null);
the result shows a subtitle: "Nom      Score".

I don't want this subtitle in case of missing info about name or score.
Currently i modified (line 45 of) the template to:
<tr>
  <td>&nbsp;</td>
  <td width="20" bgcolor="#FFF5D2">&#8226;</td>
  <td colspan="3" bgcolor="#FFF5D2"><u>[blk_res.city;block=tr+tr;headergrp=city]</u></td>
</tr>
<tr class="text-mini">
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td bgcolor="#F0F0F0">&nbsp;</td>
  <td bgcolor="#F0F0F0"><strong><em>[blk_res.winner;if [val]!='';then 'Nom';else '';magnet=tr]</em></strong></td>
  <td bgcolor="#F0F0F0"><strong><em>Score</em></strong></td>
</tr>

Is there a nicer way to do this ?
My current solution apparently works, however if You have a nicer trick i might use it for my solution..


Thanks,

Klemens
By: Skrol29
Date: 2010-09-24
Time: 22:24

Re: Is there a nicer way to skip subtitles in groupings when subsequent fields are empty ?

Hi Kel_Py,

Your way is good, but here is a one a little bit smarter:

<tr>
  <td>&nbsp;</td>
  <td width="20" bgcolor="#FFF5D2">&#8226;</td>
  <td colspan="3" bgcolor="#FFF5D2"><u>[blk_res.city;block=tr+tr;headergrp=city]</u></td>
</tr>
<tr class="text-mini">
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td bgcolor="#F0F0F0">&nbsp;</td>
  <td bgcolor="#F0F0F0"><strong><em>Name</em></strong>[blk_res.winner;magnet=tr;ope=minv]</td>
  <td bgcolor="#F0F0F0"><strong><em>Score</em></strong></td>
</tr>