Gallery Script

Render a gallery.

Gallery.render(node, memberType, options)

Render list of images that are the targets of node/member type. Returns html.

Options are:

preview Which derivative to show in the gallery preview images. Defaults to showing the entire image.
previewWidth Width of preview. Set this and previewHeight to 0 to show the unscaled image.
previewHeight Height of preview.
previewPadding Padding around preview.
previewMargin Margin around preview.
previewBorder Border around preview.
edit Whether to show in edit mode or browse mode.
prefix Member type prefix for edit mode.
returnURL Return URL for browse mode. If not passed in, this is calculated based on the node and member type.
showActions When in browse mode, set to false to hide the action buttons. Defaults to true.
showLink When in browse mode, set to false to hide/disable the link to the full picture. Defaults to true.

In order of precedence, options used are:

  • Passed in.
  • Read from the node.
  • Read from the member type.
  • Read from the individual gallery items.
  • Defaults.
Gallery.renderItem(item, options, memberType, sequence)

Render given item (an image node), using the options. Returns HTML.

Member type and sequence are required for edit mode.

Gallery.defaultMarkup(node, height, width) For nodes that do not have previews, return suitable preview html that will fit in the given height and width.
Gallery.iconsForExtension(extension) Return appropriate icon classes for the given extension.

 

Tag List