WODA: FAQs

 Formatting Data

How can I hide a field in the Search results if the field is empty?

I don't think you should use $WBB{'format;DEFAULT'}.
Better use

$WBB{'formatNameDEFAULT'} = 'Short display';
$WBB{'formatHeadDEFAULT'} = "<CENTER><TABLE>
  <TR>
  <TD>Country</TD>
  <TD>&nbsp</TD>
  <TD>Vintage</TD>
  <TD>Wine</TD>
</TR>';
";
$WBB{'formatRowDEFAULT'} = '
$cc = ($rec{Country} ne "" ? $rec{Country} : " ");
$vv = ($rec{Vintage} ne "" ? $rec{Vintage} : " ");
" <TR>
  <TD NOWRAP BGCOLOR=$rec{Color}>$cc</TD>
  <TD NOWRAP>$ThisRecordIcons $ThisRecordBasket</TD>
  <TD>$vv</TD>
  <TD>$rec{Wine}</TD>
  </TR>"';
$WBB{'formatFootDEFAULT'} = '</TABLE></CENTER>';


This is an extract of something I used for a friend who has a store selling
wine.
I show only four fields in the default format.


Good luck,
Jean-Paul

modify the informationdelete entire recordexplain the meaning of the fieldsbrowse recordsAdd a new questionHome page of this databaselogin Valid HTML 4.01 Transitional Valid CSS! Powered by WODA 4.6x trunk