Skip to content

Instantly share code, notes, and snippets.

@paulrohrbeck
Last active December 27, 2015 11:39
Show Gist options
  • Save paulrohrbeck/7319589 to your computer and use it in GitHub Desktop.
Save paulrohrbeck/7319589 to your computer and use it in GitHub Desktop.
TYPO3 / TypoScript: This snippet adds a class (eg. class="page-pagetitle") to the body tag of a TYPO3 page. The page title is dynamically pulled from the page properties, all non-word characters are removed and the title is transformed to lower case letters only.
# add a class with the page title to the body tag:
bodyTag >
bodyTagCObject = TEXT
bodyTagCObject {
data = field:title
case = lower
stdWrap.replacement {
10 {
search = #\W#i
replace =
useRegExp = 1
}
}
wrap = <body class="page-|">
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment