代码之家  ›  专栏  ›  技术社区  ›  webman

TYPO3 FAL:在流体模板中添加和读取自定义字段

  •  0
  • webman  · 技术社区  · 8 年前

    在我的自定义扩展中,我向需要读取的图像元数据引入了一个二进制变量,类似于tx_新闻的“在列表视图中显示”。

    以tx\U news为例,我能够添加变量,新的调色板在后端显示复选框,选择注册在sys\u file\u参考表中的新数据库字段中。。。

    我首先尝试在域中声明它,但我无法使用该变量,因为它是一个由我尝试使用它的相同文件组成的数组,在循环中调用它打破了循环。。。( this was my question )

    现在,我需要在我的流体模板中使用这个新变量,如果我通过名为 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}

    PropertiesOffice参考 我看到“opentab”的正确值,但我没有找到使用它的方法!!!

    1 回复  |  直到 8 年前
        1
  •  1
  •   minifranske    8 年前

    使用 {item.originalResource.properties.opentab}

    推荐文章