Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个自定义扩展,它使用
{f:uri.image(src: '{data.flexform_backgroundImages}', treatIdAsReference: '1')}
如果我在后端隐藏图像,我会在前端收到以下问题:“未找到给定 UID 的文件引用 (sys_file_reference)”。我该如何解决这个问题?
在使用变量之前,您应该检查它是否真的有一个值。为此,请在 f:uri.image 视图助手周围放置一个 f:if 视图助手,并在条件中使用相同的变量。
<f:if condition="{data.flexform_backgroundImages}"> <img src="{f:uri.image(src: '{data.flexform_backgroundImages}', treatIdAsReference: '1')}" /> </f:if>