I used SilverStripe to develop couple of projects and I really liked it. I am still a fan of CakePHP but you should give a try if you don’t want to build a new CMS from scratch with CakePHP.
I want to show you how easy to add an image rotator to your SilverStripe site by using JW Image Rotator. You can see it in action at sumpa.com.tr.
First download the greatest flash image rotator, JW Image Rotator. Then copy/move it to your SilverStripe project folder. I prefer images
folder.
In order to add or remove new images (or swf files) to your rotator easily, we are going to use a folder in our Uploads
directory and list all the files in this folder. Let’s assume that our directory name is flash
. To do that, go to your admin panel in SilverStripe, switch to Files & Images
tab in your menu and create a new directory called flash
.
In your Page class, define a new method called ImageRotator()
.
1 2 3 4 5 6 7 8 9 |
|
Create a new file ImageRotator.ss
in myproject/templates/
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Create a new file Flash.ss
in myproject/templates/Includes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
We complete the steps to create our rotator. Now, you can call it from any page that you want with the following include directive:
1
|
|
Upload your images and swf files into your flash
directory and open the page by adding ?flush=1
to URI. It will refresh the cache.
I know, it should be a widget so that it can easily be added to the pages without hardcoding. I am not planning to do that kind of work but if you find it useful, convert it to a widget and share with community. You are free to do that! No license, no restrictions… :)
Contributions are welcome…