2017 © Pedro Peláez
 

silverstripe-module silverstripe-carousel

A new page type that provides a carousel with easily reorderable items and custom HTML captions

image

entidi/silverstripe-carousel

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  • Thursday, June 9, 2016
  • by ntd
  • Repository
  • 2 Watchers
  • 2 Stars
  • 421 Installations
  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 3 Forks
  • 0 Open issues
  • 15 Versions
  • 1 % Grown

The README.md

Silverstripe Carousel

Code Quality Latest Stable Version, (*1)

It implements a new page type (_CarouselPage_) that provides everything needed to manage a carousel of images. Differently from other carousels, this one does not have the concept of seats (or slots), so managing the images is much easier on the backend side., (*2)

You can do bulk uploads and reorder the images by dragging and dropping their thumbnails in a dedicated tab (_Image list_) inside the CMS. The same image can be shared among multiple carousels. This module adds also some field to the Settings tab, allowing the customization of some aspect of the carousel on a per page basis (e.g., width and height of the images and a flag to show or hide captions). Support for the translatable module is provided out of the box, i.e. when creating a translation, the new page will borrow the original carousel images., (*3)

To improve file organization, if you upload your images from the carousel a specific folder is pre-selected (it it exists!) instead of the fallback one (Uploads). The folder name depends on the class hierarchy. If, for example, you inherit your HomePage type from CarouselPage, the code will look for any Home or Carousel folder (in this order) under your assets directory., (*4)

Installation

The feature of reordering with drag and drop is provided by the sortablefile module that must be installed before., (*5)

To install silverstripe-carousel itself you should proceed as usual: drop the directory tree in your SilverStripe root and do a /dev/build/. You will gain the new CarouselPage type in the CMS., (*6)

If you use composer, the dependencies will be pulled-in automatically, so you could just run the following command:, (*7)

composer require entidi/silverstripe-carousel

Usage

This module is front end agnostic, that is you can use the javascript library you prefer by writing a proper template., (*8)

Out of the box there are a couple of templates inside Includes that implement a Bootstrap (ContentCarousel_bootstrap.ss) or a bxSlider (ContentCarousel_bxslider.ss) carousel., (*9)

You can include one of them in any place inside your page template, e.g. a basic Bootstrap layout template could look like this one:, (*10)

<%-- Layout/CarouselPage.ss --%>
<div class="page-header">
    <h1>$Title</h1>
</div>
<% include ContentCarousel_bootstrap.ss %>
<div class="row typography">
    $Content
</div>

<%-- Include Bootstrap 3 --%>
<% require CSS("//cdn.jsdelivr.net/bootstrap/3/css/bootstrap.min.css") %>
<script type="text/javascript" src="//cdn.jsdelivr.net/g/jquery@1,bootstrap@3"></script>

<%-- Enable the carousel --%>
<script type="text/javascript">
    \$(document).ready(function() {
        \$('#ss-carousel').carousel();
    });
</script>

The default layout (CarouselPage.ss) embeds a bxSlider carousel., (*11)

Alternatively, the silverstrap theme already supports this module out of the box. If you intend to leverage Bootstrap, consider using this theme instead, either by overriding or by modifying it., (*12)

Image captions

HTML captions are allowed. This is internally done by leveraging the Content field of the File table (typically empty). This is supposed to be an HTML chunk despite being defined as a plain text field by the SilverStripe code., (*13)

If the captions are enabled, they can be edited directly inside the Image list tab by clicking the Edit button., (*14)

When Content is not defined, an <h4> element with the image title is used instead: see templates/Includes/ImageCaption.ss for details., (*15)

Support

This project has been developed by ntd. Its home page is shared by other SilverStripe modules and themes., (*16)

To check out the code, report issues or propose enhancements, go to the dedicated tracker. Alternatively, you can do the same things by leveraging the official github repository., (*17)

The Versions

09/06 2016

dev-master

9999999-dev http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

09/06 2016

2.2.5

2.2.5.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

09/06 2016

dev-dev

dev-dev http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

19/02 2016

2.2.4

2.2.4.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

12/10 2015

2.2.3

2.2.3.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

20/08 2015

2.2.2

2.2.2.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

07/07 2015

2.2.1

2.2.1.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel bxslider silverstrap

28/06 2015

2.2.0

2.2.0.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

28/06 2015

2.1.2

2.1.2.0 http://silverstripe.entidi.com/

A new page type that provides a carousel with easily reorderable items and custom HTML captions

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

13/05 2015

2.1.1

2.1.1.0 http://silverstripe.entidi.com/

A new page type that implements a carousel

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

06/05 2015

2.1.0

2.1.0.0 http://silverstripe.entidi.com/

A new page type that implements a carousel

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

29/09 2014

2.0.0

2.0.0.0 http://silverstripe.entidi.com/

A new page type that implements a carousel

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

19/09 2014

1.0.2

1.0.2.0 http://silverstripe.entidi.com/

A new page type that implements a carousel

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

19/09 2014

1.0.1

1.0.1.0 http://silverstripe.entidi.com/

A new page type that implements a carousel

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel

19/09 2014

1.0.0

1.0.0.0 http://silverstripe.entidi.com/

A new page type that implements a carousel

  Sources   Download

BSD-2-Clause

The Requires

 

bootstrap silverstripe carousel