5098 Posts in 1518 Topics by 1115 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 934 Views |
-
Javascript header rotator

21 March 2009 at 10:17am
Hi,
i'm new with SilverStripe and i'm trying to find answer for my simple question. I'm trying to find out how to do header rotator - for example how to upload 5 images for each page and rotating it by jquery in some interval. Javascript part it isn't a problem.
Please, if it possible, give me some clues how to do it.
Thanks in advance,
webdevil -
Re: Javascript header rotator

21 March 2009 at 2:06pm
First of all: create some image-columns in your db. (tutorial 2)
Second: add fieldtypes to the tab of your choice. (idem)
Third: use your js-knowledge (which I haven't) to create the header-rotator and call the images from the db. Just save this javascript into a regular .js-file
Fourth: Call the .js-file in the controllerpart of your .php-file:function init() {
Requirements::javascript( "pathTo/myJSfile.js" );
parent::init();
}If you need some libs like jquery, you can include them in the same way.
However: be aware that silverstripe might use the prototype and/or behaviour libs in the frontend. These might conflict and in that case you have to turn a lib off with Requirements::block("pathTo/conflictingLib.js");Hope this helps
| 934 Views | ||
|
Page:
1
|
Go to Top |

