How to set breadcrumb for tx_news TYPO3

≯℡__Kan透↙ 提交于 2019-12-01 01:59:10

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

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" />

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!