Tina
Tina

Reputation: 491

Typoscript: Override data with typolink

I'm trying to set the canonical url of page. If the individual field (tx_metaseo_canonicalurl) is not set then the url page should be determined by a typolink.

I tried this but it's not working:

30 = TEXT
30 {
    data = FIELD:tx_metaseo_canonicalurl
    override.typolink = {
    parameter.data = TSFE:id
    returnLast = url
    forceAbsoluteUrl = 1
    addQueryString = 1
    addQueryString.method = GET
    addQueryString.exclude = cHash,backPid
}
override.if.isFalse.field = tx_metaseo_canonicalurl
wrap = <link rel="canonical" href="|" />
required = 1

}

Upvotes: 1

Views: 684

Answers (1)

Georg Ringer
Georg Ringer

Reputation: 7939

The last 3 lines should be inside the 30 cObj

Upvotes: 1

Related Questions