how can I rotate articles on a page

6 posts by 2 authors in: Forums > CMS Builder
Last Post: February 15, 2008   (RSS)

Hello all Chris again so far we are doing really well with CMS

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

Hi Chris,

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!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] how can I rotate articles on a page

Thanks Dave I have done that already. What they want is like the one article to be up on the home page for 10 seconds then the next one replaces it going over and over with the 3 most current ones. They are not a fan of the check box because many people will be working on the site writing articles so they want it to pull from all of the news category regardless. I can work it side ways if this was adding articles to an RSS like article Manager does I made something like this before but had to use a java script to display an RSS feed.

Thanks for your help

Chris

Re: [ChrisTitchenal] how can I rotate articles on a page

By Dave - February 14, 2008

Ahh, I see, so you just need the dhtml part that slides the content around. Do you have a javascript dhtml script to do the sliding already or is that what you're looking for?

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!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] how can I rotate articles on a page

Thanks so much Dave I will start to work on that now. So because I want just 3 articles I limit my list view to 3, are they by defult sorted by date or will I need to define a sort order by date.



Chris