How to Hide an Entry in a Multiple Record Listing

4 posts by 3 authors in: Forums > CMS Builder
Last Post: June 3, 2013   (RSS)

By gkornbluth - June 1, 2013

Hi Tina,

Would a Hidden" check box in the record work for you. (Added as a normal check box field but with Hidden as its name)

When the box is checked, the record is hidden from the site, but not erased.

If the status field is a check box, or has a value of "inactive" you might be able to use an if statement inside your list page foreach loop to exclude that record as well.

Something like:

 <?php foreach ($lodge_pageRecords as $record): ?>

<?php if (!$record['lodge_status'] == 1) :?>

code to show the lodge in the list page goes here

<?php endif ?>

<?php endforeach ?>

OR

 <?php foreach ($lodge_pageRecords as $record): ?>

<?php if (!$record['lodge_status'] == 'inactive') :?>

code to show the lodge in the list page goes here

<?php endif ?>

<?php endforeach ?>

The ! means 'not", and the == means 'exactly equal to'.

Hope that helps,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By ross99 - June 1, 2013

Hi there

I agree with Jerry that a "hidden" field should do the trick.  It also sounds like you might want certain lodges to be hidden auto hide after a certain date. If that's the case, you need a couple more special fields:

publishDate
removeDate
neverRemove

You can read up on how to set those kind of fields in our online docs:

http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html

If you need a hand setting them up, let us know :).

Ross Fairbairn
http://www.interactivetools.com
consulting@interactivetools.com

By csdesign - June 3, 2013

oh, see (duh) I was trying to hide the detail page.  Makes perfect sense I have to hide it on the list page.  I will give that a try. Thanks!!!  Tina