由于您没有指定代码的上下文,因此以下示例仅扩展您提供的代码。
20 = CONTENT
20 {
table = tt_content
select {
selectFields = cruser_id
}
renderObj = RECORDS
renderObj {
source.field = cruser_id
tables = be_users
dontCheckPid = 1
conf.be_users = TEXT
conf.be_users {
field = username
noTrimWrap = || |
}
}
}
说明:您获取使用CONTENT
CObject的内容,并告诉TYPO3以使其作为RECORDS
CObject的。此对象现在具有用户的UID,可用的号码为cruser_id
,并可在其配置中使用source.field
。 RECORDS
因此从3210表中加载记录(使用UID = cruser_id),并告诉TYPO3将其呈现为TEXT
cObject。因为它可以是任何cObject(例如COA),所以输出可能更复杂,包括后端用户记录中的其他字段。
更为复杂的例子
20 = CONTENT
20 {
table = tt_content
select {
selectFields = cruser_id, tstamp
}
renderObj = COA
renderObj {
10 = TEXT
10 {
field = tstamp
date = j/n/Y
noTrimWrap = |Last modified: ||
}
20 = RECORDS
20 {
source.field = cruser_id
tables = be_users
dontCheckPid = 1
conf.be_users = COA
conf.be_users {
stdWrap.noTrimWrap = |<br />Author: ||
10 = TEXT
10 {
field = realName
}
20 = TEXT
20 {
field = username
noTrimWrap = | (|)|
}
}
}
}
}
来源
2012-10-08 11:34:00
tmt
有一个在代码中的一些错误。 Conf是用户? – Bytemain
@Chiyou:你为什么认为有错误? – tmt
我没有测试它,但可以使用变量名使用conf用户吗?空格击键是允许的吗? – Bytemain