hiding empty fields

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

Re: [steve_e] hiding empty fields

By Chris - March 2, 2010

Hi steve_e,

You'll need to do this in PHP, but it's really quite easy. Simply replace this:

Field: <?php echo $record['field'] ?>

with this:

<?php if ($record['field']): ?>
Field: <?php echo $record['field'] ?>
<?php endif ?>


I hope this helps. Please let me know if you have any questions.
All the best,
Chris

Re: [chris] hiding empty fields

By steve_e - March 3, 2010

Thanks Chris -
I just had a page with a whole bunch of possibly empty fields and the code was starting to look a little ragged with all the if statements, so I was wondering if I'd missed something in CMS B.

Might this be a good thing to include as a field option in a future release?

Re: [steve_e] hiding empty fields

By Chris - March 3, 2010

Hi steve_e,

It does seem that a lot of people want their Code Generated pages to work like this out-of-the-box. I'll make sure our feature request list reflects that. Thanks for the feedback. :)
All the best,
Chris