Show/hide some predefined text on Detailpage with checkbox

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 24, 2015   (RSS)

By Damon - September 24, 2015

Hi Koen,

Here are some steps to show/hide content based on a checkbox in CMS Builder:

  1. Add a checkbox in CMS Builder called "Show Featured Content" for example. Set the Default State radio button to Checked. And add text in the "Field Description" like this: Uncheck to hide Featured Content
  2. Generate to code for the checkbox and add it to your template along with the IF statement like this:

<?php if($record['show_featured_content'] == 1) : //if checkbox is checked then show the content ?>
   Predefined text here <br />
<?php endif; ?>

That should be it.  Try this out and let me know if you have any questions or issues.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/