If statement

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

By chassa2556 - January 5, 2009

Hi

On my list viewer I want to have URL links to pages that have copy in the 'content' field but not show the link when there is no copy in here.

Have put in this code

<?php echo $record['title'] ?> <?php if ($sectionRecord['content']): ?>
<a href="services_detail.php?<?php echo $sectionRecord['num'] ?>">See more &gt;&gt;</a>


The header code is this

list($sectionRecords, $sectionMetaData) = getRecords(array(
'tableName' => 'section',
'where' => 'category = "Services" AND ' . whereRecordNumberInUrl(1),
));


However it is coming up with a blank page? Am I doing something wrong?

Re: [chassa2556] If statement

By Dave - January 6, 2009

Hi Charles,

Don't forget the endif. Like this:

<?php echo $record['title'] ?>

<?php if ($sectionRecord['content']): ?>
<a href="services_detail.php?<?php echo $sectionRecord['num'] ?>">See more &gt;&gt;</a>
<?php endif ?>

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com