Back link to the parent 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.

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.

TYPO3 link directory - no back link needed - Submit your site now!!

Comments for Back link to the parent page

Be the first to comment this article!


Add a comment


(will not be displayed, Gravatar is enabled)



(Fields marked with a * are mandatory)

Visitors found this page by searching for these keywords:

typoscript backlink · typoscript parent page · typoscript coa link · how to get parent uid from typoscript · typoscript link to parents page