You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/03_MoreGallery/v1.x/03_Snippets/00_mgGetImages.md
+12-2
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,14 @@ The minimum mgGetImages snippet call outputs a list of thumbnails, linking to an
14
14
15
15
You should always call mgGetImages uncached, as it manages caching internally. This makes sure the images on a Gallery resource are in sync with the frontend, without relying on full site cache clears.
16
16
17
+
## Listing & single image views
18
+
19
+
The `mgGetImages` snippet by default lists images in a gallery, but it also supports a "single image view" or "detail view". When the page is requested with a `iid` URL parameter (or another parameter defined by the `&singleImageParam` snippet parameter), only the specific image is shown with the `&singleImageTpl`.
20
+
21
+
The single image view also includes previous and next images, so it can be used for a simple gallery view without any JavaScript solutions. This detail view is also used to render embed codes for videos and iframes for PDFs. The detail view can also be disabled with `&singleImageEnabled`.
22
+
23
+
The parameter for the rendering of one image in the list is `&imageTpl`, not `&singleImageTpl`.
24
+
17
25
## Snippet Properties
18
26
19
27
@@ -224,7 +232,7 @@ A string to be used between tags parsed through the chunk specified in `&tagTpl`
224
232
225
233
#### &singleImageEnabled
226
234
227
-
Set to `1` to enable the single image view, or `0` to disable it. When enabled, the snippet will automatically show a single image with a different template (see `&singleImageTpl`) if the `&singleImageParam` is present in the URL. Useful for accessible image galleries. The single image view has been available since v1.0, the singleImageEnabled property was added in v1.4.
235
+
Set to `1` to enable the single image view, or `0` to disable it. When enabled, the snippet will automatically show a single image (detail view) with a different template (see `&singleImageTpl`) if the `&singleImageParam` is present in the URL. Useful for accessible image galleries. The single image view has been available since v1.0, the singleImageEnabled property was added in v1.4.
228
236
229
237
**Default**: `1`
230
238
@@ -244,7 +252,9 @@ Added in 1.5.0.
244
252
245
253
#### &singleImageTpl
246
254
247
-
The name of a chunk to use for the single image view. See further down this page for the default and placeholders for this chunk.
255
+
The name of a chunk to use for the single image (/detail) view. See further down this page for the default and placeholders for this chunk.
256
+
257
+
**For rendering of one image in the gallery listing, see `&imageTpl` instead.**
248
258
249
259
There are also `&singleYoutubeTpl` and `&singleVimeoTpl` properties for [YouTube and Vimeo videos](../Video) respectively, and a `&singlePdfTpl` for PDFs, which both follow the same behaviour as the `&singleImageTpl`.
0 commit comments