Can I display only positive result content?

4 posts by 3 authors in: Forums > CMS Builder
Last Post: January 14, 2010   (RSS)

Hi all,

We are currently providing a facility for a client which displays information on used caravans much the same as instant realty, as with a realty application there are certain fields for facilities which each caravan may have ie double glazing, central heating etc, my client wants to know if it is possible for the detail listing for each caravan to only display facilities it has and omit the things it doesnt, for example if the caravan has double glazing then include double Glazing in the list but if it hasnt got central heating then to omit central heating from the list rather than listing Central Heating - No.

The intention being to not highlight the facilities a particular caravan may not have just focus on the positive items.

I am sure it will be possible but not sure how to go about it or how difficult this might be with my limited knowledge of both php and cms builder, any help would/advice would be appreciated.

Thanks in advance.

Re: [chris] Can I display only positive result content?

Thanks!!! This post helped me greatly! Thanks
I am also interested as to how I can do the same if i am using
• a dropdown list
• a text field (if there is text entered it is displayed and if left blank does not display.

Thanks again.[:)]
Dan Perez

Re: [depdesign] Can I display only positive result content?

By Chris - January 14, 2010

Hi depdesign,

For text fields and list fields, you can probably get away with:

<?php if (strlen($record['field_name'])): ?>
Field Name - <?php echo htmlspecialchars($record['field_name']) ?><br />
<?php endif ?>


Does that work for you? I hope this helps! :)
All the best,
Chris