The WorksForWeb Community Forums
Welcome to the WorksForWeb community forums. Here you can discuss WorksForWeb products with others and contribute to the rapidly growing WorksForWeb community. Please note that while WorksForWeb staff try to maintain presence on the forums, this is not the most reliable way to contact WorksForWeb staff. In case you require a timely response from WorksForWeb on an issue, please open a support ticket here. For pre-sales questions, please open a sales ticket here.

Welcome, Guest. Please login or register.
February 09, 2012, 12:19:56 AM

Login with username, password and session length
Search:     Advanced search
Added the iLister-related Boards

Rate My Site Boards Added

Merged iAuto and iRealty Support Forums together

Several new tips in the Tips and Tricks section
1,602 Posts in 623 Topics by 1,179 Members
Latest Member: bobsteam
* Home Help Search Login Register
+  The iAuto/iRealty/iLister Support Forum
|-+  iAuto and iRealty v.2.x - 3.x
| |-+  General iRealty Discussions
| | |-+  Hide Fields if Blank
« previous next »
Pages: [1] Print
Author Topic: Hide Fields if Blank  (Read 945 times)
BrandFly
Newbie
*

Karma: 0
Posts: 16


View Profile
« on: July 25, 2007, 05:31:05 AM »

When you create a listing if you leave a field blank, the field name shows up in the listing even with no entry. I would like it so that if I leave a field blank, the field name doesn't appear in the listing or search results. For example: Let's say I have a listing with no garages, if I leave it blank when editing the listing, I don't want it to say "Garages" in the search results or listing page. Anyone know how to do this?
Logged

Dustin | BrandFly

iRealty V3.4
http://www.brandfly.com
Rodion
Guest
« Reply #1 on: August 10, 2007, 03:11:18 PM »

Hello BrandFly ,
This can be easily done by modifying the folowing templates in \system\modules\classifieds\user\templates\countryside\ folder:
form_display_item.tpl - for listing details
form_display_item_short.tpl - for search results.

Below is examples of that templates with condition not to display data if field value is empty:
form_display_item.tpl
Code:
{if $value ne 'unknown'}
{if $name ne ""}
<td{if $colspan > 1} colspan={$colspan}{/if}{if $rowspan > 1} rowspan={$rowspan}{/if}>
<span title="{$hint}">
<span style="font-weight:bold;">{$name}</span> :
</td>
{else}
{assign var="colspan" value=2}
{/if}
<td{if $colspan > 1} colspan={$colspan}{/if}{if $rowspan > 1} rowspan={$rowspan}{/if}>
<span title="{$hint}">
{if $value ne 'unknown'}{$value}{/if}
</span>
</td>
{/if}

form_display_item_short.tpl
Code:
{if $value ne 'unknown'}
<td{if $colspan > 1} colspan={$colspan}{/if}{if $rowspan > 1} rowspan={$rowspan}{/if}>
{if $name ne ""}
<span title="{$hint}" style="font-weight:bold;">{$name}</span> :
{/if}

<span title="{$hint}">
{if $value ne 'unknown'}{$value}{/if}
</span>
</td>
{else}
<td{if $colspan > 1} colspan={$colspan}{/if}{if $rowspan > 1} rowspan={$rowspan}{/if}></td>
{/if}

You can play with these templates to make listings display the way you want.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Classified Software by Worksforweb Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!