RenderMediaViewHelper

ViewHelper to render media from any content

Type: Basic

General properties

Name:

Type:

Description:

Default value:

news (required)

Tx_News_Domain_Model_News

The news post

 

imgClass

string

Add css class to images.

 

videoClass

string

Wrap videos in a div with this css class.

 

audioClass

string

Wrap audio files in a div with this css class

 

fileIndex

integer

index of image to start with

cropVariant

string

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

default

Examples

Basic usage

Use [media] in the RTE fields of a news. In Fluid tempate wrap rendering of text fields with the VieHelper.

Backend:

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.

[media]

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

[media]

Lorem    ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Copied!

Code:

<n:renderMedia news="{newsItem}" imgClass="img-responsive" videoClass="video-wrapper" audioClass="audio-wrapper">
   <div class="news-text-wrap" itemprop="articleBody">
      <f:format.html>{newsItem.bodytext}</f:format.html>
   </div>
</n:renderMedia>
Copied!

Output:

Media tags in RTE of the text are replaced with images.
Copied!