nivoslidermanagement Nivo Slider Management for end users.

  2. Requirements
  3. Installation
  4. Resources


You might want to check my GalleryManager extension first. I will never update this extension again.

This is a Management extension module for a typical jQuery slider,Nivo Slider.It makes possible for an end user to upload images,provide a caption and optionally a link to a page for each image of the slider.The module can easily be modified to manage any widget expecting an array of images as part of it's configuration.Plus,the management page could work very well as an image gallery.


Tested with Yii 1.5,it will probably work with Yii 1.6 also.


  • Exctract download zip and copy nivoSliderManagement folder to modules folder of your Yii application.
  • Create a table in your database using the images_table.sql file found in data module folder.
  • Create the folder that images will be uploaded to, with a name of your choice, inside assets folder of your Yii application.In module configuration (see below) you will specify the name of the folder you just created as 'upload_directory'.
  • In config/main.php of your Yii application include nivoSliderManagement in modules array,like so:( The module is configured with default values.)

    //...other modules...

               'columnLayout'=> '/layouts/column2',
               'upload_directory'=> 'up',
               'max_file_number'=> '10',
               'max_file_size'=> '1mb',

    //...other modules...
  • Place the following code inside the view that you want Nivo Slider in, check Nivo Slider for Yii extension page for details on options.
$this->widget('application.modules.nivoSliderManagement.extensions.nivoslider.CNivoSlider', array(
     //nsprovider is  a variable sent  from the corresponding action,see below.
          // 'controlNavThumbs'=>true,
         // 'controlNavThumbsSearch'=>'.jpg', //Replace this with...
        // 'controlNavThumbsReplace'=>'_100_100_thumb.jpg', //...this in thumb Image src
        // 'controlNavThumbsFromRel'=>true
  • Place the following code inside the action that renders the view file containing Nivo Slider.
//get images from database
$ns_dataProvider = new CActiveDataProvider('Img', array(
  'criteria' => array(
      'select' => array('t.path', 't.title', 't.basename', 't.extension','t.url','t.file_id'),
      'order' => 'title'

$ns_images = $ns_dataProvider->getData();

$nsprovider = array();
$baseurl = Yii::app()->baseUrl;
foreach ($ns_images as $image) {
                if ($image['url'] != "nolink") {
  $nsprovider[] = array('src' => $image['path'].'/'.$image['file_id'].$image['extension'],
                        'caption' => $image['title'],
                        'url' => $baseurl .'/'.$image['url'],
                        'imageOptions' => array('rel' => $image['path'] .'/tmb/'.   $image['file_id'] . '_100_100_thumb' . $image['extension'])
            } else {
  $nsprovider[] = array('src' => $image['path'] . '/' . $image['file_id'] . $image['extension'],
                        'caption' => $image['title'],
                        'imageOptions' => array('rel' => $image['path'] . '/tmb/' . $image['file_id'] . '_100_100_thumb' . $image['extension'])

	    $this->render('[VIEW CONTAINING NIVO SLIDER]',array('nsprovider'=>$nsprovider));
  • Last,optionally, for linking the images to content,install cmssitestructuremodule Yii extension:
    As an alternate option,you can easily adapt your module to your own CMS simply by modifying actionGetlinks action in PlController.

The URL for the management page will be [root folder of your Yii application]/nivoSliderManagement.


NOTE:With the exception of cmssitestructuremodule,you don't have to download and install these extensions,they are included in the module's extensions folder.


5 0
3 314 downloads
Yii Version: 1.1
License: MIT
Category: User Interface
Developed by: drumaddict
Created on: Mar 24, 2011
Last updated: 12 years ago


show all

Related Extensions