...
A simple example of how the Third Light browser can be used is included in your Third Light IMS site - visit httphttps://your-ims-site/cmsbrowser.tlx
...
The cropChosen
event has associated details of the file selected. The callback function is passed an object containing keys as follows:
Key | Description |
---|---|
| The IMS File reference of the selected image |
| The width in pixels of the selected image |
| The height in pixels of the selected image |
| The version number of the selected image |
| A hash of details describing the selected crop area |
| The key of the crop class selected (as provided to |
| A hash containing details of the URL to the selected file (only present when |
| A hash of metadata for the selected file |
Within these, subkeys are defined as follows
Sub-key | Description |
---|---|
| Alias of |
| Width in pixels of the chosen output |
| Height in pixels of the chosen output |
| The x-coordinate of the top-left of the chosen crop area (in pixels) |
| The y-coordinate of the top-left of the chosen crop area (in pixels) |
| The width of the chosen crop area (in pixels, measured on the original file) |
| The height of the chosen crop area (in pixels, measured on the original file) |
| A URL to the output file |
| The width of the output file (in pixels) |
| The height of the output file (in pixels) |
Supported Options
The CMS browser is usually launched via the IMS.IframeAppOverlay
. That wrapper takes arguments as follows:
...
The CMS browser supports options as follows:
Key | Description |
---|---|
| IMS URL to browse - defaults to the same as that passed to the |
| A string referring to the theme to load. Currently supported options are "light", "dark" and "blue" |
| An array of hashes defining the output formats to present |
| Boolean, whether to enable the display of metadata in the CMS browser (Off by default) |
| An optional array of metadata fields to include; defaults to all |
| An optional array of hashes, describing an order and content of metadata panels to display. Defaults to the IMS configuration |
| Boolean, whether to display revisions other than the currently active one. (Off by default) |
| Boolean, whether to return a URL to the requested output file. Requires that Secure File Fetch be enabled in the IMS site, and that the user has permission to publish files. (Off by default) |
| Boolean, whether to close the widget when the selection is made. Otherwise a final page is displayed containing pertinent details. (On be default) |
| An optional session ID to use (rather than prompting the user to log in, or using their existing IMS session). This is useful in conjunction with server-side API-key session set up to allow auto-login |
| Boolean, whether to suppress the 'Close' button on the widget. (Off by default) |
showUnsuitableThumbnails | Boolean, denoting whether to show thumbnails that are unsuitable for any of the available crop classes when browsing. (Off by default) |
showUnsuitableCropClasses | Boolean, denoting whether to show unsuitable crop classes in the crop class drop-down when cropping an image. (Off by default) |
cropSnap | Integer denoting the closeness in relative pixels of a padded image to the crop border that will force a snapping of the image to that border. (30 by default, 0 will disable it) |
Defining Crop Classes
The cropClasses
key in the options hash contains an array of hashes. Each hash contains keys as follows
Key | Description |
---|---|
| An identifier for the class. This must be unique across the array. It is not presented to the user, but is provided to the |
| A label for the class. This is the name displayed to the user of the CMS browser |
| The width (in pixels) for the class |
| The height (in pixels) for the class |
| The output format that you want the image to be ("JPG", "PNG", "GIF", "TIF", or "WEB"). "WEB" is a special choice that will maintain the current image type if it is a GIF, JPG or PNG, or else convert it to a PNG |
usePadding | Denotes whether padding is allowed to exist around the image for this crop class |
Configuring metadata
When the metadata
option is on, the CMS browser offers metadata to users. Without any further configuration, this displays the fields (and panels) configured in IMS (see Editing Metadata Fields for more information), restricted by user settings if the Multi-tenant Metadata feature is enabled.
...