我正在生成10个最新创建页面的列表。我在后端的常规页面排序是:
root
-- category1
---- article1
---- article2
---- article3
-- category2
---- article4
---- article5
---- article6
因此列表必须包含文章的标题加上其父页面的标题,即类别。我大部分都在运行,但我很难输出类别标题。
这是我的TS:
lib.lastUpdated = COA
lib.lastUpdated {
10 = HMENU
10.wrap = <div class="lastupdated">|</div>
10 {
special = updated
special.value = 5
special.depth = 4
special.beginAtLevel = 2
special.mode = starttime
maxItems = 10
alternativeSortingField = starttime desc
1 = TMENU
1 {
NO {
allWrap = <div class="lu-elem">|</div>
after.cObject = COA
after.cObject {
10 = TEXT
10 {
field = starttime
date = d.m.y
noTrimWrap = | <span class="created">|</span><br />|
}
20 = TEXT
20 {
field = subtitle
wrap = <p class="subtitle">| <p>
}
30 = RECORDS #this is not working
30 {
source.field = uid
tables = pages
conf.pages = TEXT
conf.pages.data = leveltitle:0 #displays title of CURRENT page's parent
}
}
}
}
}
}
有人可以帮忙吗?
答案 0 :(得分:0)
获取父页面的标题:
30 = RECORDS
30 {
source.field = uid
tables = pages
conf.pages = RECORD
conf.pages {
# select the uid of the parent page of the current page
source.field = pid
tables = pages
dontCheckPid = 1
# print the header
conf.pages = TEXT
conf.pages.field = header
}
}