TYPO3 系统类别
我正在使用 TYPO3 10 和新闻扩展。我的新闻页面分为四个选项卡,使用类别作为选项卡名称。我尝试输出类别,例如当前选择的选项卡名称,并希望使用打字稿作为标题标签中的标题输出,我该怎么做?
这是我当前的 TypoScript:
[page["uid"] == 6]
lib.categoryTitle = CONTENT
lib.categoryTitle {
if.isTrue.data = GP:tx_news_pi1|news
table = tx_news_domain_model_news
select {
uidInList.data = GP:tx_news_pi1|news
pidInList = 57
join = sys_category_record_mm ON tx_news_domain_model_news.uid = sys_category_record_mm.uid_foreign JOIN sys_category ON sys_category.uid = sys_category_record_mm.uid_local
orderBy = sys_category.sorting
max = 1
}
renderObj = TEXT
renderObj {
field = title
htmlSpecialChars = 1
}
}
page = PAGE
page {
headerData {
10 = TEXT
10 {
field = title
noTrimWrap = |<title>News zu: | </title>|
}
}
}
page.headerData.10 =
page.headerData.10 < lib.categoryTitle
[END]
I am using TYPO3 10 and the news extension. My news page is separatet into four tabs that uses the category as tab name. I try to output the category, e.g. tab name if is current selected and want to output as title in the title-tag by using typoscript, how can I do that?
This is my current TypoScript:
[page["uid"] == 6]
lib.categoryTitle = CONTENT
lib.categoryTitle {
if.isTrue.data = GP:tx_news_pi1|news
table = tx_news_domain_model_news
select {
uidInList.data = GP:tx_news_pi1|news
pidInList = 57
join = sys_category_record_mm ON tx_news_domain_model_news.uid = sys_category_record_mm.uid_foreign JOIN sys_category ON sys_category.uid = sys_category_record_mm.uid_local
orderBy = sys_category.sorting
max = 1
}
renderObj = TEXT
renderObj {
field = title
htmlSpecialChars = 1
}
}
page = PAGE
page {
headerData {
10 = TEXT
10 {
field = title
noTrimWrap = |<title>News zu: | </title>|
}
}
}
page.headerData.10 =
page.headerData.10 < lib.categoryTitle
[END]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在复制时覆盖了
page.headerData.10
的类型:page.headerData.10
page.headerData.10
page.headerData.10
page.headerData.10
page.headerData.10
page.headerData.10 lib.categoryTitle
。所以它现在是一个CONTENT
-cobject,它没有 stdWrap-数据类型。因此,不再考虑noTrimWrap
。但它有一个 stdWrap 属性:将换行移动到 page.headerData.10.stdWrap.noTrimWrap 。然后,就会再次出现标题标签,浏览器将不会默认该 URL。
2022-03-17 更新:
应用
lib.categoryTitle
的副本并进行上述修改后,它的计算结果应为 TypoScript:field
is no property ofCONTENT< /code>,所以应该被忽略并且输出不能是“News zu: 'Pagetitle'”
You are overriding the type of
page.headerData.10
while copying:page.headerData.10 < lib.categoryTitle
. So it's aCONTENT
-cobject now, which does not have stdWrap-data type. So thenoTrimWrap
is not taken into account anymore.But it has a stdWrap-property: move the wrap to
page.headerData.10.stdWrap.noTrimWrap
. Then, there will be a title-tag again, and the browser won't default to the URL.Update 2022-03-17:
With the copy of
lib.categoryTitle
applied and the above modification, it should evaluate as TypoScript:field
is no property ofCONTENT
, so it should be ignored and output can't be "News zu: 'Pagetitle'"