如何为tx_news TYPO3设置面包屑 [英] How to set breadcrumb for tx_news TYPO3
本文介绍了如何为tx_news TYPO3设置面包屑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个TYPO3网站.我需要设置一个面包屑.对于新闻,我需要在新闻详细信息"(新闻插件的页面标题)的位置显示新闻标题.如何实现呢?
I have a TYPO3 site. 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?
我的代码是
<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.
使用此TS代码代替使用viewhelper
Instead of using the viewhelper, use this TS code
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>
}
}
并使用<f:cObject typoscriptObjectPath="lib.navigation_breadcrumb" />
这篇关于如何为tx_news TYPO3设置面包屑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文