TypoScript: show page title and make it translatable


June 06, 2018 at 09:40
Typo3

On a certain part of my template I needed the page title - but the important thing is: not the nav_title, which was set as well. My first try: 

temp.thePageTitle = TEXT
temp.thePageTitle.data = DB:pages:33:title

Unfortunately it was a multi-language-page and inserting it like this didn't properly translate the title. Fortunately, I found a better way: 

temp.thePageTitle = HMENU
temp.thePageTitle{

    special = list
    special.value = 33
    1 = TMENU
    1 {
        expAll = 1
        NO{
             doNotLinkIt = 1
             stdWrap.cObject = TEXT
             stdWrap.cObject.field = title
        }

        wrap = |
    }
}

This handles the translation too. 


Tags: typoscript TYPO3 8


Hinterlasse einen Kommentar:
Search