Displaying Content with Binary & Image Fields - Documentation topics on: displaying content with binary & image fields,displaying thumbnail images,display resized images,velocity,.

Displaying Content with Binary & Image Fields

dotCMS provides two types of images on a content type: binary or image.
The binary image object has some helper methods to get the thumbnail, raw and resize exporters:

Consider the following example which shows how to display binary images and image fields while iterating in Velocity over the following content type.

#foreach($content in $dotcontent.pull("+contentType:ImageTest",10,"modDate desc"))
$content.title
Binary: /contentAsset/image/$content.identifier/binaryImage/filter/Resize/resize_w/500
BINARY IMAGE RAW URI: $content.binaryImage.rawUri
BINARY IMAGE: $content.binaryImage
BINARY IMAGE RESIZE URI WITH PARAMETERS: $content.binaryImage.getResizeUri(100, 100)
BINARY IMAGE RESIZE URI WITHOUT PARAMETERS: $content.binaryImage.resizeUri
BINARY IMAGE THUMBNAIL URI WITH PARAMETERS: $content.binaryImage.getThumbnailUri(100, 100,"255255255")
BINARY IMAGE THUMBNAIL URI WITHOUT PARAMETERS: $content.binaryImage.thumbnailUri
Image Field: /contentAsset/image/$content.imageField.map.identifier/fileAsset/filter/Resize/resize_w/500
#end