So, you’ve started using typo3, and you’ve even built a couple of web using typo3. Then, of course, you’ve heard of typoscript, and seen things like this:

lib.something = TEXT
lib.something.value = hello there.

Well, have you ever wanted to just append a value, or slightly change an existing value?

Welcome, :=

Here’s an example:

lib.something.value = hello there.
lib.something.value := prependString(Umm, )
# results in “Umm, hello there”

Here are all the functions that are available, copied right out of doc_core_ts.

prependString: Adds a string to the beginning of the existing value.
appendString: Adds a string to the end of the existing value.
removeString: Removes a string from the existing value.
replaceString: Replaces old with new value. Separate these using “|”.
addToList: Adds a comma-separated list of values to the end of a string value. There is no check for duplicate values, and the list is not sorted in any way.
removeFromList: Removes a comma-separated list of values from a comma-separated list.

For all of you intermediate TYPO3 configurators out there, I know your gears are turning already, thinking about all the times you wished you could use something like this!

Leave a Reply