我现在遇到几次TYPO3的问题。
如果我使用TYPO3 CONTENT Object获取对象,则可以使用renderObj渲染字段。
到目前为止,一切都很好...
但是,如果我尝试获取在没有任何响应之前就已经获取的对象。
设置如下:
temp.current = COA
temp.current {
10 = CONTENT
10 {
table = pages
select {
pidInList = 22
max = 1
}
renderObj = COA
renderObj {
10 = CONTENT
10 {
table = tt_content
select {
pidInList.field = uid
where = colPos = 9
max = 1
languageField = sys_language_uid
}
renderObj = COA
renderObj {
5 = TEXT
5 {
value = here
typolink {
parameter.field = pid
title {
cObject = RECORDS
cObject {
tables = pages
source.field = pid
conf.pages = TEXT
conf.pages.field = title
}
}
}
}
20 = IMAGE
20 {
required = 1
file{
import = uploads/pics/
import.field = image
import.data = levelmedia: -1, slide
import.listNum = 0
width = 300c
height = 300c
}
titleText.field = titleText // altText
altText.field = altText // titleText
imageLinkWrap = 1
imageLinkWrap {
enable = 1
typolink {
parameter.data = field:pid
}
}
}
}
}
}
}
}
这是我当前的设置,我需要获取当前的项目...
重要的部分是:
5 = TEXT
5 {
value = here
typolink {
parameter.field = pid
title {
cObject = RECORDS
cObject {
tables = pages
source.field = pid
conf.pages = TEXT
conf.pages.field = title
}
}
}
}
我已经调试了source的结果...值是92,这是我需要标题字段的页面中的正确uid ...
我也知道代码应该没问题,因为我在许多页面上都使用了此代码段。
我认为问题是,我尝试获取以前已经获取的内容。
就在这儿:
temp.current = COA
temp.current {
10 = CONTENT
10 {
table = pages
select {
pidInList = 22
max = 1
}
}
}
非常感谢!
//编辑
我为我的问题找到了一个很好的解决方案。
5 = TEXT
5 {
value = hier
typolink {
parameter.field = pid
title.cObject = TEXT
title.cObject {
data.dataWrap = DB:pages:{field:pid}:title
}
}
}
最佳答案
根据http://forge.typo3.org/issues/20541的说法,您是对的,这不是错误,而是功能(“递归预防”)。
关于sql - TYPO3-typolink中标题的父页面字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19835797/