lib.canonical = TEXT
lib.canonical {
    if.isTrue.field = content_from_pid
    typolink {
        parameter.data = TSFE:id
        addQueryString = 1
        addQueryString.exclude = L,id,cHash,no_cache,gclid,fbclid,email
        returnLast = url
    }
    noTrimWrap (
|

<link rel="canonical" href="{$const.com.siteProtocol}://{$const.com.siteUrl}|">
|
    )
}