Mixed List and Page View Behaviour

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 14, 2008   (RSS)

Re: [InHouse] Mixed List and Page View Behaviour

By Dave - April 14, 2008

Hi Jayme,

It's been requested a few times to have a way to default the page viewer to a certain record. I'm going to update the page viewer for the next version to default to showing the first record (sorted by 'orderBy') instead of record 1. So you're code will look like this:

$options['recordNum'] = '';
$options['where'] = '';
$options['orderBy'] = 'featured=1, date';


If a record number is defined in the url it will use that, if not, it will load the first record that comes up when sorting by the order by.

I know you're testing the multi-section sort so I'll include that code in the next update I send you shortly.

Also, for your list viewer on the same page, you want to hard code the page number and where so it doesn't pick up any values from the url. Like this:

$options['perPage'] = '9999'; // show all records
$options['pageNum'] = '1'; //
$options['where'] = '1'; // ignore search queries in url


I'll send you an updated viewer_functions.php and then the above code will work with orderBy for the page viewer.

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

Re: [Dave] Mixed List and Page View Behaviour

By InHouse - April 14, 2008

Hi Dave,

Thanks! As ever, you're on top of things. This looks like just the ticket.

Best wishes,
Jayme