Taitava\SlickCarousel\Carousel
Synopsis
class Carousel
{
- // members
- private static integer $cms_slides_per_page = 50;
- private static string $image_placement = 'background';
- private static boolean $use_image_dimensions = false;
- private static array $slick_options = ;
- // methods
- public static void Requirements()
- public static bool UseImageWidth()
- public static bool UseImageHeight()
- private static string options2js()
- private static void validate_options()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
private
-
$cms_slides_per_page
How many slides to list in a single page in the Carousel tab in the CMS. -
$image_placement
Where to place the slide's image inside the carousel slide <div> element: - 'background': the image will be used as the <div>'s background-image. -
$slick_options
Options to pass to the Slick jQuery plugin during initialization. With these you can greatly affect the behaviour of the carousel in the frontend. -
$use_image_dimensions
Whether or not to set the slide <div> element's width and/or height to be the same as the image's width and/or height. Can be useful when $image_placement is 'background' and you are not using constant dimensions that you define in your CSS. Possible values: - false - 'width-only' - 'height-only' - true (both width and height)
Methods
private
- options2js() — Exports Slim specific settings from YAML to JavaScript so that they can be easily used when initialising Slick.
- validate_options() — Just checks that the Slick configuration options in YAML is listed in a correct format without preceding dashes in option lines. Otherwise the options would render as nested arrays inside the settings array, which would render the options useless. Perhaps not very much needed check, but as I made this mistake once, I don't want to make it again without getting any notifications! :)
public
- Requirements()
- UseImageHeight() — Tells whether the slide's image's height should be injected to the slide <div>'s HTML style attribute.
- UseImageWidth() — Tells whether the slide's image's width should be injected to the slide <div>'s HTML style attribute.