Yii version of Nivo Slider.
This release is an alpha version, no bugs related yet.
Please report bugs at Forum topic.
Please support the original creator.
protected/extensionsPut the follow code into your views.
$this->widget('application.extensions.nivoslider.CNivoSlider', array( 'images'=>array( //@array images with images arrays. array('src'=>'path/to/image'), //only display image. array('src'=>'path/to/image', 'caption'=>''), //display image and nivo slider caption. array('src'=>'path/to/image', 'url'=>array('')), //display image with link. array('src'=>'path/to/image', 'url'=>array(''), 'caption'=>''), //display image with nivo slider caption and link reference. ), ) );
id = @string, the id of the nivo slider div. Defaults set to dynamic generation. htmlOptions = @array, the html options of the nivo slider div. Defaults set to null. fancy = @boolean, toggle the defaults fancy style. Defaults set to true. cssFile = @string, path to custom style sheet. Defaults set to NULL. config = @array, configuration parameters of nivo slider jquery. Defaults set to basic configuration. images = @array containing the images arrays of the widget. Defaults set to NONE.
src = @string, the path of image, caption = @string, the nivo slider caption of image, imageOptions= @array, the html options of image tag url = @array or @string, the path of link, linkOptions = @array, the html options of link tag
Total 9 comments
Hey guys. I will send the updated extension soon. Thanks for all ideas. I was quite busy and forgot my extensions for a while. I will update all soon.
Since the Yii script registration is being done with the class name (line 79 of ENivoSlider.php):
It will register just the last widget you use. To solve this, just change for example to the "id" of the htmlOptions (if you don't declare "id", line 48 will take the getId() of the class).
Hi, thanks for the ext
I'd like to suggest that you change line 79 inside ENivoSlider to : Yii::app()->getClientScript()->registerScript(CLASS.$this->htmlOptions['id']
Adding the "id" to the script name so we can have multiple instances of the widget on the same page
Also, Usage on this page is indicating wrong class name: $this->widget('application.extensions.nivoslider.CNivoSlider', array(
should be $this->widget('application.extensions.nivoslider.ENivoSlider', array(
=))
Regards!
Thank you very much, keep up the good work.
My suggestion to make this even better is to change it a bit so we can use a folder with images to display all images inside that folder instead of a new array with path, caption and other parameters for each image.
Keep up the good work.
I could see captions rotating but no pics, turns out width and height has to be set or you see nothing.
To the suggested modification i had to change line 99 to
Otherwise im forced to set a caption or get a "Undefined index: caption "
Really nice extension!
I had to modify one function to make it work, though:
Download the latest version of NivoSlider and copy over the existing library in assets.
http://nivo.dev7studios.com/
Appears to be broken with jQuery 1.4.4 which is bundled with Yii Framework 1.1.5
Leave a comment
Please login to leave your comment.