Skip to content
  1. Extras
  2. ResVideoGallery
  3. Snippets
  4. ResVideoGallery

ResVideoGallery

Snippet for outputting video on a page.

Parameters

ParameterDefaultDescription
autoPlay1Start video playback automatically.
parentsComma-separated list of parent IDs for the search. By default the search is limited to the current parent. Use 0 for no limit.
resourcesCurrent resource IDComma-separated list of resource IDs to include. If an ID is prefixed with a minus sign, that resource is excluded.
showInactive0Include inactive video.
limit12Number of videos to output. Use 0 for no limit.
offset0Number of results to skip from the start.
sortbyrankSort field.
sortdirDESCSort direction.
whereJSON string for the SQL WHERE clause. Example: &where={"template":15} (no TV).
tagsComma-separated list of tags; only video that has these tags is included.
getTags0Make extra queries to load tags?
tagsVartagIf set, the snippet reads the "tags" value from $_REQUEST["name"]. E.g. if you set "tag", the snippet only outputs files matching $_REQUEST["tag"].
photoGalleryInclude photo gallery files with the video. One of: ms2Images or ms2Gallery (miniShop2 gallery or MS2Gallery).
primarilyvideoOutput priority: video or photo.
thumbsmallThumbnail size name for the photo gallery. From the file source thumbnails option.
ajaxModebuttonAJAX pagination mode: button or scroll.
plPrefixPlaceholder prefix.
tplresVideoGalleryTplFenom chunk for the whole gallery.
tplRowresVideoGalleryRowTplFenom chunk for one gallery item.
tplEmbedresVideoGalleryEmbedTplFenom chunk for the video player code.
css{+assets_url}css/web/default.cssPath to custom styles, or clear and load them manually in the site template.
js{+assets_url}js/web/default.jsPath to custom scripts, or clear and load them manually in the site template.

Video preview size

Previews are generated via phpThumb. You can set its parameters in the component settings; the default is:

json
{"w":640,"h":390,"q":90,"zc":"1","f":"jpg","bg":"000000"}

ResVideoGallery with Ajax load on button click for resource ID 5

modx
[[!ResVideoGallery?
  &limit=`3`
  &resources=`5`
]]

ResVideoGallery with Ajax load on scroll for resource ID 5

modx
[[!ResVideoGallery?
  &limit=`3`
  &resources=`5`
  &ajaxMode=`scroll`
]]

ResVideoGallery via pdoPage for pagination for resource ID 5

modx
[[!pdoPage?
  &element=`ResVideoGallery`
  &ajaxMode=`default`
  &limit=`4`
  &resources=`5`
]]

[[!+page.nav]]

ResVideoGallery with miniShop2 photo gallery (video and photos together)

modx
[[!ResVideoGallery?
  &limit=`3`
  &resources=`5`
  &photoGallery=`ms2Images`
]]