function jcarousel_add in jCarousel 8.5
Same name and namespace in other branches
- 8.3 jcarousel.module \jcarousel_add()
- 8.4 jcarousel.module \jcarousel_add()
- 5 jcarousel.module \jcarousel_add()
- 6.2 jcarousel.module \jcarousel_add()
- 6 jcarousel.module \jcarousel_add()
- 7.2 jcarousel.module \jcarousel_add()
Adds all the necessary CSS and JS necessary for building a carousel.
Parameters
array $options: (optional) A list of settings to be passed to jCarousel.
Return value
array An array of JS and CSS files, suitable for inclusion as an #attached array.
Deprecated
Please use render arrays with element theme 'jcarousel' instead.
See also
File
- ./
jcarousel.module, line 493 - Provides integration with 3rd party modules and the jCarousel library.
Code
function jcarousel_add($options = []) {
// Add the jCarousel library and any global settings.
$attachments['library'][] = 'jcarousel/jcarousel';
$attachments['library'][] = 'jcarousel/jcarousel.swipe';
$attachments['library'][] = 'jcarousel/drupal.jcarousel';
$options += [
'skin' => 'default',
];
// Allow other modules to modify these settings.
\Drupal::moduleHandler()
->alter('jcarousel_options', $options);
$attachments['library'][] = 'jcarousel/skin.' . $options['skin'];
return $attachments;
}