Basic website setup in TYPO3

Show full page tree in page title (HTML title tag)

You might want your pages’ titles to represent the page structure, especially when your website has multiple page levels. Modern web browsers often display only the beginning of page titles in the tab headers. Safari 8 does not have a title bar anymore, in Firefox it’s deactivated by default. Anyway: the title will be displayed as a header in search engine result lists. Thus, it’s still an important part of your website that has to be considered carefully.

You’ll need to sort of trick TYPO3 and set up a rootline menu in which page titles are not linked.
Add the following code to your TypoScript root template:

### write a variable for the title Tag in page header
### is called in page.headerData
temp.pageTitle = COA
temp.pageTitle {
        ## Website Title from TS Template Record
        10 = TEXT
        10.value < sitetitle
        ## page titles in rootline
        15 = HMENU
        15 {
                special = rootline
                #rootline except home page
                special.range = 1|-1
                includeNotInMenu = 1
                1 = TMENU
                1.NO = 1
                1.NO.stdWrap.field = nav_title // title
                1.NO.stdWrap.htmlSpecialChars = 1
                1.NO.doNotLinkIt = 1
                1.NO.allWrap =  / |
        }
}
# replacing the standard title tag with the variable temp.pageTitle
page = PAGE
page {
        config.noPageTitle = 2
        headerData.5 < temp.pageTitle
        headerData.5.wrap = <title>|</title>
}
}

special.range = 1|-1 defines to add all page titles in the rootline up to the current one (-1) but without the root page title (1). To show the root page and leave the current page out (e.g. because you want to add it in another way), go for
special.range = 0|-2

Other definitions:

  • includeNotInMenu = 1 defines that also pages are displayed that are not shown in the menu
  • 1.NO.stdWrap.field = nav_title // title defines that it will display the navigation title if defined, otherwise the page title
  • 1.NO.allWrap = / | defines the separator (/) – make sure to write the HTML entity for non-breaking spaces if you want spaces