21288 Posts in 5733 Topics by 2602 members
| Go to End | Next > | |
| Author | Topic: | 2921 Views |
-
incorporate a scrolling news ticker

13 March 2009 at 1:00am
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.
http://www.mioplanet.com/rsc/newsticker_javascript.htm
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
Nic -
Re: incorporate a scrolling news ticker

13 March 2009 at 1:31pm Last edited: 13 March 2009 1:34pm
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">
$TickerContent
</div>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 %>
</div>where LatestNews is your function that returns a number of news pages or such like.
Hope that helps
-
Re: incorporate a scrolling news ticker

13 March 2009 at 2:01pm
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.
-
Re: incorporate a scrolling news ticker

1 May 2009 at 6:08am Last edited: 1 May 2009 6:52am
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:
http://www.devarticles.com/c/a/JavaScript/Creating-a-Scrolling-News-Panel/1/Only thing is : what approach to take to get the content from a page into the div ?
Thanks in advance for any suggestions/help.
-
Re: incorporate a scrolling news ticker

1 May 2009 at 8:25am
Hi Nistrad
I suggest you do the tutorials on this page before attempting to make a site in Silverstripe: http://doc.silverstripe.com/doku.php
It will give ayou a good grounding for how SS works.
-
Re: incorporate a scrolling news ticker

3 May 2009 at 3:08am
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?
-
Re: incorporate a scrolling news ticker

4 May 2009 at 3:42am
Nostrad,
have a look at tutorial 2 and find the section called 'Showing the latest news on the home page' : http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site
| 2921 Views | ||
| Go to Top | Next > |




