Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

NewsModule Slideshow


Go to End


3 Posts   1372 Views

Avatar
borriej

Community Member, 267 Posts

20 October 2010 at 3:19am

Edited: 20/10/2010 3:21am

I want to create a newsModule which displays a number of recent news items, but not in the default way.

I want to create a slideshow with (lets say) 4 summaryzed articles.
A few buttons: Next Article, Previous Article, Read More buttons

Red square could be a uploaded image.

already got this function running:

function LatestNews($num=5) {
$news = DataObject::get_one("PageNieuwsArticleHolder");
return ($news) ? DataObject::get("PageNieuwsArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}

Could you give me some clues on how to accomplish this new newsModule?
Rather not use flash, but if it is the best way Im willing to explore.

Avatar
Mad_Clog

Community Member, 78 Posts

20 October 2010 at 3:41am

Edited: 20/10/2010 3:42am

Just put all the news elements in their own HTML element and do the rest with javascript / jQuery.
Finding a jQuery script that will suit your needs shouldn't be a problem.
One plugin i use a lot is jQuery.cycle

Avatar
borriej

Community Member, 267 Posts

20 October 2010 at 4:17am

Edited: 20/10/2010 4:19am

Ok nice, have read the demo's. See that it can slide text with images, but can it also fade text + images?

Is there a way to automatically put the html links into the slider?

With this function it already show the 5 latest articles:

function LatestNews($num=5) {
$news = DataObject::get_one("PageNieuwsArticleHolder");
return ($news) ? DataObject::get("PageNieuwsArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}

So i need to get the link of those articles and print them inside the slider.