Skip to content

Webmaxsk/maximages

Repository files navigation

maximages

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

About

Simple image gallery for any dataobject

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •