You are here

function theme_slick_wrapper in Slick Carousel 7.2

Same name and namespace in other branches
  1. 7.3 templates/slick.theme.inc \theme_slick_wrapper()

Returns HTML for a slick_wrapper when asNavFor, or cache, in use.

Parameters

array $variables: An associative array containing:

  • items: An array of slick instances: main and thumbnail slicks.
  • settings: HTML related settings.
2 theme calls to theme_slick_wrapper()
my_module_render_slick_asnavfor in ./slick.api.php
AsNavFor sample #3.
slick_fields_field_formatter_view in slick_fields/slick_fields.module
Implements hook_field_formatter_view().

File

templates/slick.theme.inc, line 18
Hooks and preprocess functions for the Slick module.

Code

function theme_slick_wrapper(array $variables) {
  $element = $variables['element'];
  $items = $element['#items'];
  $settings = isset($element['#settings']) ? $element['#settings'] : array();
  $skin = isset($settings['skin']) ? $settings['skin'] : '';
  $nav = isset($settings['nav']) ? $settings['nav'] : isset($items[1]);
  $build = drupal_render($items[0]);
  if ($nav) {
    $build .= drupal_render($items[1]);
    $attributes['class'] = array(
      'slick-wrapper',
      'slick-wrapper--asnavfor',
    );
    if ($skin && $skin != 'asnavfor') {
      $attributes['class'][] = str_replace('_', '-', 'slick-wrapper--' . $skin);
    }
    return '<div' . drupal_attributes($attributes) . '>' . $build . '</div>';
  }
  return $build;
}