how can I rotate articles on a page
6 posts by 2 authors in: Forums > CMS Builder
Last Post: February 15, 2008 (RSS)
By Chris_t - February 14, 2008
The owners of the site are in love with the idea of the articles rotating in and out with the most recent ones top 3 to be exact. http://www.raptorsuif.com/ was given to me as an example. I don't really need the buttons being highlighted just for the 3 most resent news articles being displayed on the front page.
Thanks
Chris
Re: [ChrisTitchenal] how can I rotate articles on a page
By Dave - February 14, 2008
So you don't want random, right? You want top 3? If you want, you can create a "featured" checkbox and only have featured articles on the frontpage, but the simplest way to do it otherwise is just create a list viewer with these options:
$options['perPage'] = '3'; // show only 3 records
$options['pageNum'] = '1'; // show only first page of results
$options['orderBy'] = 'date DESC'; // show newest records first
$options['where'] = '1'; // show all records
If you wanted only featured records you would have 'featured = 1' for the 'where'. Then finally don't bother copying and pasting the prev/next paging code since you don't want to page through, you just want the top 3.
Is that what you wanted? Hope that helps!
interactivetools.com
Re: [Dave] how can I rotate articles on a page
By Chris_t - February 14, 2008
Thanks for your help
Chris
Re: [ChrisTitchenal] how can I rotate articles on a page
By Dave - February 14, 2008
Looking at the source of http://www.raptorsuif.com/ it looks like they're using this one: http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm
It looks like all you need to do is put a div around the 3 records that are output.
Hope that helps!
interactivetools.com
Re: [Dave] how can I rotate articles on a page
By Chris_t - February 15, 2008
Chris
Re: [ChrisTitchenal] how can I rotate articles on a page
By Dave - February 15, 2008
interactivetools.com