将数据从Fluid传输到Typoscript插件设置

时间:2017-06-27 06:38:33

标签: typo3 typoscript fluid extbase

我有一个带有这行代码的Fluid模板:

<body>
<section class="main">
<form class="search" action="">
    <input type="search" id ="searchit" placeholder="search.." />
    <ul class="results" id="searchlist">
    </ul>
</form>
</section>
</body>  

这一段Typoscript打电话给插件:

<f:cObject typoscriptObjectPath="lib.psStadtDetail" data="{stadt}" />

现在,此插件的设置,特别是StaticZip应来自Fluid模板。但是temp.psStadtZip没有传输数据

lib.psStadtDetail = USER_INT
lib.psStadtDetail {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    pluginName = Pferdeservice
    extensionName = Pferdeservice
    vendorName = Pferdeservice
    Controller = User
    action = search

    switchableControllerActions.User.1 = list

    features    < plugin.tx_pferdeservice.features
    view        < plugin.tx_pferdeservice.view
    persistence < plugin.tx_pferdeservice.persistence
    settings {
            StaticZip < temp.psStadtZip
            #StaticZip = 70173
    }
}

当我仅输出temp.psStadtZip时,我会得到正确的邮政编码。

为什么我不能将它用于插件设置?我该如何做到这一点?

1 个答案:

答案 0 :(得分:0)

属性设置只能用于一组键。

10 = FLUIDTEMPLATE
10 {
  file = fileadmin/templates/MyTemplate.html
  settings {
      name = Car
      color = red
  }
}

See TYPO3 TypoScript Reference (latest (8-dev)): Content Objects (cObject) > Fluidtemplate > settings

相反,你应该使用变量,它是一个cObjects数组。

lib.psStadtDetail {
    # Replace settings with variables
    variables {
        StaticZip < temp.psStadtZip
        #StaticZip = 70173
    }
}

See TYPO3 TypoScript Reference (latest (8-dev)): Content Objects (cObject) > Fluidtemplate > variables