Next record on detail page

4 posts by 3 authors in: Forums > CMS Builder
Last Post: January 6, 2011   (RSS)

Re: [rjbathgate] Next record on detail page

By zip222 - June 22, 2010 - edited: June 22, 2010

yes there is. i use this all the time:

Add this to your header (update the tablename with yours):
list($prevRecord, $nextRecord, $firstRecord, $lastRecord) = getPrevAndNextRecords(array(
'tableName' => 'TABLENAME',
'recordNum' => getNumberFromEndOfUrl(),
));


And now you will have access to the following:

The various links (if they exist):
<?php echo $prevRecord['_link'] ?>
<?php echo $nextRecord['_link'] ?>
<?php echo $lastRecord['_link'] ?>
<?php echo $firstRecord['_link'] ?>


You also have access to the other fields (if they exist), for example:
<?php echo $prevRecord['title'] ?>
<?php echo $nextRecord['title'] ?>
<?php echo $lastRecord['title'] ?>
<?php echo $firstRecord['title'] ?>

Re: [zip222] Next record on detail page

By rjbathgate - June 22, 2010

Sweet worked a treat, thanks

Re: [zip222] Next record on detail page

By ScottL - January 6, 2011

Nice...this works great!