Skip to content
  1. Extras
  2. miniShop2
  3. Snippets
  4. msGallery

msGallery

Snippet for outputting the product gallery.

Parameters

ParameterDefaultDescription
tpltpl.msGalleryOutput chunk
productProduct id. If not set, uses the current resource id.
limit0Maximum number of results
offset0Number of results to skip
sortbyrankSort field
sortdirASCSort direction
toPlaceholderIf set, snippet stores data in a placeholder with this name instead of outputting.
whereJSON-encoded string with extra conditions.
filetypeFile types to select. Use "image" for images and extensions for others, e.g. "image,pdf,xls,doc".
returntplOutput format. tpl — render through chunk, json — return JSON data.
showLogfalseShow 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.