webmaxsk/maximages

Simple image gallery for any dataobject

Installs: 922

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 2

Open Issues: 0

Type:silverstripe-vendormodule

dev-master 2018-06-28 09:12 UTC

This package is auto-updated.

Last update: 2024-03-27 02:18:18 UTC


README

Images for any data object

Installation

composer require "webmaxsk/maximages:*"

You can add images to any Page via CMS. You can disable images for any Page subclass by adding config to _config/config.yml:

SilverStripe\ErrorPage\ErrorPage:
  images:
    enabled: false
SilverStripe\CMS\Model\VirtualPage:
  images:
    enabled: false
SilverStripe\CMS\Model\RedirectorPage:
  images:
    enabled: false

The maximum number of images can be also specified in the config using the following syntax (default is 20 for a page):

SilverStripe\Blog\Model\BlogPost:
  images:
    count: 50

You can add images to any DataObject too, just extend DataObject with ObjectImagesExtension.

Usage

Add images to your template

<% if SortedImages %>
	<ul class="small-block-grid-3">
	    <% loop SortedImages %>
	        <li>
	            <a href="$Link" title="$Title">
	               $CroppedImage(200,200)
	            </a>
	        </li>
	    <% end_loop %>
	</ul>
<% end_if %>

Add any lightbox you like, it is not included in this module!

Example usage

check https://github.com/Webmaxsk/silverstripe-intranet-plate