I have a slideshow that is a mix of "Article" and "Video" content types. I need to have a custom class added to the row that will differentiate the content type so that I can style the two slightly different.

I added the Content:Type field to my view and excluded it from display. Then in the Slideshow's settings I added the [type] token in the Row Class field. The new custom class only displays "article" in the row even when the row contains a video.

I tested this same scenario with the unformatted style and the row class would properly display article or video.

Comments

circuscowboy’s picture

The problem seems to be that the variable $var['item_count'] is always 0

I didn't find out why the item_count is 0 but if you changed line 183 from

if ($row_class = $vars['view']->style_plugin->get_row_class($vars['item_count'])) {

to

if ($row_class = $vars['view']->style_plugin->get_row_class($vars['id']-1)) {

It will work.

This is a hack and I will look more to see if I can find out why item_count is not counting. If any one else more attached to the code can debug this please do.

circuscowboy’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Assigned: Unassigned » circuscowboy
Status: Active » Needs review
StatusFileSize
new992 bytes

It didn't take much looking to find a cleaner solution

I have attached a patch for views_slideshow_cycle.theme.inc based on the latest dev

please apply patch from this folder

views_slideshow/contrib/views_slideshow_cycle/theme

bschilt’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the quick fix for this. I applied the patch and my issue is now fixed.

fuerst’s picture

#2 working for me too. Applied from the views_slideshow root directory by using patch -p5

redndahead’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new3.23 KB

I have committed a fix. And I have also removed some other options that didn't need to exist.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.