Removing an entry from list view

5 posts by 4 authors in: Forums > CMS Builder
Last Post: September 27, 2010   (RSS)

Re: [drewh01] Removing an entry from list view

By Dave - December 15, 2009

Hi Drew,

Is the content field for Summaries blank? If so you can use this code to skip it:

<?php foreach ($articlesRecords as $record): ?>
<?php if (!$record['content']) { continue; } // skip articles with no content ?>


Let me know if that works for you! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Removing an entry from list view

By drewh01 - December 15, 2009

Thanks!

Re: [Dave] Removing an entry from list view

By Mikey - September 25, 2010 - edited: September 25, 2010

Never mind.
Figured it out... I just created a "hidden" field and was able to remove the record from the category list page, yet still be able to see the relationship on the individual product page.

Dave any suggestions how to remove a single entry in a category list? For example we offer many various types of jelly beans. So in our category list we have an entry called "many flavors to choose from". Then as we add new jelly beans to our product selection, if the jelly bean has many flavors to choose from we select this option. But we also have a page that list all of our jelly bean flavors all on one page and we do not want to list the "many flavors to choose from" on this page. So I'm hoping there's a way I can list all my category entries and remove one single category entry with the name "many flavors to choose from".

Is it possible to disallow a single category entry from displaying using a method similar to this code:
<?php if (!$record['name']) { continue; } // skip many flavors to choose from ?>

Here's what my code looks like:
<?php
list($jellybeanflavorsRecords, $jellybeanflavorsMetaData) = getRecords(array(
'tableName' => 'jellybeanflavors',
));
?>

<div id="jellybeansContainer">
<h1>Jelly Bean Flavors</h1>
<!-- 3 columns -->

<table cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($jellybeanflavorsRecords as $record): ?>
<?php if (!$record['name']) { continue; } // skip many flavors to choose from ?>

<td valign="top" class="jellybeanListings">
<div id="border">
<h2><?php echo $record['name'] ?></h2>
<p><?php echo $record['jellybean_summary'] ?>
Web Site: <?php echo $record['www_address'] ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['name'] ?>more about this flavor</a></p>
<!-- /border --></div>
</td><?php $maxCols=3; if (@++$count % $maxCols == 0): ?></tr><tr> <?php endif ?>
<?php endforeach ?>
</tr>
<!-- /3 columns --></table>

<p><?php if (!$jellybeanflavorsRecords): ?>
No records were found!
<?php endif ?></p>

<!-- /jellybeansContainer--></div>


Hi Drew,

Is the content field for Summaries blank? If so you can use this code to skip it:

<?php foreach ($articlesRecords as $record): ?>
<?php if (!$record['content']) { continue; } // skip articles with no content ?>


Let me know if that works for you! :)

Re: [zickey] Removing an entry from list view

By Jason - September 27, 2010

Hi,

Is the does the name field of that category hold the value "many flavors to choose from" ?

If so, you could filter it out based on that text:

<?php foreach ($jellybeanflavorsRecords as $record): ?>
<?php if (!$record['name'] || $record['name']=="many flavors to choose from") { continue; } // skip many flavors to choose from ?>


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/