Removing an entry from list view

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

By drewh01 - December 12, 2009 - edited: December 12, 2009

I have a entry (summaries) in my list view that I need to remove from the main body content as it is displaying a large gap at the top of the page, however I still need it to remain as a link under the sub nav for "articles". "Summaries" is the first article on this page.

http://65.99.232.147/articles/articles.php

How can I do this?

----
Here is the "articles" page code:



<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php

require_once "/home/thesanct/public_html/cmsAdmin/lib/viewer_functions.php";

list($articlesRecords, $articlesMetaData) = getRecords(array(
'tableName' => 'articles',
'perPage' => '10',
));

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Articles :: The Sanctuary at Sedona</title>
<meta name="Description" content="Articles :: The Sanctuary at Sedona" />
<!--<meta name="Keywords" content="<?php echo $articlesRecord['metakeywords'] ?>" /> -->
<link href="../style.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../quickmenu.js'></script>

</head>

<body>

<div id="wrapper">

<div id="header"><?php include("../flash.php"); ?></div>
<!-- end header -->

<div id="nav">

<?php include("../top-nav.php"); ?>

</div><!--end div nav-->


<div id="content">

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


<table width="760" height="200" border="0" cellspacing="0">
<tr>
<td width="558" height="200">

<h1><?php echo $record['name'] ?></h1>
<?php echo $record['content'] ?><?php if ($record['additional_content']): ?>[<a href="<?php echo $record['../_link'] ?>">read more</a>]<br/>
<?php endif ?></td>
</tr>
</table>


<hr />
<?php endforeach; ?>

<!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
<?php if ($articlesMetaData['prevPage']): ?>
<a href="<?php echo $articlesMetaData['prevPageLink'] ?>">&lt;&lt; prev</a>
<?php else: ?>
&lt;&lt; prev
<?php endif ?>

- page <?php echo $articlesMetaData['page'] ?> of <?php echo $articlesMetaData['totalPages'] ?> -

<?php if ($articlesMetaData['nextPage']): ?>
<a href="<?php echo $articlesMetaData['nextPageLink'] ?>">next &gt;&gt;</a>
<?php else: ?>
next &gt;&gt;
<?php endif ?>
<!-- /STEP3: Display Page Links -->

</div><!-- end content -->
<!-- end content -->
<div id="clear"></div><!-- end clear -->

<div id="footer">
<?php include("../footer-nav.php"); ?>
</div><!-- end footer -->

</div><!-- end wrapper -->
<?php include("../copyright.php"); ?>
</body>
</html>

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 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/