0
votes

I try to get page title and edit it like on the following example.

Page name My tools

Final string my_tools (Thus, I will be able to use it through markers in my css classes)

I know how to get page title using:

  HEADERTITLE = TEXT
  HEADERTITLE.data = page : title

But how can I transform this string? Thank you for your help!

1

1 Answers

0
votes

to convert the case and replace some characters you may use these TypoScript settings:

HEADERTITLE = TEXT
HEADERTITLE {
    data = page:title
    ### replace whitespace
    replacement.10 {
        search = #\s#i
        replace = _
        useRegExp = 1
    }
    /*
    ### replace all special characters
    replacement.10 {
        search = #\W#i
        replace =
        useRegExp = 1
    }
    */
    ### transform string to lowercase
    case = lower
}