Hidden checkbox
2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 21, 2019 (RSS)
I am using the hidden checkbox function and that works well but I also need to apply the hidden function to the containing DIV around the CMS content. So if you tick "hidden" it hides the DIV containing the CMS content.
Hi MercerDesign,
Try using a 'where' in your get records call to allow both hidden and not hidden records to be read, as in this example:
list(your_tableRecords, $your_tableMetaData) = getRecords(array(
'tableName' => 'your_table',
'where' => " hidden = '0' ",
'orWhere' => " hidden = '1' ",
));
and then try an if statement around the div so only when hidden== '0' OR hidden == '' (empty) for a particular record, the entire div will show on the page.
something like:
<?php foreach ($your_tableRecords as $record): ?><?PHP if ($record['hidden'] == '0' || hidden == '' ):?> <div> your code </div> <?php endif ?>
Hope that helps.
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php