TypoScript select dataWrap 可能由流体变量动态填充?
TypoScript select where dataWrap dynamically filled by fluid variable possible?
我有自己的扩展程序,前端用户可以使用它来创建自己的记录。在用户详细信息页面上,应显示用户的所有条目。
在我的 "Show" 模板中,我有一个变量 {user.uid},我用它来获取用户 UID。我如何将其添加到我的打字稿中?
错别字
lib.getuserItems = CONTENT
lib.getuserItems {
table = tx_myext_domain_model_item
select {
selectFields = crdate,image,message,uid,deleted
pidInList = 2
orderBy = crdate DESC
where.data =
where.dataWrap = ((tx_myext_domain_model_item.author_ident = '{user.uid}')) AND deleted = 0 AND NOT tx_myext_domain_model_item.parent_item
}
流体
<f:cObject typoscriptObjectPath="lib.getuserItems" data="{user.uid}" />
如果您的数据是单个值(因此不是数组或对象),它可以作为 TypoScript 中的 current
值使用。所以你的 TypoScript 应该是:
lib.getuserItems = CONTENT
lib.getuserItems {
table = tx_myext_domain_model_item
select {
selectFields = crdate,image,message,uid,deleted
pidInList = 2
orderBy = crdate DESC
where.current = 1
// ensure it's an integer
where.intval = 1
where.wrap = ((tx_myext_domain_model_item.author_ident = '|')) AND deleted = 0 AND NOT tx_myext_domain_model_item.parent_item
}
}
我有自己的扩展程序,前端用户可以使用它来创建自己的记录。在用户详细信息页面上,应显示用户的所有条目。
在我的 "Show" 模板中,我有一个变量 {user.uid},我用它来获取用户 UID。我如何将其添加到我的打字稿中?
错别字
lib.getuserItems = CONTENT
lib.getuserItems {
table = tx_myext_domain_model_item
select {
selectFields = crdate,image,message,uid,deleted
pidInList = 2
orderBy = crdate DESC
where.data =
where.dataWrap = ((tx_myext_domain_model_item.author_ident = '{user.uid}')) AND deleted = 0 AND NOT tx_myext_domain_model_item.parent_item
}
流体
<f:cObject typoscriptObjectPath="lib.getuserItems" data="{user.uid}" />
如果您的数据是单个值(因此不是数组或对象),它可以作为 TypoScript 中的 current
值使用。所以你的 TypoScript 应该是:
lib.getuserItems = CONTENT
lib.getuserItems {
table = tx_myext_domain_model_item
select {
selectFields = crdate,image,message,uid,deleted
pidInList = 2
orderBy = crdate DESC
where.current = 1
// ensure it's an integer
where.intval = 1
where.wrap = ((tx_myext_domain_model_item.author_ident = '|')) AND deleted = 0 AND NOT tx_myext_domain_model_item.parent_item
}
}