Automated backlink to the parent page

This TypoScript snippet generates an automated backlink that is leading to the page one level above the current page.

Sometimes, especially with pages on very deep hierarchy levels, it can happen that there is no chance for the user to navigate to pages on an upper level.

It is useful to put an automated link on such a page. you can use the following TypoScript code to insert such a link automatically.

Backlink to parent page TypoScript, SETUP section
temp.backlink = COA
temp.backlink {
  10 = TEXT
  10 {
    data = leveltitle : -2
    insertData = 1 = leveluid : -2
  noTrimWrap = |<p>Back to |</p>|

This code snippet generates a link to the page one level above the current page (value -2 for leveltitle and leveluid). The anchor text will be the title of the parent page. Additionally, the short text "Back to" will prepended to the link and the whole string gets wrapped in <p> tags afterwards.

The noTrimWrap statement makes sure that the whitespace before the link won't be removed.