sktzoootech/cycle-carousel

Cycle Carousel is a simple SilverStripe module. The modules uses Cycle2 JQuery Plugin by malsup.

Installs: 43

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 3

Open Issues: 5

Language:JavaScript

Type:silverstripe-module

dev-master 2015-01-18 20:18 UTC

This package is not auto-updated.

Last update: 2024-03-26 03:37:04 UTC


README

Cycle Carousel Silverstripe Module
==================================

## Introduction

This module is a simple carousel module that uses Cycle2 JQuery plugin by malsup.
To know more about the Cycle2

## Installation

After downloading, copy this module to your project folder and do a /dev/build?flush=all.

You can also use composer to add this module to your project using the following:

composer require "skTzoooTech/cycle-carousel:*"

But before adding the above module make sure you add sktzoootech/link-field and other modules (Please see composer.json for all dependecy):

composer require "skTzoooTech/link-field:*"

composer require "ajshort/silverstripe-gridfieldextensions:*"

composer require "undefinedoffset/sortablegridfield:*"

## How to use the module

The module requires JQuery so you need to add jquery to your Page_Controller class.  
Make sure JQuery isn't added by any other module or else it might not work properly. 
To add jquery to your Page_Controller class, add the following to the init method (see example below) :

```php

	public function init() {
		parent::init();
		
    Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.min.js');
    
  }

```

You can display the carousel to any of your templates.  For example if you want to add the carousel to
your Layout/Page.ss file, add the following to the template:

```php

  $CycleCarouselObject

```
There are heaps of configuration you can apply to the carousel.  All can be set in the template by putting specific
"data-cycle" value. If you wish to customize the template, copy the CarouselTemplate.ss file to your themes template/Include folder.
Follow the documentation found in malsups website