You are here

public function SlickSkinTest::skins in Slick Carousel 8

Same name and namespace in other branches
  1. 7.3 tests/modules/slick_test/src/SlickSkinTest.php \Drupal\slick_test\SlickSkinTest::skins()

Returns the Slick skins.

This can be used to register skins for the Slick. Skins will be available when configuring the Optionset, Field formatter, or Views style, or custom coded slicks.

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

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

Each skin supports 5 keys:

  • name: The human readable name of the skin.
  • 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.
  • group: A string grouping the current skin: main, thumbnail.
  • provider: A module name registering the skins.

Return value

array The array of the main and thumbnail skins.

Overrides SlickSkinInterface::skins

File

tests/modules/slick_test/src/SlickSkinTest.php, line 18

Class

SlickSkinTest
Implements SlickSkinInterface as registered via hook_slick_skins_info().

Namespace

Drupal\slick_test

Code

public function skins() {
  $path = base_path() . drupal_get_path('module', 'slick_test');
  $skins = [
    'test' => [
      'name' => 'Test',
      'description' => $this
        ->t('Test slick skins.'),
      'group' => 'main',
      'provider' => 'slick_test',
      'css' => [
        'theme' => [
          $path . '/css/slick.theme--test.css' => [],
        ],
      ],
      'options' => [
        'zoom' => TRUE,
      ],
    ],
  ];
  return $skins;
}