TYPO3

Back link to the parent page

deutsch Hier klicken, um diese Seite auf Deutsch zu lesen: Automatischen Backlink setzen

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.

TypoScript: Back link to parent page

SETUP
temp.backlink = COA
temp.backlink {
  10 = TEXT
  10 {
    data = leveltitle : -2
    insertData = 1
    typolink.parameter.data = 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.

Comments for Back link to the parent page

Add a comment


(will not be displayed)


(Fields marked with a * are mandatory)
Please note that your comment will be checked before it gets published.