user500665
user500665

Reputation: 1374

tx_news get fluid image src to use for background image

In the tx_news plugin list partial, I want to change the image it generates into a background image.

<f:image image="{mediaElement}" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}"/>

How to I get the src of the image so I can put it into an inline style?

Upvotes: 0

Views: 1796

Answers (2)

Kevin Appelt
Kevin Appelt

Reputation: 892

You can simply use the f:uri.image Viewhelper and use the same attributes. Your code will look like this: {f:uri.image(image:mediaElement,title:'{mediaElement.originalResource.title}',alt:'{mediaElement.originalResource.alternative}', maxWidth:'{settings.list.media.image.maxWidth}',maxHeight:'{settings.list.media.image.maxHeight}')}

Upvotes: 1

minifranske
minifranske

Reputation: 1315

Use the URI viewhelper

{f:uri.image(image: mediaElement)}

Upvotes: 2

Related Questions