image

Image

Form tools provide a variety of powerful image manipulation options.

Image field types need to be used in conjunction with a string data type. Formtools expects to store the path to the media asset in the database field.

Attribute

Description

Default Value

ftStyle

Inline style attributes.

(blank)

ftDestination

Location of image; relative to the web root.

/images

ftImageWidth

Width to resize image to.

(blank)

ftImageHeight

Height to resize image to.

(blank)

ftThumbnail

Boolean toggle to pad out the image to the required width/height.

false

ftThumbnailBGColor

Is this replaced by ftPadColor?? Background colour for thumbnail padding. Colour name or web hexadecimal colour code.

white

ftPadColor

Background colour for thumbnail padding. Colour name or web hexadecimal colour code with double ## prefix.

white

ftThumbnailBevel

Apply bevel edge to the thumbnail.

false

ftAutoGenerateType

Options for autogenerating the image.

FitInside or Pad

ftCreateFromSourceDefault

Generate image from source image. Requires ftSourceField to be specified.

false

ftSourceField

Image property from which an autogenerated image should be derived.

A nominated content type property.

ftAllowUpload

Boolean to allow an image to be uploaded for this image. Only relevant if the image can be autogenerated.

Default; true.

Combining Image Properties

You can tie image properties together for generating images of specific dimensions from a source image. A typical example is providing a thumbnail image.

Creating a Thumbnnail from a Source Image
<cfproperty name="imgMugshot" type="string" hint="Mugshot." required="false" default="" 
    ftlabel="Mugshot" fttype="image" ftimagewidth="200" ftdestination="/images/myprofile/imgmugshot" />
<cfproperty name="imgMugshotThumb" type="string" hint="Mugshot thumbnail." required="false" default="" 
    ftlabel="Mugshot Thumb" fttype="image" ftimagewidth="80" ftimageheight="80" ftthumbnail="true" 
    ftCreateFromSourceDefault="true" ftSourceField="imgMugshot" ftdestination="/images/myprofile/imgmugshotthumb" />

Setting Default Date Values

Often you want to designate a default date value that is dynamic and based on the current date or some other environment variable. The simplest approach is to set an ftDefault variable and ftdefaulttype set to evaluate.

Dynamically Setting a Default Date Value
<cfproperty 
  ftseq="12" ftfieldset="Publishing Details" ftwizardStep="General Details" 
  name="expiryDate" type="date" hint="The date that a news object is removed from the web site" required="no" default="" 
  ftDefaultType="Evaluate" ftDefault="DateAdd('d', 5, now())" ftType="datetime" 
  ftDateFormatMask="dd mmm yyyy" ftTimeFormatMask="hh:mm tt" ftToggleOffDateTime="true" ftlabel="Expiry Date" />

default corresponds to the default set in the database. Its a data type default.
ftdefault on the other hand is a formtool default. That is, it relates to the UI control.