Some Help

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 4, 2012   (RSS)

By efi-revivo - June 1, 2012 - edited: June 1, 2012

I have gallery with list page and when the user click to see the detail Page I want to know how to make Next and Prv record link in detail Page by category.

Thanks,
Efi

Re: [efi-revivo] Some Help

By Jason - June 1, 2012

Hi,

There is a CMSB function called getPrevAndNextRecords().

For example:

list($prevRecord, $nextRecord, $firstRecord, $lastRecord) = getPrevAndNextRecords(array(
'tableName' => 'news',
'recordNum' => $record['num'],
'where' => '1', // optional - defaults to all records in section
'orderBy' => 'createdDate', // optional - defaults to schema listPageOrder
));


In this example $record would be the record you were outputting on your detail page. You would also want to replace the "where" option with the same where clause used on your list page.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/