【问题标题】:Typoscript: how do I change a select statement when a record existsTyposcript:当记录存在时如何更改选择语句
【发布时间】:2021-08-31 15:00:48
【问题描述】:

我想检测前端用户是否提交了表单(保存在数据库中)然后隐藏 uid 883,但是对于 DB 语句它只获取具有给定 uid 的数据,我只有 user_id 或 user_name 所以它必须搜索数据库。 我目前的 TypoScript 尝试:

page.10.variables.CONTENT < styles.content.get
page.10.variables.CONTENT.select.where = colPos=0 AND uid!=883
page.10.variables.CONTENT.select.where.if{
    value = 0
    equals.data = DB:tt_content:???:??
    negate = 1
}

有人有这个想法吗?

【问题讨论】:

    标签: typo3 typoscript typo3-10.x


    【解决方案1】:

    我不完全知道您想要实现什么以及数据的确切结构,但我建议使用USER cObject 来获取例如正确的 id。

    在 PHP 中,您获得了比 TypoScript 更好的控制。一个例子看起来像这样 https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/UserAndUserInt/Index.html#example-1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-14
      • 1970-01-01
      相关资源
      最近更新 更多