TypoScript string formats
The values assigned to properties in TypoScript are internally handled as strings.
Some properties expect a certain format of string. These formats are described in this chapter.
Enforcing these string formats is up to the implementation of the property using them. They are therefore no real constructs of the TypoScript syntax.
boolean
boolean
-
Possible values for boolean variables are
1
and0
meaning TRUE and FALSE.Everything else is evaluated to one of these values by PHP: Non-empty strings (except
0
[zero]) are treated as TRUE, empty strings are evaluated to FALSE.Examplesdummy.enable = 0 # false, preferred notation dummy.enable = 1 # true, preferred notation dummy.enable = # false, because the value is empty
Copied!
date-conf
date-conf
-
Used to format a date, see PHP function
date
. See the documentation of allowed date time formats in PHP.() Examplepage.10.date-conf = d-m-y
Copied!
function name
function name
-
Indicates a function or method in a class to call. See more information at the USER cObject.
ExamplesMethod name in a namespaced class:
lib.someThing = USER_INT lib.someThing.userFunc = MyVendor\MyExtension\SomeNamespace\SomeClass->someFunction
Copied!<?php namespace MyVendor\MyExtension\SomeNamespace; use Psr\Http\Message\ServerRequestInterface; class SomeClass { /** * @param string $content Empty string (no content to process) * @param array $conf TypoScript configuration */ public function someFunction(string $content, array $conf, ServerRequestInterface $request): string { $changedContent = $content; // Do something return $changedContent; } }
integer
integer
-
Examples
42, -8, -9, 0
Positive integers expect to be greater or equal zero.
path
path
-
Path relative to the root directory from which we operate. Also resolves
EXT:
syntax.Examplepage.10.settings.somePath = fileadmin/stuff/
Copied!
resource
resource
-
If the value contains a "/", it is expected to be a reference (absolute or relative) to a file in the file system. There is no support for wildcard characters in the name of the reference.
ExampleReference to a file in the file system:
page.10.settings.someFile = fileadmin/picture.gif
Copied!
string
string
-
Any property in TypoScript is a string technically. String can be defined in a single line or with multiple lines, using the Multiline assignment with "(" and ")".
Examplepage.10.value = The quick brown fox jumps over the lazy dog.
Copied!myIdentifier.mySubIdentifier = TEXT myIdentifier.mySubIdentifier = myValue myIdentifier.mySubIdentifier.stdWrap = <p>|</p> # "myIdentifier.mySubIdentifier" is completely removed, including value # assignment and sub identifier "stdWrap" myIdentifier.mySubIdentifier > # Same as above: Everything after ">" operator is considered a comment myIdentifier.mySubIdentifier > // Some comment
Copied!