Package

ViewHelpers

ViewHelper Documentation

image

Resizes a given image (if required) and renders the respective img tag

= Examples =

<f:image src="EXT:myext/Resources/Public/typo3_logo.png" alt="alt text" /> alt text or (in BE mode): alt text

<f:image image="{imageObject}" /> alt set in image record

{f:image(src: 'EXT:viewhelpertest/Resources/Public/typo3_logo.png', alt: 'alt text', minWidth: 30, maxWidth: 40)} alt text (depending on your TYPO3s encryption key)

<f:image src="fileadmin/user_upload/example.pdf" alt="foo" /> If your graphics processing library is set up correctly then it will output a thumbnail of the first page of your PDF document. foo

<f:image src="NonExistingImage.png" alt="foo" /> Could not get image resource for "NonExistingImage.png".

Arguments

additionalAttributes anySimpleType, required

Additional tag attributes. They will be added directly to the resulting HTML tag.

data anySimpleType, required

Additional data-* attributes. They will each be added with a "data-" prefix.

class string, required

CSS class(es) for this element

dir string, required

Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id string, required

Unique (in this file) identifier for this HTML element.

lang string, required

Language for this element. Use short names specified in RFC 1766

style string, required

Individual CSS styles for this element

title string, required

Tooltip text of element

accesskey string, required

Keyboard shortcut to access this element

tabindex integer, required

Specifies the tab order of this element

onclick string, required

JavaScript evaluated for the onclick event

alt string, required

Specifies an alternate text for an image

ismap string, required

Specifies an image as a server-side image-map. Rarely used. Look at usemap instead

longdesc string, required

Specifies the URL to a document that contains a long description of an image

usemap string, required

Specifies an image as a client-side image-map

src string, required

a path to a file, a combined FAL identifier or an uid (int). If $treatIdAsReference is set, the integer is considered the uid of the sys_file_reference record. If you already got a FAL object, consider using the $image parameter instead

treatIdAsReference anySimpleType, required

given src argument is a sys_file_reference record

image anySimpleType, required

a FAL object

crop anySimpleType, required

overrule cropping of image (setting to FALSE disables the cropping set in FileReference)

cropVariant string, required

select a cropping variant, in case multiple croppings have been specified or stored in FileReference

width string, required

width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

height string, required

height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

minWidth anySimpleType, required

minimum width of the image

minHeight anySimpleType, required

minimum width of the image

maxWidth anySimpleType, required

minimum width of the image

maxHeight anySimpleType, required

minimum width of the image

absolute anySimpleType, required

Force absolute URL

ViewHelper Resources

Schema Resources