Skip to content
Snippets Groups Projects

PM Carousel

The PM-Carousel module provides a custom field formatter to display entity reference fields as carousels using PM-Carousel JS library.

PM-Carousel, for "Pimp My Carousel" is a pretty small, accessible and vanilla JavaScript to manage your carousels. It has no dependencies!

Table of contents


Requirements

This module requires no additional modules.


Installation

  1. Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.
  2. Download PM-Carousel JS library pm-carousel library
  3. Copy pm-carousel.umd.js file in the /libraries/pm-carousel/dist/ folder of your site

Configuration

  1. Enable the module at Administration > Extend.
  2. Navigate to the "Manage Display" tab of the desired entity reference field.
  3. Select PM Carousel container as the formatter for the field.
  4. Configure the formatter settings
  5. Save and view your content to see the carousel in action.

YAML configuration example

default:
    loop: false
    group: 1
    spaceAround: 0
    noStartSpace: true
    autoplay: 0
responsive:
    - { minWidth: 1024px, disable: false }
    - { minWidth: '0', disable: true }