function template_preprocess_owl in Multipurpose Corporate Profile 8
Themeable for owl
File
- modules/
contrib/ owl/ owl.module, line 45 - Contains owl.module..
Code
function template_preprocess_owl(&$variables) {
$items = $variables['items'];
$settings = _owl_format_settings($variables['settings']);
$variables['attributes']['class'][] = 'owl-slider-wrapper';
$variables['attributes']['class'][] = 'owl-carousel';
$variables['attributes']['data-settings'] = json_encode($settings);
$html = '';
if (!empty($items)) {
$i = 0;
foreach ($items as $item) {
$html .= '<div class="owl-item-inner owl-item-inner' . $i . '">' . render($item) . '</div>';
$i++;
}
}
$ouput = array(
'#type' => 'markup',
'#markup' => $html,
);
$variables['output'] = render($ouput);
}