EvGallery Plugin
================

Authors: Stewart Doxey (@MrStu84)


Introduction
------------

A simple composer plugin for adding an image gallery to a CakePHP site.


Installation
------------

To install, run the following command in the www/app directory with composer:-

	composer require evoluted/gallery

To setup the database use the CakeDC Migrations plugin. To run the migrations and setup the database run:-

	Console/cake Migrations.migration run all --plugin EvGallery

Add the following to the plugin load array in 'app/Config/bootstrap.php':-

	'EvGallery' => array(
		'bootstrap' => true,
		'routes' => true
	)

You will want to add an item to the admin menu for managing galleries:-

* /admin/ev_gallery/galleries/

To setup/override the plugin's default config create a new config file 'app/Config/Plugin/ev_gallery.php'.

The following options are available:-

* dimensions		- a collection of arrays to define the 'main' and 'thumbnail' image dimensions.
					  Please see the config_example.php file for an example.

* pageId			- specify the page id used to show content above the image gallery

* showThunbs		- boolean to state whether thumbail images are to be used with the image gallery


Using EvGallery
---------------

EvGallery needs a small amount of setup to get working, but should be relatively simple.

The cycling of images is handle by the jQuery plugin bxSlider, examples and options can be found at,
http://bxslider.com/examples and http://bxslider.com/options

Initilisation

A default setup and initilisation of the bxSlider plugin can be found in the plugins js directory
within the webroot - it is highly advised that you overwrite this in your apps js directory

Image Thumbnails

Out of the box, EvGallery will creating paging bullet points, these can be overridden to image thumbnails
by creating a div element with class '.ev-gallery__bxslider__thumbs'. The div element should then contain an a element for each image
thumbnail with href='' and data attribute 'data-slide-index'. More information can be found on the bxSlider website:
 - http://bxslider.com/examples/thumbnail-pager-1

Image Paging
You are able to assign custom paging links by styling the 'ev-gallery__bxslider__controls__next' and 'ev-gallery__bxslider__controls__prev'
css classes. As default, these will not display so add them within your template as required - this can be outside of the bxSlider container

Image Captions

More information on how to assign image captions can be found of the bxSlider website:
 - http://bxslider.com/examples/image-slideshow-captions


Extending Plugin
----------------

Don't be bloody lazy, and do things properly. Please don't edit the plugin directly but override it from within your own app.

For example,
* you can override the view templates by creating new views in '/app/View/Plugin/EvGallery/'
* you can override the gallery controller by creating '/app/Controller/EvGalleryGalleryController.php', and extending accordingly