Image+
Last edited by Alan Pich on Oct 21, 2013.
This documentation refers to the depreciated Image+ v2.1 package. Full documentation for v3.0+ is available here.
What is Image+?
Image+ is an extension to the native MODx Image TV type. It provides an image cropping function when selecting images via a resource TV interface. Developers can specify either/both with & height constraints and the editor will ensure that the chosen crop of the image satisfies these dimensions. The output renderer allows for either raw URL output, or the use of a chunk for formatting, allowing you to make use of the Alt-Tag/Image title field to add alt-tags to your images from within the TV.
Requirements
- MODx Revolution 2.2.x or later
- PHP5 or later
- phpThumbOf extension
History & Info
Image+ was written by Alan Pich in early 2012. Version 1.x proved too buggy for general use so the component was completely re-written for version 2.0 which was released at the end of November, 2012.
Download
It can be downloaded from within the MODx Revolution manager via Package Management, or from the MODx Extras Repository, available here: http://modx.com/extras/package/imageplustvinputhttp://modx.com/extras/package/imageplustvinput
Development & Bug Reporting
Image+ is stored and developed in GitHub, and can be found here: https://github.com/alanpich/tvImagePlus
Usage
Image+ consists of two components; A custom TV Input type, and an Output type (both conveniently called Image+). Both need to be selected for a TV to work properly. Several options can be configured on the Template Variable to customize the output of the TV.
Input Options
When Image+ is selected as an Input type for a TV, the following options become available:
Field | Description |
---|---|
Target Width | Optional width constraint for output image. If set, TV output image will be exactly this width. Can be used in conjunction with Target Height field to constrain image dimensions. |
Target Height | Optional height constraint for output image. If set, TV output image will be exactly this height. Can be used in conjunction with Target Width field to constrain image dimensions. |
Alt tag field | If set to 'Yes', an additional field will become available when editing the TV for a resource. This field can be used for supplying a title or alt-tag for the image. Used in conjunction with output chunks (see Output Options below). |
Output Options
Configuring the output options is completely optional, but allows for some extra refinement to the images as they are generated. Currently available options are:
Field | Description |
---|---|
Additional phpThumb params | Allows entering additional parameters to pass to phpThumb when generating the image. See here for details. Should be in url parameter format (fltr[]=abc&zc=1...) |
Output Chunk | If left blank, the TV will output a raw URL to the prepared image. You can also specify the name of a chunk to use to format output. Details of available placeholders can be found below. |
Output Chunk
Optionally selecting an Output Chunk allows you access to other placeholders to better customise the TV's output. Placeholders available are:
Placeholder | Description |
---|---|
[[+url]] |
Url of image. This is the default output when an Output Chunk is not specified. |
[[+width]] |
Width of output image (if specified in Input Options) |
[[+height]] |
Height of output image (if specified in Input Options) |
[[+alt]] |
Alt tag field text (if specified in Input Options) |
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).