Filter Out certain record from list

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 14, 2011   (RSS)

Re: [jonoc73] Filter Out certain record from list

By Jason - January 14, 2011

Hi Jono,

If you know at run time the record number of a record you don't want to have in your list, you can do this:



<?php foreach ($guided_tourRecords as $record): ?>
<?php if($record['num']==37){ continue; } ?>


If you want this to apply to multiple record, and which records are being excluded change from time to time, then this isn't a very robust solution. Another thing you could do is add a check box to your section called "exclude" If it's checked, you don't output the record like this:

<?php foreach ($guided_tourRecords as $record): ?>
<?php if($record['exclude']){ continue;} ?>


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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