I've got a block created with views, which displaying a slider. The slider is created as an unpublished content type with two field collections:
Settings[one value]:
- selectors type: thumbs or bullets
- slider class: fixed position, faded etc.
Slider content[multiple values]:
- slide class
- content class
- Image
- content
I do not use views slideshow module
I'm using views-view--slider-block.tpl.php file to customize the output
All works, but I have stuck with one specific setting "fixed position" - this setting should add to html a special class, which I guess can be added only by preprocess_html function:
function MYTHEME_preprocess_html(&$variables) {
if ( SLIDER HAS "fixed" SETTING ){
$variables['classes_array'][] = 'slider_fixed';
}
}
the problem is:
- how to compose the if statement?
- Did I have to load $view object which allows me to check what setting is used?
I'm looking for the solution which has the lowest influence on the performance.
any suggestions?
$view
in your Views template.