Views Carousel
Last modified: October 22, 2008 - 17:41
This documentation page is for the Views Carousel module, which is a Views plugin for outputting content as a jQuery carousel.
5.x-1.x-dev (Drupal 5/Views 1 Version)
Specifics on how to use the 5.x-1.x-dev version of Views Carousel are forthcoming. If you would like to write some documentation, please add it as a comment and we'll roll it into this page.
6.x-1.x-dev (Drupal 6/Views 2 Version)
Creating a Views Carousel is simple. Here's the step-by-step process:
- Make sure you have Views Carousel and Views 2 installed and you're up and running on a Drupal 6 installation.
- Go to the Views interface and add a new View. (Views Carousel works with any type of view including users or taxonomy)
- Set up your View to show the content you want in your carousel using the Filters, etc, then add a new block or page type view.
- Setting "Row Style" to "field" gives the best result since displaying full nodes in the carousel may be unpredictable
- Click the "style" option and choose "Views Carousel". The following options will be available:
- Grouping Field Allows you to group content by field
- Skin This determines the style of your carousel. There are 2 stock skins available and a choice for making your own custom skin.
- Display Carousel Vertically (checkbox) This is untested as of now. Should orient the carousel in a vertical direction
- First item to start on This allows you to start on an item other than the first one in the sort. For example putting in "2" would make the second item in your View appear first in the carousel
- Number of items to display in carousel This is currently untested and may conflict with the number of items in your view. Please test and report in the issue queue.
- Speed of animation This is the speed of the scroll animation which may be 'fast', 'slow', or in milliseconds.
- Name of easing effect This allows you to designate a jQuery effect for the easing behavior. Documentation on the options is found here
- Autoscrolling If set to a number other than 0, it enables an 'autoscrolling' effect and sets the delay to the number entered in seconds. The autoscrolling means that the carousel will scroll on it's own without any user interaction
- Wrap Content This function allows your carousel to go back to the beginning when you reach the end, or to the end when you're at the beginning, or both, essentially allowing the arrow buttons to always move the carousel somewhere.
Theming The Carousel
To theme the carousel requires some CSS skills. Here's some notes on theming the carousel:
- The height and width of the carousel items are set in the skins CSS files. Override them in your stylesheet to set other height and width. We're investigating whether auto-height and auto-width can be implemented naively.
- The buttons (prev/next) are also implemented via CSS. Create your own button graphics and override the theme CSS to show your buttons instead.
- The curved corners on both stock themes are available in Firefox or other Mozilla browsers by using CSS -moz-border-radius. So don't waste your time looking for rounded corner images...there are none in the stock themes.
Please Contribute!
We'd love to see you contribute to this documentation. Please leave your corrections, additions, or subtractions in the comments and we'll add them to this docuemntation.

Easing Effects Require JQuery plugin
It took me awhile to make heads or tails of especially the "easing effects" section. I think that this requires a plugin (for JQuery) that I don't have installed. Don't waste your time trying to see what this does cause it doesn't without the proper additions.
I'm looking forward to some kind soul taking the time to document skinning this a bit more. :-)
Creating your own views carousel skin
To make your own custom skin for this module requires two basic steps:
* Add the name of your skin to viewscarousel.module
* Create your own skin folder (with associated files)
To do this:
* go to sites/all/modules/viewscarousel/skins and copy the entire tango folder; rename your copied tango folder to "myskin" or whatever
* open up sites/all/modules/viewscarousel/viewscarousel.module and scroll down to the bottom of the file.
* create your own case to handle the params associated with your skin. In my case I just copied:
case 'tango':drupal_add_css(drupal_get_path('module', 'viewscarousel') .'/skins/tango/skin.css');
return 'jcarousel-skin-tango';
break;
...and pasted this chunk below the break; in the tango case.
* next, rename case 'tango': to case 'myskin': (must match the name of your skin folder mentioned above)
* change the drupal_add_css path to point to your new css file; the path should be '/skins/myskin/skin.css'
* save viewscarousel.module
* now go to sites/all/modules/viewscarousel/skins/myskin and open skin.css
* do a search/replace for all instances of 'tango' and replace with 'myskin' or whatever you named your folder
* change the css properties as you see fit; save skin.css
* now go back to administer/views and configure viewscarousel to use your new skin. It should show up in the Skin: drop down list
Enjoy!
Whoops--forgot 1 thing:
In addition to the above, you need to add your custom theme name to the array of skins in the viewscarousel $form. To do so open:
sites/all/modules/viewscarousel/viewscarousel_style_plugin.inc and look for:
$form['skin'] = array(...
...
'#options' => array(...
Now add your skin to the array like this (make sure you use proper array syntax)
'myskin' => t('myskin')
Bad form?
Isn't it bad form to just hack into modules at random? What about reusability?
It seems it would be better to either patch this module to provide the functionality of adding more skins via an administration interface, or to write a new module that does same, altering menus as you describe.
If this module gets updated down the road, you have to port your code to the new version. How annoying and inefficient!
The module seems to allow 'custom' skin, but I haven't been able to get it to work. Typing a path to a css file on my mulltisite setup just isn't working.
I also can't override the css file by using selectors in my main theme file. Annoying.
Missing case??
I don't see any section in the existing viewscarousel.module for tango's case? Did the code change since you made this post?
I get a parse error if I just add:
case 'tango':
drupal_add_css(drupal_get_path('module', 'viewscarousel') .'/skins/tango/skin.css');
return 'jcarousel-skin-tango';
break;
Views Carousel
I see there are fantastic instructions on customising the carousel skin, inclduing the buttons. My question is whether it's possible (of course it's possible...anything is) to have no buttons, but to scroll it moving the mouse pointer from one side to the other?
Thanks in advance.
How to style the view D6
How can I style the theme the actual view?
I can theme normal views by creating tpl files, but not sure how it can be done here?
I have Views & jCarousel enabled, still won't scroll
Everything else is working fine, my View block is configured correctly and I'm able to theme it just fine -- except the arrows aren't doing anything. Is there a simple step I'm forgetting?