Ralf
Ralf

Reputation: 65

TYPO3 news - How to show different media files in default language and overlay language

I use the following syntax in my fluid template to render the media files in news:

<f:for each="{v:content.resources.fal(field: 'fal_media',table:'tx_news_domain_model_news',uid:'{newsItem.uid}')}" as="singleImage">
  <div style="background-image: url({singleImage.url})" class="teaser__image"></div>
</f:for>

German is my default language, English the overlay language. In the English news I have implemented a different media image, but only the German (default) image is shown. How can I render the English media image?

Upvotes: 1

Views: 1017

Answers (2)

Jonas Eberle
Jonas Eberle

Reputation: 2921

The translation of relations pointing to translated objects in TYPO3 is buggy. This is the bugtracker entry: https://forge.typo3.org/issues/57272 . It is obviously hard to fix for every edge case but the extension mentioned by mrf fixes it for sys_file_references which is the case you are hitting.

Upvotes: 0

mrf
mrf

Reputation: 546

My colleague had the same problem last time and he ended up using this extension: https://packagist.org/packages/stefanfroemken/repair_translation

I'm not sure if there is a better solution at the moment.

By the way, you do not need to use vhs extension to get the images. Better would be to do that in this way:

<f:for each="{newsItem.media}" as="mediaElement">
    <div style="background-image: url({f:uri.image(image:mediaElement)})" class="teaser__image"></div>
</f:for>

Upvotes: 2

Related Questions