stooky
stooky

Reputation: 1

TYPO3 - typoscript backlink

I am currently looking all over the web for a solution to create a link back to the referring page.

atm I am just using JS e.g.

<a href="javascript:history.back()">« back</a>

I would like to add the information to which page the link leads back using the page title of the referring page e.g.

<a href="javascript:history.back()">« back to: <referring-page-title></a>

is there any way to create such a backlink with typoscript or fluid?

thx for helping me out, rgds stooky

Upvotes: -1

Views: 763

Answers (2)

Elvis Tavasja
Elvis Tavasja

Reputation: 191

If you are in the page tree you can use something like this:

lib.backlink = HMENU
lib.backlink {
    entryLevel = 2
    special = browse
    special.items = up
    wrap = <nav id="backlink">|</nav>

    1 = TMENU
    1.NO.stdWrap.dataWrap = <span>back to:&nbsp;| </span>
}

otherwise

renderObj.10 = TEXT
renderObj.10.value = <a href="javascript:history.back()">Go back</a>

Upvotes: 0

Georg Ringer
Georg Ringer

Reputation: 7939

You could also check the referrer in TYPO3 but that would lead to the problem that the full cache can't be cached anymore. I woudln't recommend that.

What about misusing e.g. the local storage, write all page information you need into some JS variables, save it into the local storage whenever a link is triggered and use it from there?

Upvotes: 0

Related Questions