You are here

function hook_slick_skins_info in Slick Carousel 7.2

Same name and namespace in other branches
  1. 8 slick.api.php \hook_slick_skins_info()
  2. 7.3 slick.api.php \hook_slick_skins_info()

Registers Slick skins.

This function may live in module file, or my_module.slick.inc if you have many skins.

This hook can be used to register skins for the Slick. Skins will be available when configuring the Optionset, Field formatter, or Views style. It should be used in relation to individual slide layout to get the most out of it, see README.txt on slick_fields.module for possible Slide layouts using a field with Field collection.

Slick skins get a unique CSS class to use for styling, e.g.: If your skin name is "my_module_slick_carousel_rounded", the class is: slick--skin--my-module-slick-carousel-rounded

A skin can specify some CSS and JS files to include when Slick is displayed, except for a thumbnail, arrows, or dots skin which accepts CSS only.

Each skin supports 5 keys:

  • name: The human readable name of the skin.
  • group: The group the skin belongs to reduce confusing UI selection, with the supported keys: arrows, dots, main, overlay, thumbnail.
  • description: The description about the skin, for help and manage pages.
  • css: An array of CSS files to attach.
  • js: An array of JS files to attach, e.g.: image zoomer, reflection, etc.
  • inline css: An optional flag to determine whether the image is turned into CSS background rather than image with SRC, see fullscreen skin.

See also

hook_hook_info()

slick_example.module

slick.slick.inc

1 function implements hook_slick_skins_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

slick_slick_skins_info in ./slick.slick.inc
Implements hook_slick_skins_info().
1 invocation of hook_slick_skins_info()
slick_skins in ./slick.module
Returns an array of skins registered via hook_slick_skins_info().

File

./slick.api.php, line 452
Hooks and API provided by the Slick module.

Code

function hook_slick_skins_info() {

  // The source can be theme, or module.
  $theme_path = drupal_get_path('theme', 'my_theme');
  return array(
    'skin_name' => array(
      // Human readable skin name.
      'name' => t('Skin name'),
      // Description of the skin.
      'description' => t('Skin description.'),
      // Not yet implemented by now, 3/5/16.
      // Defines group for the skin to reduce selection confusion at UI.
      // Accepted keys: arrows, dots, overlay, main, thumbnail.
      // This is deprecating hook_slick_arrows_info(), hook_slick_dots_info().
      'group' => 'main',
      'css' => array(
        // Full path to a CSS file to include with the skin.
        $theme_path . '/css/my-theme.slick.theme--slider.css' => array(),
        $theme_path . '/css/my-theme.slick.theme--carousel.css' => array(),
      ),
      'js' => array(
        // Full path to a JS file to include with the skin.
        $theme_path . '/js/my-theme.slick.theme--slider.js' => array(),
        $theme_path . '/js/my-theme.slick.theme--carousel.js' => array(),
        // If you want to act on afterSlick event, or any other slick events,
        // put a lighter weight before slick.load.min.js (0).
        $theme_path . '/js/slick.skin.menu.min.js' => array(
          'weight' => -2,
        ),
      ),
    ),
  );
}