TYPO3 FAL:在流体模板中添加和读取自定义字段 [英] TYPO3 FAL : add and read a custom field in a fluid template

查看:32
本文介绍了TYPO3 FAL:在流体模板中添加和读取自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的自定义扩展中,我为需要读取的图像元数据引入了一个二进制变量,类似于 tx_news 的在列表视图中显示".

In my custom extension I introduced a binary variable to the image metadata that needs to be read, similar to the "Show in list view" of tx_news.

以 tx_news 为例,我能够添加变量,新调色板在后端显示复选框,并且选择在 sys_file_reference 表的新数据库字段中注册...

With tx_news as example I was able to add the variable, the new palette shows the checkbox in the backend and the selection is registered in a new database field in the sys_file_reference table ...

我首先尝试在确实有效的域中声明它,但我无法使用该变量,因为它是我尝试使用它的相同文件的数组,在循环中调用它打破了循环......(这是我的问题)

I first tried to declare it in the domain which did work but I could not use the variable since it was an array of the same files in which I tried to use it, calling it within a loop broke the loop ... (this was my question)

现在我需要在我的流体模板中使用这个新变量,如果我循环遍历项目,如果我这样调试,名为 opentab 的新变量是可见的:

now I need to use this new variable in my fluid template, if I loop trough the items the new variable named opentab is visible if I debug like this:

<f:for each="{object.items}" as="item" iteration="iteration">
<f:debug>{item.originalResource}</f:debug>

# debug result
TYPO3\CMS\Core\Resource\FileReferenceprototypeobject
   propertiesOfFileReference => array(36 items)
   uidOfFileReference => NULL
   name => NULL
   originalFile => TYPO3\CMS\Core\Resource\Fileprototypeobject
   mergedProperties => array(empty)

propertiesOfFileReference 有标题",我可以这样使用 {item.originalResource.title}

propertiesOfFileReference 中,我看到opentab"具有正确的值,但我发现无法使用它!!!

in propertiesOfFileReference I see "opentab" with its correct value but I found no way to use it !!!

推荐答案

使用 {item.originalResource.properties.opentab}

这篇关于TYPO3 FAL:在流体模板中添加和读取自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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