Re: [chris] news content or pdf
For the news page I have up in the header
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/home/chsm00/public_html/cmsAdmin/lib/viewer_functions.php";
list($in_the_newsRecords, $in_the_newsMetaData) = getRecords(array(
'tableName' => 'in_the_news',
));
?>
For the links to the news in the body of the page
<?php foreach ($in_the_newsRecords as $record): ?>
<?php if (!$record['content'] && !empty($record['pdf'])): ?>
<a href="<?php echo $record['pdf'][0]['urlPath'] ?>">
<?php else: ?>
<a href="<?php echo $record['_link'] ?>">
<?php endif ?>
<br /><?php echo $record['title'] ?>
</a>
<br />
<?php endforeach; ?>
<?php if (!$in_the_newsRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
Is in the header for the news detail page
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/home/chsm00/public_html/cmsAdmin/lib/viewer_functions.php";
list($in_the_newsRecords, $in_the_newsMetaData) = getRecords(array(
'tableName' => 'in_the_news',
));
?>
<?php
require_once "/home/chsm00/public_html/cmsAdmin/lib/viewer_functions.php";
list($in_the_newsRecords, $in_the_newsMetaData) = getRecords(array(
'tableName' => 'in_the_news',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$in_the_newsRecord = @$in_the_newsRecords[0]; // get first record
// show error message if no matching record is found
if (!$in_the_newsRecord) {
print "Record not found!";
exit;
}
?>
displays the content field for the news
<h1><?php echo $in_the_newsRecord['title'] ?></h1><br/>
<?php echo $in_the_newsRecord['content'] ?><br/>
<?php if (!$in_the_newsRecord): ?>
No record found!<br/><br/>
<?php endif ?>
Is the list
<?php foreach ($in_the_newsRecords as $record): ?>
<?php if (!$record['content'] && !empty($record['pdf'])): ?>
<a href="<?php echo $record['pdf'][0]['urlPath'] ?>">
<?php else: ?>
<a href="<?php echo $record['_link'] ?>">
<?php endif ?>
<br /><?php echo $record['title'] ?>
</a>
<br />
<?php endforeach; ?>
<?php if (!$in_the_newsRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
Hope that helps