【问题标题】:TYPO3: How to use flux:field.inline.fal image as backgroundTYPO3:如何使用flux:field.inline.fal 图像作为背景
【发布时间】:2020-11-14 11:12:19
【问题描述】:

在我的扩展模板中,我使用 field.inline.fal 视图助手:Documentation

现在我想用它作为背景图片。我试过了:

// This is the input in the configuration section
<flux:field.inline.fal name="image" required="1" maxItems="1" minItems="1"/>

//This is the output
{v:content.resources.fal(field: 'image') -> v:iterator.first() -> v:variable.set(name: 'image')}
<div class="image" style="background: url({image.id});">

由于某种原因,前端输出是:

<div class="image" style="background: url(1:/data/images/path/image.jpg);">

但应该是的

<div class="image" style="background: url(/rootfolder/data/images/path/image.jpg);">

为什么它没有按照文档中的描述显示?我做错了什么?

【问题讨论】:

    标签: typo3 flux fluid view-helpers


    【解决方案1】:

    找到了答案。 通过 {image} 我找到了提供整个路径的变量 {image.url}。

    工作代码:

      <div class="image" style="background: url(/{image.url});">
    

    【讨论】:

      猜你喜欢
      • 2012-07-16
      • 1970-01-01
      • 2021-08-18
      • 2011-07-18
      • 2017-02-03
      • 1970-01-01
      • 2017-07-05
      • 2019-04-10
      相关资源
      最近更新 更多