Skip to content

Commit fc1274a

Browse files
author
pali ondras
committed
Readme update
1 parent 4fd44cb commit fc1274a

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# all these files should have unix line endings
2+
* text eol=lf

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.project
2+
~
3+
.idea

README.md

+41-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
1-
maximages
2-
=========
1+
# maximages
2+
Images for any data object
33

4-
Simple image gallery for any dataobject
4+
## Installation
5+
```bash
6+
composer require "webmaxsk/maximages:*"
7+
```
8+
9+
You can add images to any Page via CMS. You can disable images for any Page subclass by adding config to mysite/_config.php:
10+
```php
11+
Blog::config()->allow_images = false;
12+
Calendar::config()->allow_images = false;
13+
CalendarEvent::config()->allow_images = false;
14+
ErrorPage::config()->allow_images = false;
15+
RedirectorPage::config()->allow_images = false;
16+
UserDefinedForm::config()->allow_images = false;
17+
VirtualPage::config()->allow_images = false;
18+
```
19+
20+
You can add images to any DataObject too, just extend DataObject with ObjectImagesExtension.
21+
22+
## Usage
23+
Add images to your template
24+
25+
```html
26+
<% if SortedImages %>
27+
<ul class="small-block-grid-3">
28+
<% loop SortedImages %>
29+
<li>
30+
<a href="$Link" title="$Title">
31+
$CroppedImage(200,200)
32+
</a>
33+
</li>
34+
<% end_loop %>
35+
</ul>
36+
<% end_if %>
37+
```
38+
39+
Add any lightbox you like, it is not included in this module!
40+
41+
## Example usage
42+
check https://github.com/Webmaxsk/silverstripe-intranet-plate

0 commit comments

Comments
 (0)