 | |  |
 |

InHouse
User
Apr 14, 2008, 11:36 AM
Post #1 of 3
(189 views)
Shortcut
|
|
Mixed List and Page View Behaviour
|
Can't Post
|
|
Maybe I'm just suffering from Monday-Brain here, but I'm stuck on trying to get the best of both worlds. I'd like to have a mix of the Page View and List View functions on one page. Example: A single page which, when first loaded, shows a single article from a multi-page editor. Ideally, that article need not be the num=1 article like the current Page View, but could be selected by a field value (i.e.: featured = 1, or a date DESC condition). That same page should also support a List View of all that table's articles. When one of these links is clicked, the page is reloaded and the new article will be only one shown. I can get almost all of this, but I'm dependent on the recordNum being 1 for the first shown article. I'd like to have more control over this. If I use the WHERE clause to pick the first-shown article, I lose the function of the archive list for subsequent page loads. Any ideas? Jayme
|
|
|  |
 |

Dave
Staff
/ Moderator

Apr 14, 2008, 2:19 PM
Post #2 of 3
(181 views)
Shortcut
|
|
Re: [InHouse] Mixed List and Page View Behaviour
[In reply to]
|
Can't Post
|
|
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
|
|
|  |
 |

InHouse
User
Apr 14, 2008, 3:32 PM
Post #3 of 3
(175 views)
Shortcut
|
|
Re: [Dave] Mixed List and Page View Behaviour
[In reply to]
|
Can't Post
|
|
Hi Dave, Thanks! As ever, you're on top of things. This looks like just the ticket. Best wishes, Jayme
|
|
|  |
|