
msGallery
Snippet for outputting the product gallery.
Parameters
| Parameter | Default | Description |
|---|---|---|
| tpl | tpl.msGallery | Output chunk |
| product | Product id. If not set, uses the current resource id. | |
| limit | 0 | Maximum number of results |
| offset | 0 | Number of results to skip |
| sortby | rank | Sort field |
| sortdir | ASC | Sort direction |
| toPlaceholder | If set, snippet stores data in a placeholder with this name instead of outputting. | |
| where | JSON-encoded string with extra conditions. | |
| filetype | File types to select. Use "image" for images and extensions for others, e.g. "image,pdf,xls,doc". | |
| return | tpl | Output format. tpl — render through chunk, json — return JSON data. |
| showLog | false | Show extra snippet debug info. Only for users logged in to context "mgr". |
Подсказка
You can also use other general pdoTools parameters.
Output
The snippet works with a Fenom chunk and passes a single variable $files (array of files).
To see all gallery placeholders, use an empty chunk:
modx
<pre>[[!msGallery?tpl=``]]</pre>The gallery uses Fotorama. You can pass options in the chunk per the docs.
Scripts load only if the chunk contains .fotorama inside #msGallery and it has files.
To disable Fotorama, remove the .fotorama class from the chunk.


