TYPO3新闻-如何以默认语言和覆盖语言显示不同的媒体文件 [英] TYPO3 news - How to show different media files in default language and overlay language

查看:106
本文介绍了TYPO3新闻-如何以默认语言和覆盖语言显示不同的媒体文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在流畅的模板中使用以下语法在新闻中呈现媒体文件:

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?

推荐答案

我的同事上次遇到相同的问题,他最终使用了该扩展名: https://packagist.org/packages/stefanfroemken/repair_translation

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.

顺便说一句,您无需使用vhs扩展名即可获取图像.更好的方式是这样做:

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>

这篇关于TYPO3新闻-如何以默认语言和覆盖语言显示不同的媒体文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆