Skip to content

Instantly share code, notes, and snippets.

@h3nn3s
Last active August 29, 2015 14:04
Show Gist options
  • Save h3nn3s/bcb1c05e7203df70e47b to your computer and use it in GitHub Desktop.
Save h3nn3s/bcb1c05e7203df70e47b to your computer and use it in GitHub Desktop.
TYPO3 hreflang-Links via Sprach-Menü
lib.hreflang = HMENU
lib.hreflang {
special = language
special.value = 0,1,2
1 = TMENU
1 {
# Link zu nicht-aktiven Sprachen anzeigen
NO = 1
NO {
stdWrap.cObject = TEXT
stdWrap.cObject.value = de || en || fr
linkWrap = <link rel="alternate" hreflang="|
doNotLinkIt = 1
after.cObject = TEXT
after.cObject {
stdWrap {
wrap = " href="|" />
typolink {
parameter.data = TSFE:id
additionalParams = &L=0 || &L=1 || &L=2
returnLast = url
forceAbsoluteUrl = 0
addQueryString = 1
addQueryString.method = GET
addQueryString.exclude = cHash,backPid
}
}
}
}
# Link zur gerade aktiven Sprache NICHT anzeigen
#ACT = 1
#ACT.doNotShowLink = 1
# Link zu fehlenden Übersetzungen NICHT anzeigen
USERDEF1 = 1
USERDEF1.doNotShowLink = 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment