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

别等时光非礼了梦想. 提交于 2019-12-12 10:23:12

问题


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?


回答1:


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>



回答2:


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.



来源:https://stackoverflow.com/questions/51098858/typo3-news-how-to-show-different-media-files-in-default-language-and-overlay-l

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!