class ThumbnailViewHelper extends AbstractTagBasedViewHelper (View source)

Renders an HTML tag from a given Neos.Media's asset instance

= Examples =

<output>
(depending on the asset, no scaling applied)
<img src="_Resources/Persistent/b29[...]95d.jpeg" width="120" height="180" alt="a sample asset without scaling" />
</output>

<code title="Rendering an asset thumbnail with scaling at a given width only">
<neos.media:thumbnail asset="{assetObject}" maximumWidth="80" alt="sample" />
(depending on the asset; scaled down to a maximum width of 80 pixels, keeping the aspect ratio) sample

<output>
(depending on the asset; scaled down to a maximum width and height of 80 pixels, keeping the aspect ratio)
<img src="_Resources/Persistent/b29[...]95d.jpeg" width="53" height="80" alt="sample" />
</output>

<code title="Rendering an asset thumbnail with crop-scaling at given width and height">
<neos.media:thumbnail asset="{assetObject}" maximumWidth="80" maximumHeight="80" allowCropping="true" alt="sample" />
(depending on the asset; scaled down to a width and height of 80 pixels, possibly changing aspect ratio) sample


<output>
(depending on the asset; scaled up or down to a width 5000 pixels, keeping aspect ratio)
<img src="_Resources/Persistent/b29[...]95d.jpeg" width="80" height="80" alt="sample" />
</output>

Properties

protected ResourceManager $resourceManager
protected ThumbnailService $thumbnailService
protected AssetService $assetService
protected string $tagName

name of the tag to be created by this view helper

Methods

void
initializeArguments()

No description

string
render()

Renders an HTML img tag with a thumbnail image, created from a given asset.

Details

void initializeArguments()

No description

Return Value

void

Exceptions

Exception

string render()

Renders an HTML img tag with a thumbnail image, created from a given asset.

Return Value

string

an html tag

Exceptions

AssetServiceException
MissingActionNameException
ThumbnailServiceException