TypoScript: show page title and make it translatable

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. 

One thought on “TypoScript: show page title and make it translatable

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.