How to use typoscript to capitalize every letter of a word or string of text
Or how to convert text to uppercase with typoscript
A typoscript function just like PHP's strtoupper function
I was wondering how to use typoscript to turn a string of text to upper case, to make every letter in a word, phrase, or other string a capital letter.
This would be like using PHPs strtoupper function which lets you convert strings to upper case like this:
$str = 'It is a lovely day';
$str = strtoupper($str);
... and then running that would result in the following....
IT IS A LOVELY DAY
The typoscript way
The typoscript way uses the "case" property of stdWrap. The property, case, when applied to a text string using stdWrap will do the same thing as PHP's strtoupper function. The exact same thing.
10 = TEXT
10.value = It is a lovely day
10.stdWrap.case = upper
Just as in the PHP example, the output of this typoscript will be...
IT IS A LOVELY DAY
Typoscript also allows you to set the case property as lower. Can you guess what it does?