silverstripe-gallery 

silverstripe-gallery Git Source Tree

Root/README.md

1Silverstripe Image Gallery
2==========================
3
4Adds an image gallery to your silverstripe website.
5
6## Author
7This module was created by [i-lateral](http://www.i-lateral.com).
8
9Although this module can be extended with your own templates / JavaScript,
10the default makes use of:
11
12The CoffeeScriper and his [JavaScript adgallery](http://coffeescripter.com/code/ad-gallery).
13
14## Installation
15Install this module either by downloading and adding to:
16
17[silverstripe-root]/gallery
18
19Then run: http://yoursiteurl.com/dev/build/
20
21Or alternativly add to your projects composer.json
22
23## Usage
24Once installed, you can add a gallery to your site by creating a
25"gallery page" from within the CMS.
26
27Under the gallery tab, you can then upload as many images as needed.
28
29## Changing the width and height of images
30If you wish to change the width and height of the gallery images loaded, you can
31do this using the Gallery Config object (in you _config, or controller).
32
33Gallery config has a static method called setDimensions() to do this.
34
35For example, if you wanted to set your gallery to be 900px wide by 300px high,
36in your _config.php file use:
37
38 GalleryConfig::setDimensions(900,300);
39
40You can also use standard SS config to set GalleryConfig's statics, eg:
41
42 GalleryConfig::config()->width = 900;
43
44## Available configuration options
45These are the config options that can be set through GalleryConfig
46
47**width** (default: 800): Width in PX of gallery images
48**height** (default: 400): Height in PX of gallery images
49**thumb_width** (default: 150): Width in PX of thumbnail images
50**thumb_height** (default: 100): Height in PX of thumbnail images
51**resize_type** (default: crop): Type of resize to use on images, this can be:
52* crop: Crop image to exact size
53* pad: Pad image to size and add whitespace
54* ratio: Perform a ratio resize of images
55
56## Changing the gallery JS
57By default, the galllery plugin uses [jQuery Ad Gallery](http://coffeescripter.com/code/ad-gallery)
58To set itself up, it calls the ss_galleries jquery plugin (gallery/javascript/ss_galleries.js).
59
60If you want to switch out this behaviour, you can remove the default ss_galleries
61file and replace it with your own (in your controller or template).

Archive Download this file