Package

ViewHelpers

ViewHelper Documentation

media

Render a given media file with the correct html tag.

It asks the RendererRegister for the correct Renderer class and if not found it falls back to the ImageViewHelper as that is the "Renderer" class for images in Fluid context.

= Examples =

<f:media file="{file}" width="400" height="375" />

<img alt="alt set in image record" src="fileadmin/_processed_/323223424.png" width="396" height="375" />

<f:media file="{file}" width="400" height="375" />

<video width="400" height="375" controls><source src="fileadmin/user_upload/my-video.mp4" type="video/mp4"></video>

<f:media file="{file}" width="400" height="375" additionalConfig="{loop: '1', autoplay: '1'}" />

<video width="400" height="375" controls loop><source src="fileadmin/user_upload/my-video.mp4" type="video/mp4"></video>

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

file anySimpleType, required

File

additionalConfig anySimpleType, required

This array can hold additional configuration that is passed though to the Renderer object

width string, required

This can be a numeric value representing the fixed width of 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

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

cropVariant string, required

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

ViewHelper Resources

Schema Resources