我需要来自tt_news类别的图像的url来填充conf.tt_news.10.stdWrap.ifEmpty。有没有人有想法。我的方法
lib.catimage = TEXT
lib.catimage {
table = tt_news_cat
select {
pidInList = 2
andWhere {
data = GPVar:tx_ttnews|cat
....????
page.headerData {
15 = RECORDS
15 {
source.data = GPvar:tx_ttnews|tt_news
tables = tt_news
conf.tt_news = COA
conf.tt_news.10 = IMG_RESOURCE
conf.tt_news.10.file {
width = 403
import = uploads/pics/
import.field = image
import.listNum = 0
}
conf.tt_news.10.stdWrap.ifEmpty < lib.catimage
wrap = <link rel="image_src" href="{$BaseUrl}|" />
}
}
我有一种新方法,但没有看到错误。如果我取出注释大括号,路径是正确的,但脚本的语法不正确。第一部分也不再适用。这里是修改后的版本。
page.headerData {
15 = RECORDS
15 {
source.data = GPvar:tx_ttnews|tt_news
tables = tt_news
conf.tt_news = COA
conf.tt_news.10 = IMG_RESOURCE
conf.tt_news.10.file {
width = 403
import = uploads/pics/
import.field = image
import.listNum = 0
}
conf.tt_news.10.stdWrap.ifEmpty.cObject = CONTENT
conf.tt_news.10.stdWrap.ifEmpty.cObject {
table = tt_news_cat
select {
selectFields = image
pidInList = 2
languageField = sys_language_uid
where = deleted=0 AND hidden=0
andWhere {
data = GPvar:tx_ttnews|category
wrap = uid=|
intval = 1
}
}
#}
renderObj = TEXT
renderObj.field = image
}
wrap = <link rel="image_src" href="{$BaseUrl}|" />
}
}