[英]How to set breadcrumb for tx_news TYPO3
I have a TYPO3 site. 我有一个TYPO3网站。 I need to set a breadcrumb.
我需要设置面包屑。 For news I need to show the news title inplace of 'News Detail' (Page title of news plugin).
对于新闻,我需要在“新闻详情”(新闻插件的页面标题)中显示新闻标题。 How to implement that?
如何实现?
My code is 我的代码是
<v:page.breadCrumb class="breadcrumb" levels="1" showCurrent="1" divider=">" showCurrent="1" entryLevel="1"/>
or any other method for getting the title like 或任何其他获得标题的方法
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/news">News</a></li>
<li class="active"> ???????? </li>
</ol>
Sorry but that is not possible out of the box. 对不起,但开箱即用是不可能的。 The news record is not a real page and therefore must be added a bit different.
新闻记录不是真实的页面,因此必须添加一些不同的内容。
Instead of using the viewhelper, use this TS code 而不是使用viewhelper,使用此TS代码
lib.navigation_breadcrumb = COA
lib.navigation_breadcrumb {
stdWrap.wrap = <ol class="breadcrumb">|</ol>
10 = HMENU
10 {
special = rootline
#special.range = 1
1 = TMENU
1 {
noBlur = 1
NO = 1
NO {
wrapItemAndSub = <li>|</li>
ATagTitle.field = subtitle // title
stdWrap.htmlSpecialChars = 1
}
CUR <.NO
CUR {
wrapItemAndSub = <li class="active">|</li>
doNotLinkIt = 1
}
}
}
# Add news title if on single view
20 = RECORDS
20 {
if.isTrue.data = GP:tx_news_pi1|news
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news {
field = title
htmlSpecialChars = 1
}
wrap = <li>|</li>
}
}
And include it by using <f:cObject typoscriptObjectPath="lib.navigation_breadcrumb" />
并使用
<f:cObject typoscriptObjectPath="lib.navigation_breadcrumb" />
包含它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.