【问题标题】:Typo3 DCE ImagesTypo3 DCE 图像
【发布时间】:2015-02-10 09:26:55
【问题描述】:

我将尝试使用 DCE(动态内容元素)设计我自己的内容元素。 当我尝试使用图像时,我遇到了问题。我为图像创建了一个选择字段,效果很好。在流体模板中,我有以下处理图像的代码:

<f:image src="{field.image}" alt="" treatIdAsReference="1" />

但是如果我尝试插入内容元素,Typo3 会抛出这个异常:

Oops, an error occurred!

No file usage (sys_file_reference) found for given UID.

More information regarding this error might be available online.

我已经发现,这肯定是 Typo3 中的一个错误,但我该如何修复它呢?

【问题讨论】:

    标签: image typo3 fluid tx-dce


    【解决方案1】:

    查看本教程并进行相应设置。 http://docs.typo3.org/typo3cms/extensions/dce/Tutorial/Index.html 你的问题可能会解决...!!

    【讨论】:

      【解决方案2】:

      知道了。使用提示表单vijay rami 我发现,您必须像这样在 dce 中渲染图像:

      <f:for each="{dce:fal(field:'image', contentObject:contentObject)}" as="fileReference" iteration="iterator">
          <f:if condition="{iterator.isFirst}">
              <f:image src="{fileReference.uid}" alt="" treatIdAsReference="1" />
          </f:if>
      </f:for>
      

      当然你必须在第一行“field:'image'”中编辑你的名字。

      【讨论】:

        【解决方案3】:

        对于模板,请使用以下代码:

        <f:for each="{dce:fal(field:'fal', contentObject:contentObject)}" as="fileReference" iteration="iterator">
            <f:if condition="{iterator.isFirst}">
                <f:image src="{fileReference.uid}" alt="" treatIdAsReference="1" />
            </f:if>
        </f:for>
        

        注意field:'fal'不是你设置的变量名,它是变量名下面配置的一部分:

        ...
        <foreign_match_fields>
            <fieldname>fal</fieldname> <!-- Name of variable! -->
        </foreign_match_fields>
        ...
        

        【讨论】:

        • 我可以确认这是可行的。这有点令人困惑,因为您可能认为“字段:”是字段名称。也许它是有意的,但在这种情况下不能这样工作。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-05
        • 1970-01-01
        • 2017-05-13
        相关资源
        最近更新 更多