TSRef - TypoScript Reference
6.1.1. Inserting constants
Constants are inserted in the template-setup by performing an ordinary str_replace operation! You insert them like this:
{$bgCol}
{$topimg.width}
{$topimg.file.pic2}
{$file.toplogo}
Example:
page = PAGE
page.typeNum = 0
page.bodyTag = <body bgColor="{$bgCol}">
page.10 = IMAGE
page.10.file = {$file.toplogo}
Only defined constants are substituted.
Constants in included templates are also substituted as the whole template is just on large chunk of text.
Constants are case sensitive.
You should use a systematic naming of constants. Seek inspiration in the code-examples around.


Notice how the constants in the setup code is substituted. In the Object Browser, you can monitor the constants with or without substitution. Also notice that the value "logo*.gif" was resolved to the resource "uploads/tf/logo_01.gif"
(Note: The "Constants display" function is not available if you select "Crop lines")