![](/img/trans.png)
[英]TYPO3 extension; read custom FAL variable in the domain to use in fluid template
[英]TYPO3 FAL : add and read a custom field in a fluid template
在我的自定義擴展中,我向需要讀取的圖像元數據引入了一個二進制變量,類似於tx_news的“在列表視圖中顯示”。
以tx_news為例,我能夠添加變量,新選項板在后端顯示復選框,並且選擇已注冊在sys_file_reference表的新數據庫字段中。
我首先嘗試在有效的域中聲明它,但由於它是我嘗試使用它的相同文件的數組,因此無法使用該變量,在循環內調用它破壞了循環……( 這是我的問題
現在,我需要在我的流體模板中使用這個新變量,如果我在各個項目之間循環,如果我這樣調試,則可以看到名為opentab
的新變量:
<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”及其正確的值,但是我找不到使用它的方法!
使用{item.originalResource.properties.opentab}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.