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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

incorporate a scrolling news ticker

Go to End

9 Posts   3675 Views


13 March 2009 at 1:00am Community Member, 2 Posts

Hi all!

I'm new to SS and I have a problem. I need to incorporate a scrolling news ticker to a site where the news content is editable from the admin area.

An example of what I've had in mind is something like this.

What would the best practise be to solve this? Create a new newsticker-module or create a widget? Or is there another way to do this?

Best regards and thanks

Carbon Crayon

13 March 2009 at 1:31pm (Last edited: 13 March 2009 1:34pm), Community Member, 598 Posts

hi nic, welcome to Silverstripe

This is pretty straidforward, you just need to output whatever content you want in the ticker into the right markup on your page. Having looked briefly at the ticker code it looks like you would do something like this:

<div id="TICKER" STYLE="overflow:hidden; width:520px">

where TickerContent is a field in the $db array.

You could also make it more dynamic and grab content from various pages via a DataObject::get call outputting something like this:

<div id="TICKER" STYLE="overflow:hidden; width:520px">
<% control LatestNews %>
$Title - $Content.FirstSentence
<% end_control %>

where LatestNews is your function that returns a number of news pages or such like.
Hope that helps :)


13 March 2009 at 2:01pm Administrator, 685 Posts

Yeah, generally speaking we try to "get out of the designers way" and let people use whatever javascript/css effects they like on the front end, without having to make special modules.

Aram's approach looks good.


1 May 2009 at 6:08am (Last edited: 1 May 2009 6:52am), Community Member, 25 Posts

Please can someone give some tips for me to get started. What is the $db array ? I want to make it as simple as possible for my user to add news items that will display in the scrolling area on the home page. For this I would need to have a page or a form which can be edited to add /delete news items. Even if it is a simple page not a problem. But how do I get the content then from this page into the DIV that displays it? Please urgent help is sought.

This is basically what i want to do:

Only thing is : what approach to take to get the content from a page into the div ?

Thanks in advance for any suggestions/help.

Carbon Crayon

1 May 2009 at 8:25am Community Member, 598 Posts

Hi Nistrad

I suggest you do the tutorials on this page before attempting to make a site in Silverstripe:

It will give ayou a good grounding for how SS works.


3 May 2009 at 3:08am Community Member, 25 Posts

I went through the docs but I could not find anywhere a specific solution to my problem. I need to get content from a page into a DIV tag on another page. How do I do that?


4 May 2009 at 12:11am Community Member, 25 Posts

No response from anyone on this???

Carbon Crayon

4 May 2009 at 3:42am Community Member, 598 Posts


have a look at tutorial 2 and find the section called 'Showing the latest news on the home page' :

Go to Top