TypoScript Reference

Previous Key:doc_core_tsref
Version:latest (9-dev)
Language:en
Description:The TypoScript Reference (TSref) is a true reference describing the core Content Objects and functions available for Template building using the TypoScript template engine.
Keywords:forAdmins, forIntermediates
Copyright:since 2000
Author:Documentation Team
Email:documentation@typo3.org
License:Open Publication License available from www.opencontent.org/openpub/
Rendered:2018-11-14 12:33

The content of this document is related to TYPO3, a GNU/GPL CMS/Framework available from https://typo3.org/.

Official documentation

This document is included as part of the official TYPO3 documentation. It has been approved by the TYPO3 Documentation Team following a peer- review process. The reader should expect the information in this document to be accurate - please report discrepancies to the Documentation Team (documentation@typo3.org). Official documents are kept up-to-date to the best of the Documentation Team's abilities.

Core Manual

This document is a Core Manual. Core Manuals address the built in functionality of TYPO3 and are designed to provide the reader with in- depth information. Each Core Manual addresses a particular process or function and how it is implemented within the TYPO3 source code. These may include information on available APIs, specific configuration options, etc.

Core Manuals are written as reference manuals. The reader should rely on the Table of Contents to identify what particular section will best address the task at hand.

Table of Contents and Sitemap

Please visit the complete Sitemap

Sitemap

Introduction

About this document

This document is a complete reference to all objects and properties of TypoScript as used in frontend TypoScript templates, and not in TSconfig.

For explanations about the syntax of TypoScript itself, please refer to the TypoScript Syntax of the Core API.

This document always refers to the latest released TYPO3 version. For older versions, use the version selector at the bottom left of the site.

For a list of all changes see the commit log on GitHub.

Credits

The manual was originally written by Kasper Skårhøj. Over the years it has been maintained and updated successively by Michael Stucki, François Suter and Christopher Stelmaszyk.

Feedback and Fixing

If you find a bug in this manual, please be so kind as to check the online version on. From there you can hit the "Edit me on GitHub" button in the top right corner and submit a pull request via GitHub. Alternatively you can just file an issue using the bug tracker.

Maintaining high quality documentation requires time and effort and the TYPO3 Documentation Team always appreciates support.

If you want to support us, please join the slack channel #typo3-documentation on Slack. Visit forger to gain access to Slack.

And finally, as a last resort, you can get in touch with the documentation team by mail.

General information

Case sensitivity

All names and references in TypoScript are case sensitive! This is very important to notice. For example watch the words "TEXT" and "value" in this TypoScript code:

myObject = TEXT
myObject.value = <strong>Some HTML code</strong>

This is not the same as

myObject = text
myObject.Value = <strong>Some HTML code</strong>

While the first will be recognized as the content object "TEXT" and will produce the desired output, the latter will not be recognized and will not output anything. Even if you wrote "TEXT" in uppercase in the second example, it would still not work, because the property "value" is misspelled.

Always remember: In this manual the case of objects is important.

Version numbers

For new features TypoScript Reference includes a note in which TYPO3 version the feature was added. If such a note is missing, the feature is part of TYPO3 since version 7.6 at least.

Using and setting TypoScript

TypoScript templates mainly consist of the Constants and the Setup field. Each template can include other (static) templates, which can again define values in their own Constants and Setup fields.

The TypoScript template configuration can be viewed and edited in the WEB > Template module.

Usage

TypoScript templates are used to drive frontend rendering.

TYPO3 CMS does not provide a definite templating method out of the box. However a minimal amount of TypoScript will always be necessary to tell TYPO3 CMS which templating method to use. It could be any of the following:

  • Fluid templates: Configure TYPO3 to use Extbase and Fluid for templating. This allows to use external HTML templates, but with fluid-style variables with curly braces. A content object FLUIDTEMPLATE is available, which uses Fluid from inside TypoScript.
  • HTML templates: Configure TYPO3 CMS to facilitate external HTML- templates with markers and subparts. Please see the Templating Tutorial.
  • External Templating Engines: Any other templating system can be used. It will be provided via an extension. In such a case TypoScript may be used just to delegate the rendering to that system.
  • Custom PHP: Configure TYPO3 to call your own PHP code which generates content in any way you may prefer. This might include using third party templating engines!
  • TS content objects: Build the page entirely using TypoScript content objects. All these objects are highly configurable.

Entering and structuring TypoScript templates

At its most basic, TypoScript is entered manually in both the "Constants" and "Setup" fields of template records (which are stored in the database in table "sys_template").

A TypoScript template as seen in the Web > List module.
The Constants and Setup fields of a TypoScript template

If the "t3editor" system extension is not installed or has been disabled via configuration options, the "Constants" and "Setup" fields will be normal multi-line text fields.

The Constants and Setup fields without the t3editor enabled
Inclusions

In both the "Constants" and "Setup" fields, the INCLUDE_TYPOSCRIPT syntax can be used to include TypoScript contained inside files.

Apart from this, it is also possible to include other TypoScript template records (in the field called "Include Basis Template") and TypoScript provided by extensions (in the field called "Include static (from extensions)").

Templates included from another template

Included templates can themselves include other templates.

Template Analyzer

With all those inclusions, it may happen that you lose the overview of the template structure. The "Template Analyzer" provides an overview of this structure. It shows all the templates that apply to the currently selected page, taking into account inclusions and inheritance along the page tree.

All templates applying to a page, as used by the Introduction Package

Templates are taken into consideration from top to bottom, which means that properties defined in one template may be overridden in templates considered at a later point by the TypoScript parser.

In the Template Analyzer, you can click on any listed template to view the content of its "Setup" and "Constants" fields.

Viewing the content of a given template in the Template Analyzer

The line numbers are compiled from the first template to be included, which is why the numbers are so high.

Constants

Constants are values defined in the "Constants" field of a template. They follow the syntax of ordinary TypoScript and are case sensitive! They are used to manage in a single place values, which are later used in several places.

Defining constants

Other than constants in programming languages, values of constants in TypoScript can be overwritten. Constants in TypoScript can more be seen as variables in programming languages.

Reserved name

The object or property "file" is always interpreted as data type "resource". That means it refers to a file, which has to be uploaded in the TYPO3 CMS installation.

Multi-line values: The ( ) signs

Constants do not support multiline values!

You can use environment variables to provide instance specific values to your constants. Refer to getEnv for further information.

Example

Here bgCol is set to "red", file.toplogo is set to fileadmin/logo.gif and topimg.file.pic2 is set to fileadmin/logo2.gif, assuming these files are indeed available at the expected location.

bgCol = red
file {
    toplogo = fileadmin/logo.gif
}
topimg {
    width = 200
    file.pic2 = fileadmin/logo2.gif
}

The objects in the highlighted lines contain the reserved word "file" and the properties are always of data type "resource".

Using constants

When a TypoScript Template is parsed by TYPO3 CMS, constants are replaced, as one would perform any ordinary string replacement. Constants are used in the "Setup" field by placing them inside curly braces and prepending them with a $ sign:

{$bgCol}
{$topimg.width}
{$topimg.file.pic2}
{$file.toplogo}

Only constants, which are actually defined in the "Constants" field, are substituted.

Constants in included templates are also substituted, as the whole template is one large chunk of text.

A systematic naming scheme should be used for constants. As "paths" can be defined, it's also possible to structure constants and prefix them with a common path segment. This makes reading and finding of constants easier.

Example
page = PAGE
page {
    typeNum = 0
    bodyTag = <body bgColor="{$bgCol}">
    10 = IMAGE
    10.file = {$file.toplogo}
}

For the above example to work, the constants from the last example have to be defined in the constants field.

Overview of the defined setup

Constants in the setup code are substituted, marked in green. In the Object Browser, it's possible to show constants substituted and unsubstituted.

The "Display constants" function is not available if "Crop lines" is selected.

The Constant Editor

It's possible to add comments in TypoScript. Comments are always ignored by the parser when the template is processed. But the backend module WEB > Template has the ability to use comments in the constant editor to make simple configuration of a template even easier than constants already make it themselves.

The Constant Editor showing some categories with constants

The Constant Editor showing a category with constants

When the "Constant Editor" parses the template, all comments before every constant-definition are registered. A certain syntax is available to define what category the constant should be in, which type it has and to provide a description for the constant.

styles.content.textStyle {
   # cat=content/cText/1; type=; label= Bodytext font: This is the font face used for text!
   face =
   # cat=content/cText/2; type=int[1-5]; label= Bodytext size
   size =
   # cat=content/cText/3; type=color; label= Bodytext color
   color =
   color1 =
   color2 = blue
   properties =
}

In the above example, three constants have syntactically correct comments and will appear in the "Constant Editor". The other three will not. The syntax is described in the rest of this chapter.

Making most important constants available for the "Constant Editor" is a real usability gain.

Default values

A constant may be given a default value when it is defined, as is the case for the color2 constant in the above example.

More generally, the default value of a constant is determined by the value the constant has before the last template is parsed.

Comment Syntax

How the comments are perceived by the module:

  • The comment line before the constant is considered to contain its definition.
  • Each line is split at the ; (semicolon) character, that separates the various parameters
  • Each parameter is split at the = (equal) sign to separate the parameter's key and value.

The possible keys are described below.

cat
  • Comma-separated list of the categories (case-insensitive) that the constant is a member of. Only one category should be used, because it usually turns out to be confusing for users, if the same constant appears in multiple categories.
  • If the chosen category is not found among the default categories listed below, and is not a custom category either, it's regarded a new category.
  • If the category is empty (""), the constant is excluded from the editor.
Predefined categories
Category Description
basic Constants of superior importance for the template. This is typically dimensions, image files and enabling of various features. The most basic constants, which would almost always needed to be configured.
menu Menu setup. This includes font files, sizes, background images. Depending on the menu type.
content All constants related to the display of page content elements.
page General configuration like meta tags, link targets.
advanced Advanced functions, which are seldom used.
Custom categories

To define a new category, a comment including the parameter customcategory has to be added. Example:

# customcategory=mysite=LLL:EXT:myext/locallang.xlf:mysite

This line defines the new category "mysite" which will be available for any constant defined after this line. The LLL: reference points to the localized string used to "name" the custom category in the Constant Editor. Usage example:

#cat=mysite//a; type=boolean; label=Global no_cache
config.no_cache = 0
Subcategories

There are a number of subcategories one can use. Subcategories are entered after the category separated by a slash /. Example:

"basic/color/a"

This will make the constant go into the "BASIC" category and be listed under the "COLOR" section.

One of the predefined subcategories can be used or any custom subcategory. If a non-existing subcategory us used, the constant will go into the subcategory "Other".

Predefined subcategories

Standard subcategories (in the order they get listed in the Constant Editor):

Subcategory Description
enable Used for options that enable or disable primary functions of a template.
dims Dimensions of all kinds; pixels, widths, heights of images, frames, cells and so on.
file Files like background images, fonts and so on. Other options related to the file may also enter.
typo Typography and related constants.
color Color setup. Many colors will be found with related options in other categories though.
links Links: Targets typically.
language Language specific options.

There also exists a list of subcategories based on the default content elements:

cheader, cheader_g, ctext, ctextpic, cimage, cbullets, ctable, cuploads, cmultimedia, cmailform, csearch, clogin, csplash, cmenu, cshortcut, clist, cscript, chtml

These are all categories reserved for options that relate to content rendering for each type of tt_content element. See the static_template of extension "css_styled_content" for examples.

Custom subcategories

Defining a custom subcategory is similar to defining a custom category, using the customsubcategory parameter. Example:

# customsubcategory=cache=LLL:EXT:myext/locallang.xlf:cache

Usage example:

#cat=mysite/cache/a; type=boolean; label=Global no_cache
config.no_cache = 0

Will look in the Constant Editor like this:

The Constant Editor showing a custom category.
Ordering

The third part of the category definition is optional and represents the order in which the constants are displayed in the Constant Editor. The values are sorted alphabetically, so it is traditional to use letters. Example:

#cat=mysite/cache/b; type=boolean; label=Special cache
config.no_cache = 0
#cat=mysite/cache/a; type=boolean; label=Global no_cache
config.no_cache = 0

The "Special cache" constant will be displayed after the "Global no_cache" constant, because it is ranked with letter "b" and the other constant has letter "a". Constants without any ordering information will come last.

type

There exists a number of predefined types, which define what kind of field is rendered for inputting the constant.

Type Description
int [low-high] Integer, optional in range "low" to "high".
int+ Positive integer
offset [L1,L2,...L6] Comma-separated list of integers. Default is "x,y", but as comma separated parameters in brackets one can specify up to 6 labels being comma separated. If wished to omit one of the last 4 fields, leave the label empty for that element.
color HTML color
wrap HTML code that is wrapped around some content.
options [item1,item2,...] Selectbox with values/labels item1, item2 etc. Comma-separated. Split by "=" also and in that case, first part is label, second is value.
boolean [truevalue] Boolean, optional can define the value of "true", default is 1.
comment Boolean, checked= "", not-checked = "#".
string (the default) A string value
user Path to the file and method which renders the option HTML, for example type=user[Vendor\Extension\Namespace\ClassName->myCustomField]. The method should have following signature: public function myCustomField(array $params).
label

The label is a trimmed text string. It gets split on the first : (colon) to separate header and body of the comment. The header is displayed on its own line in bold.

The string can be localized by using the traditional "LLL" syntax. Example:

#cat=Site conf/cache/a; type=boolean; label=LLL:EXT:examples/locallang.xlf:config.no_cache
config.no_cache = 0

Only a single string is referenced, not one for the header and one for the description. This means that the localized string must contain the colon separator (:). Example:

<trans-unit id="config.no_cache" xml:space="preserve">
    <source>Global no_cache: Check the box to turn off all caches.</source>
</trans-unit>

Register

It is possible to store variable values into a memory stack which is called "register". The cObjects LOAD_REGISTER and RESTORE_REGISTER provide this storage functionality. Some TYPO3 cObjects use internal registers. Esp. the menus are built be registers (e.g. count_HMENU, count_HMENU_MENUOBJ, count_menuItems).

Defining registers

Registers in TypoScript can be seen as stack array variables in programming languages. Each register can store a complex TypoScript block. Use LOAD_REGISTER to put a variable to the stack, use RESTORE_REGISTER to pull a variable from the stack and curly braces around a variable name to read the current value of the variable. You need a stdWrap.data or a stdWrap.dataWrap cObject. The registers cannot be read on other places than inside of these cObjects.

Example
10 = COA
10 {
    ### left menu table column
    10 = LOAD_REGISTER
    10 {
        ulClass = col-left
    }

    ### right menu table column
    20 = LOAD_REGISTER
    20 {
        ulClass = col-right
    }

    30 = HMENU
    30 {
        special = list
        special.value = 1
        1 = TMENU
        # ...
        3 = TMENU
        3 {
            stdWrap {
                preCObject = COA
                preCObject {
                    10 = RESTORE_REGISTER
                }
                dataWrap = <ul class="{register:ulClass}">|</ul>
            }
            wrap =
            SPC = 1
            SPC {
                allStdWrap {
                    replacement {
                        10 {
                            search = ---
                            replace =
                        }
                    }
                    dataWrap = </ul>|<ul class="{register:ulClass}">
                }
            }
        }
    }
}

This example shows a part of a TypoScript which builds a 2 column menu based on a spacer page. A class is added to the ul tag depending on the value of the register variable ulClass. The first pages will have the class col-left and the pages following the spacer page will get the class col-right.

{register:variablename} returns the "current" value of the variable variablename. A register stack can be like any TypoScript setup.

10 = COA
10 {
  10 = LOAD_REGISTER
  10 {
      ulClass = col-left
      aClass = a-special
      colors {
          chief = red
          servant = white
      }
  }
}

The "current" value is just an internal variable that can be used by functions to pass a single value on to another function later in the TypoScript processing. It is like "load accumulator" in the good old C64 days. Basically you can use a "register" as you like. The TSref will tell if functions are setting this value before calling some other object so that you know if it holds any special information.

Debugging / Analyzing

Debugging TypoScript can be complicated as there are many influences like the active page and conditions. Also constants can be used which get substituted. The following sections provide information about how to debug TypoScript and how to find errors within TypoScript.

Analyzing defined constants

The TypoScript Object Browser provides an tree view to all defined constants on the currently active page.

Overview of the defined constants
Finding errors

There are no tools that will tell whether the given TypoScript code is 100% correct. The TypoScript Object Browser will warn about syntax errors though:

The TypoScript Object Browser showing a syntax error

Errors will also appear in the Template Analyzer, when viewing the content of a give template. It is also possible to see the full TypoScript code by clicking on the "View the complete TS listing" button at the bottom of the Template Analyzer:

The TypoScript Object Browser showing a syntax error

The result is a long listing with all compiled line numbers, which makes it possible to find the error reported by the TypoScript Object Browser.

The TypoScript Object Browser showing a syntax error

In the frontend, the Admin Panel is another possibility to debug TypoScript; use its section called "TypoScript". It shows selected rendered (configuration) values, SQL queries, error messages and more.

Debugging

TypoScript itself offers a number of debug functions:

Data types

The values assigned to properties in TypoScript are often of a specific format. These formats are described in this chapter.

For example, if a value is defined as the type <tag>, HTML code has to be supplied. If it is of the type resource, it's a reference to a file from the resource-field in the template. If the type is GraphicColor, a color-definition is expected and an HTML color code or comma-separated RGB-values have to be provided.

The following is a list of available data types, their usage, purpose and examples.

align

Data type:
align
Description:
Decides about alignment.
Examples:
left, center, right
Default:
left

boolean

Data type:
boolean
Description:

Possible values for boolean variables are 1 and 0 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.

Examples:
dummy.enable = 0   # false, preferred notation
dummy.enable = 1   # true,  preferred notation
dummy.enable =     # false, because the value is empty

case

Data type:
case
Description:
Do a case conversion.
Possible values:
Value Effect
upper Convert all letters of the string to upper case
lower Convert all letters of the string to lower case
capitalize Uppercase the first character of each word in the string
ucfirst Convert the first letter of the string to upper case
lcfirst Convert the first letter of the string to lower case
uppercamelcase Convert underscored upper_camel_case to UpperCamelCase
lowercamelcase Convert underscored lower_camel_case to lowerCamelCase
Example:

Code:

10 = TEXT
10.value = Hello world!
10.case = upper

Result:

HELLO WORLD!

Object types

These are complex "data types" which contain several member variables. The following types are descerned according to their internal processing:

cObject
Data type:
cObject
Description:
"cObjects" are also called "Content Objects". See the section "Content Objects".
Examples:
TEXT / IMAGE / TEMPLATE ...
frameObj
Data type:
FRAMESET / FRAME
Gifbuilder Object
Description:
See section GIFBUILDER in this manual.
Examples:
TEXT / SHADOW / OUTLINE / EMBOSS / BOX / IMAGE / EFFECT

date-conf

Data type:
date-conf
Description:

Used to format a date, see PHP function date(). The following abbreviations are available:

Abb The abbreviation is expanded to:
a "am" or "pm"
A "AM" or "PM"
d 01 - 31, day of the month, numeric, 2 digits with leading zeros
D day of the week, textual, 3 letters like "Fri"
F month, textual, long, like "January"
h hour, numeric, 12 hour format
H hour, numeric, 24 hour format
i minutes, numeric
j 1 - 31, day of the month, numeric, without leading zeros
l (lowercase 'L'), day of the week, textual, long, like "Friday"
m month, numeric
M month, textual, 3 letters, like "Jan"
s seconds, numeric
S English ordinal suffix, textual, 2 characters, like "th" or "nd"
U seconds since the epoch
Y year, numeric, 4 digits, like "2013"
w day of the week, numeric, 0 represents Sunday
y year, numeric, 2 digits, like "13"
z day of the year, numeric, like "299"
Example:
d-m-y

degree

Data type:
degree
Description:
-90 to 90, integers
Example:
45

dir

Data type:
dir
Syntax:
[path relative to the web root of the site] | [list of valid extensions] | [sorting: name, size, ext, date] | [reverse: "r"] | [return full path: boolean]
Description:
Files matching are returned in a comma-separated string.
Example:

This example returns a list of all pdf, gif and jpg-files from fileadmin/files/ sorted by their name reversely and with the full path (with fileadmin/files/ prepended):

fileadmin/files/ | pdf,gif,jpg | name | r | true

function name

Data type:
function name
Description:

Indicates a function or method in a class to call. See more information at the USER cObject.

Depending on implementation the class or function name, but not the method name, should probably be prefixed with user_. The prefix can be changed in the $GLOBALS['TYPO3_CONF_VARS'] config though. The function / method is normally called with 2 parameters, $conf which is the TypoScript configuration and $content, some content to be processed and returned.

If a method in a class is called, it is checked (when using the USER/USER_INT objects) whether a class with the same name, but prefixed with ux_ is present and if so, this class is instantiated instead. See the document "Inside TYPO3" for more information on extending classes in TYPO3!

Examples:

Method in class, namespaced and preferred version:

Your\NameSpace\YourClass->reverseString

Single Function:

user_reverseString

Method in class:

user_stringReversing->reverseString

getText

Data type:
getText
Description:

The getText data type is some kind of tool box allowing to retrieve values from a variety of sources, e.g. from GET/POST variables, from registers, values from the page tree, items in the page menus, records from any database table, etc.

The general syntax is as follows:

key : code

where key indicates the source and code is some form of path or pointer to the value, which depends on the key used. The various keys and their possible codes are described below.

The code can contain pipe characters | to separate keys in a multi-dimensional array. This e.g. works with TSFE:

foo = TSFE : fe_user|user|username

Some codes work with different separator, which is documented right at the code. Spaces around the colon (:) are irrelevant. The key is case-insensitive.

By separating the value of getText with // (double slash) a number of codes can be supplied and getText will return the first one, which is not empty ("" or zero).

To get the content of the field "header". If "header is empty, "title" is retrieved. If "title" is empty as well, it finally gets the field "uid":

foo = field : header // field : title // field : uid
cObj
getText Key:
cObj
Description:

For CONTENT and RECORDS cObjects that are returned by a select query, this returns the row number (1,2,3,...) of the current cObject record.

parentRecordNumber is the only key available.

Example:

Get the number of the current cObject record:

foo = cObj : parentRecordNumber
context
getText Key:
context
Description:

access values from context API (see). If a property is an array, it is converted into a comma-separated list.

Syntax:

data = context:[aspectName]:[propertyName]
Example:

Retrieve current workspace id:

page.10 = TEXT
page.10.data = context:workspace:id
page.10.wrap = You are in workspace: |
current
getText Key:
current
Description:
current (gets the "current" value)
Example:

Get the current value:

foo = current
date
getText Key:
date
Description:
Can be used with a colon and date-conf.
Default:
d/m Y
Example:

Get the current time formatted dd-mm-yy:

foo = date : d-m-y
DB
getText Key:
DB
Syntax:
DB : [table name] : [uid] : [field]
Description:

Value from database. Any record from a table in TCA can be selected here. Records marked as deleted will not return any value.

In contrast to other keys, colons are used here to get deeper into the structure, instead of pipes.

Example:

Get the value of the header field of record with uid 234 from table "tt_content":

foo = DB : tt_content:234:header
debug
getText Key:
debug
Description:
Returns HTML-formatted content of the PHP variable defined by the keyword. Available keywords are rootLine, fullRootLine, data, register and page.
Example:

Outputs the current root-line visually in HTML:

foo = debug : rootLine
field
getText Key:
field
Syntax:
field : [field name from the current $cObj->data array in the cObject, multi-dimensional.]
Description:

This gives read access to the current value of an internal global variable determined by the given key.

  • As default the $cObj->data array is $GLOBALS['TSFE']->page (record of the current page)
  • In TMENU $cObj->data is set in a loop to the page-record for each menu item during its rendering process.
  • In CONTENT / RECORDS $cObj->data is set to the actual record
  • In GIFBUILDER $cObj->data is set to the data GIFBUILDER is supplied with.
Examples:

Get content from $cObj->data['header']:

foo = field : header

Get content from $cObj->data['fieldname']['level1']['level2']:

foo = field : fieldname|level1|level2
file
getText Key:
file
Syntax:
file : [uid] : [property]
Description:

Retrieves a property from a file object (FAL) by identifying it through its sys_file UID. Note that during execution of the FILES cObject, it's also possible to reference the current file with "current" as UID like file : current : size.

The following properties are available: name, uid, originalUid, size, sha1, extension, mimetype, contents, publicUrl, modification_date, creation_date

Furthermore when manipulating references (such as images in content elements or media in pages), additional properties are available (not all are available all the time, it depends on the setup of references of the FILES cObject): title, description, link, alternative.

Additionally, any data in the "sys_file_metadata" table can be accessed too.

See the FILES cObject for usage examples.

Example:

Get the file size of the file with the sys_file UID 17:

foo = file : 17 : size
flexform
getText Key:
flexform
Syntax:
flexform : [field containing flexform data].[property of this flexform]
Description:
Access values from flexforms, e.g. inside of tt_content record. In contrast to most parts, deeper levels are accessed through dots, not pipes.
Example:

Return the flexform value of given name:

foo = flexform : pi_flexform:settings.categories
fullRootLine
getText Key:
fullRootLine
Syntax:
fullRootLine : [pointer, integer], [field name], ["slide"]
Description:

This property can be used to retrieve values from "above" the current page's root. Take the below page tree and assume that we are on the page "Here you are!". Using the levelfield property, it is possible to go up only to the page "Site root", because it is the root of a new (sub-)site. With fullRootLine it is possible to go all the way up to page tree root. The numbers between square brackets indicate to which page each value of pointer would point to:

- Page tree root [-2]
|- 1. page before [-1]
   |- Site root (root template here!) [0]
   |- Here you are! [1]

A "slide" parameter can be added just as for the levelfield property.

Example:

Get the title of the page right before the start of the current website:

foo = fullRootLine : -1, title
getenv
getText Key:
getenv
Description:

Value from PHP environment variables.

For a cached variation of this feature, please refer to getEnv.

Example:

Get the env var HTTP_REFERER:

foo = getenv : HTTP_REFERER
getIndpEnv
getText Key:
getIndpEnv
Syntax:
getIndpEnv : <name>
Description:

Returns the value of a System Environment Variable denoted by name regardless of server OS, CGI/MODULE version etc. The result is identical to the $_SERVER variable in most cases. This method should be used instead of getEnv to get reliable values for all situations. The internal processing is handled by TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv()

Available names:

Name Definition Example or result
_ARRAY Return an array with all available key-value pairs for debugging purposes  
HTTP_ACCEPT_LANGUAGE language(s) accepted by client  
HTTP_HOST [host][:[port]] 192.168.1.4:8080
HTTP_REFERER [scheme]://[host][:[port]][path] http://192.168.1.4:8080/typo3/32/temp/phpcheck/index.php/arg1/arg2/arg3/?arg1,arg2,arg3&p1=parameter1&p2[key]=value
HTTP_USER_AGENT client user agent  
PATH_INFO [path_info] /arg1/arg2/arg3/
QUERY_STRING [query] arg1,arg2,arg3&p1=parameter1&p2[key]=value
REMOTE_ADDR client IP  
REMOTE_HOST client host  
REQUEST_URI [path]?[query] /typo3/32/temp/phpcheck/index.php/arg1/arg2/arg3/?arg1,arg2,arg3&p1=parameter1&p2[key]=value
SCRIPT_FILENAME absolute filename of script  
SCRIPT_NAME [path_script] /typo3/32/temp/phpcheck/[index.php]
TYPO3_DOCUMENT_ROOT absolute path of root of documents  
TYPO3_HOST_ONLY [host] 192.168.1.4
TYPO3_PORT [port] 8080
TYPO3_REQUEST_DIR [scheme]://[host][:[port]][path_dir]  
TYPO3_REQUEST_HOST [scheme]://[host][:[port]]  
TYPO3_REQUEST_SCRIPT [scheme]://[host][:[port]][path_script]  
TYPO3_REQUEST_URL [scheme]://[host][:[port]][path]?[query]  
TYPO3_REV_PROXY TRUE if this session runs over a well known proxy  
TYPO3_SITE_SCRIPT [script / Speaking URL] of the TYPO3 website  
TYPO3_SITE_URL [scheme]://[host][:[port]][path_dir] of the TYPO3 website frontend  
TYPO3_SSL TRUE if this session uses SSL/TLS (https)  
Examples:
# get and output the client IP
page = PAGE
page.10 = TEXT
page.10.stdWrap.data = getIndpEnv : REMOTE_ADDR
page.10.stdWrap.htmlSpecialChars = 1
global
getText Key:
global
Syntax:
global : [variable]
Description:
Deprecated, use GP, TSFE or getenv.
GP
getText Key:
GP
Syntax:
GP : [Value from GET or POST method]
Description:
Get an variable from $_GET or $_POST where a variable, which exists in both arrays, is returned from $_POST.
Examples:

Get input value from query string &stuff=...:

foo = GP : stuff

Get input value from query string &stuff[bar]=...:

foo = GP : stuff|bar
level
getText Key:
level
Description:
Get the root line level of the current page.
Example:

Get the root line level of the current page:

foo = level
levelfield
getText Key:
levelfield
Syntax:
levelfield : [pointer, integer], [field name], ["slide"]
Description:
levelfield: Like leveltitle, leveluid, levelmedia et al. but where the second parameter is the root line field to fetch.
Example:

Get the value of the user defined field user_myExtField in the root line. Requires additional configuration in $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] to include field.:

foo = levelfield : -1, user_myExtField, slide
leveltitle, leveluid, levelmedia
getText Key:
leveltitle, leveluid or levelmedia
Syntax:
leveltitle, leveluid, levelmedia: [levelTitle, uid or media in root line, 0- , negative = from behind, " , slide" parameter forces a walk to the bottom of the root line until there's a "true" value to return. Useful with levelmedia.]
Description:
Returns values from up or down the page tree.
Examples:

Get the title of the page on the first level of the root line:

foo = leveltitle : 1

Get the title of the page on the level right below the current page AND if that is not present, walk to the bottom of the root line until there's a title:

foo = leveltitle : -2, slide

Get the id of the root-page of the website (level zero):

foo = leveluid : 0
LLL
getText Key:
LLL
Description:
LLL: Reference to a locallang (xlf, xml or php) label. Reference consists of [fileref]:[labelkey]
Example:

Get localized label for logout button:

foo = LLL : EXT:felogin/pi1/locallang.xlf:logout
page
getText Key:
page
Description:
page: [field in the current page record]
Example:

Get the current page title:

foo = page : title
pagelayout
getText Key:
pagelayout
Description:
pagelayout
Example:

Get the current backend layout:

foo = pagelayout
parameters
getText Key:
parameters
Syntax:
parameters: [field name from the current $cObj->parameters array in the cObject.]
Description:
See parseFunc.
Example:

Get content from $cObj->parameters['color']:

foo = parameters : color
path
getText Key:
path
Description:
Path to a file, possibly placed in an extension, returns empty if the file does not exist.
Example:

Get path to file rsaauth.js (inside extension rsaauth) relative to siteroot:

foo = path : EXT:rsaauth/resources/rsaauth.js
register
getText Key:
register
Syntax
register: [field name from the $GLOBALS['TSFE']->register]
Description:
See LOAD_REGISTER.
Example:

Get content from $GLOBALS['TSFE']->register['color']:

foo = register : color
session
getText Key:
session
Syntax:
session : [key]
Description:
The key refers to the session key used to store the value.
Example:

Get the number of items of a stored shopping cart array/object:

foo = session : shop_cart|itemCount
TSFE
getText Key:
TSFE
Syntax:
TSFE: [value from the $GLOBALS['TSFE'] array, multi-dimensional]
Description:
Returns a value from TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController.
Example:

Get the "username" field of the current FE user:

foo = TSFE : fe_user|user|username

GraphicColor

Data type:
GraphicColor
Syntax:

[colordef] : [modifier]

Where modifier can be an integer which is added or subtracted to the three RGB-channels or a floating point with an * before, which will then multiply the values with that factor.

Description:
The color can be given as HTML-color or as a comma-separated list of RGB-values (integers). An extra parameter can be given, that will modify the color mathematically:
Examples:

red (HTML-color)

#ffeecc (HTML-color)

255,0,255 (RGB-integers)

Extra:

red : *0.8 ("red" is darkened by factor 0.8)

#ffeecc : +16 ("ffeecc" is going to #fffedc because 16 is added)

HTML code

Data type:
HTML code
Description:
Pure HTML code
Example:
<b>Some text in bold</b>

HTML-color

Data type:
HTML-color
Description:

Named colors or color codes.

Some HTML color codes are:

Color name Hexadecimal code
Black #000000
Silver #C0C0C0
Gray #808080
White #FFFFFF
Maroon #800000
Red #FF0000
Purple #800080
Fuchsia #FF00FF
Green #008000
Lime #00FF00
Olive #808000
Yellow #FFFF00
Navy #000080
Blue #0000FF
Teal #008080
Aqua #00FFFF
Examples:

red

#ffeecc

imageExtension

Data type:
imageExtension
Description:

Image extensions can be anything among the allowed types defined in the global variable $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']. Standard is pdf, gif, jpg, jpeg, tif, bmp, ai, pcx, tga, png.

The value "web" is special. This will just ensure that an image is converted to a web image format (gif or jpg) if it happens not to be already!

Examples:

jpg

web (gif or jpg ..)

imgResource

Data type:
imgResource
Description:
  1. A resource plus imgResource properties.

    Filetypes can be anything among the allowed types defined in the configuration variable $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']. Standard is pdf, gif, jpg, jpeg, tif, bmp, ai, pcx, tga, png.

  2. A GIFBUILDER object. See the object reference for GIFBUILDER below.

Examples:

Here "file" is an imgResource:

10 = IMAGE
10 {
    file = fileadmin/toplogo.gif
    file.width = 200
}

GIFBUILDER:

10 = IMAGE
10.file = GIFBUILDER
10.file {
    # GIFBUILDER properties here...
}

integer

Data type:
integer / int
Examples:
42, -8, -9, 0
Description:
This data type is sometimes used generally though another type would have been more appropriate, like pixels.

linkWrap

Data type:
linkWrap
Syntax:
<.. {x}.> | </...>
Description:

{x}; x is an integer (0-9) and points to a key in the PHP array root line. The key is equal to the level the current page is on measured relatively to the root of the website.

If the key exists the uid of the level that key pointed to is inserted instead of {x}.

Thus we can insert page_ids from previous levels.

Example:

This will make a link to the root-level of a website:

<a href="?id={0}"> | </a>

list

Data type:
list
Description:
List of values, comma separated. Values are trimmed, leading whitespace is therefore ignored before and after each comma.
Example:
item,item2,item3

margins

Data type:
margins
Syntax:
left, top, right, bottom
Example:

This sets margin-left to 10 and margin-bottom to 5. Top and right are not set (zero):

10,0,0,5

page_id

Data type:
page_id
Description:
A page id (integer) or this (=current page id).
Examples:
this
34

path

Data type:
path
Description:
Path relative to the root directory from which we operate.
Example:
fileadmin/stuff/

pixels

Data type:
pixels
Description:
pixel-distance
Example:
345

positive integer

Data type:
positive integer / posint / int+
Description:
Positive integer.
Examples:
42, 8, 9

resource

Data type:
resource
Description:
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.
Example:

Reference to a file in the file system:

fileadmin/picture.gif

rotation

Data type:
rotation
Description:
integer, degrees from 0 - 360
Example:
180

space

Data type:
space
Syntax:
"space before | space after"
Description:
Used for content and sets the according number of pixels space "before | after".
Example:
5 | 5

strftime-conf

Data type:
strftime-conf
Description:
Abb The abbreviation is expanded to:
%a abbreviated weekday name according to the current locale
%A full weekday name according to the current locale
%b abbreviated month name according to the current locale
%B full month name according to the current locale
%c preferred date and time representation for the current locale
%C century number (the year divided by 100 and truncated to an integer, range 00 to 99)
%d day of the month as a decimal number (range 00 to 31)
%D same as %m/%d/%y
%e day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31'). Note that the %e modifier is not supported in the Windows implementation of 'strftime'.
%h same as %b
%H hour as a decimal number using a 24-hour clock (range 00 to 23)
%I hour as a decimal number using a 12-hour clock (range 01 to 12)
%j day of the year as a decimal number (range 001 to 366)
%m month as a decimal number (range 01 to 12)
%M minute as a decimal number
%n newline character
%p either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
%r time in a.m. and p.m. notation
%R time in 24 hour notation
%S second as a decimal number
%t tab character
%T current time, equal to %H:%M:%S
%u weekday as a decimal number [1,7], with 1 representing Monday
%U week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week
%V The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.
%W week number of the current year as a decimal number, starting with the first Monday as the first day of the first week
%w day of the week as a decimal, Sunday being 0
%x preferred date representation for the current locale without the time
%X preferred time representation for the current locale without the date
%y year as a decimal number without a century (range 00 to 99)
%Y year as a decimal number including the century
%Z time zone or name or abbreviation
%% a literal `%' character
Examples:

Date "DD-MM-YY" =

%e:%m:%y

Time "HH:MM:SS" =

%H:%M:%S

or just

%T

string

Data type:
string / str / value
Description:
Sometimes used generally though another type would have been more appropriate, like "align".
Example:
The quick brown fox jumps over the lazy dog.

<tag>

Data type:
<tag>
Description:
An HTML tag.
Example:
<body lang="de">

<tag>-data

Data type:
<tag>-data
Examples:

<frameset>-data: row

could be '150,*'

<tag>-params

Data type:
<tag>-params
Description:
Parameters for a tag.
Example:

For <frameset>-params:

border="0" framespacing="0"

target

Data type:
target
Examples:
_top, _blank, content
Description:

Target in an <a>-tag.

This is normally the same value as the name of the root-level object that defines the frame.

UNIX-time

Data type:
UNIX-time
Description:
Seconds since January 1st 1970.
Example:

Seconds to May 09th 2016 12:34:

1462790096

VHalign

Data type:
VHalign
Description:

Pair of values separated by a comma. The first value determines the horizontal alignment, the second one the vertical alignment.

Possible values:

  • r/c/l
  • t/c/b

Horizontal values standing for: right, center, left

Vertical values standing for: top, center, bottom

Default:
l , t
Example:

Horizontal alignment = right and Vertical alignment = center:

r , c

wrap

Data type:
wrap
Syntax:
<...> | </...>
Description:

Used to wrap something. The vertical bar ("|") is the place, where your content will be inserted; the parts on the left and right of the vertical line are placed on the left and right side of the content.

Spaces between the wrap-parts and the divider ("|") are trimmed off from each part of the wrap.

If you want to use more sophisticated data functions, then you should use stdWrap.dataWrap instead of wrap.

A wrap is processed and rendered as the last of the other components of a cObject.

Example:

This will cause the value to be wrapped in a p-tag coloring the value red:

<p style="color: red;"> | </p>

x,y,w,h

Data type:
x,y,w,h
Description:

x,y is the offset from the upper left corner.

w,h is the width and height

Example:
10,10,5,5

Objects and properties

Introduction

Reference to objects

Whenever you see ->[object name] in the tables it means that the property is an object "object name" with properties from object object name. You don't need to define the object type. You will often find the according documentation on its own page.

Calc

Calculating values (+calc)

Sometimes a data type is set to "something +calc". "+calc" indicates that the value is calculated with "+-/*". Be aware that the operators have no "weight". The calculation is just done from left to right.

calc example:
45 + 34 * 2 = 158
(which is the same as this in ordinary arithmetic: (45+34)*2=158)

optionSplit

Introduction

optionSplit is the codename of a very tricky - but very useful! - function and functionality. It is primarily used with the menu objects where it is enable for MANY properties. This make optionSplit really powerful.

So let's take an example from menu building. As a result all A-tags generated from this definition will have the class attribute set like this: <a class="z" ... >:

topmenu.1.NO {
    ATagParams = class="z"
}

How many A-tags will there be? Usually we cannot answer that question in advance as we cannot know how long the list of menu items is. From zero to many everything is possible. Let's describe this as: We have an output sequence of 0 to N items.

In real life one more thing is important: We often want to have a different properties for the first and the last or odd and even elements. optionSplit tries to offer an easy solution for this task as well. We can specify more than just one shaping of a value for a property. Let's describe this as: We have an input sequence M items.

Now we can precisely define what optionSplit is.

Definition:
optionSplit is a syntax to define an input sequence of a fixed amount M of values. It has a fixed, builtin ruleset. Its functionality is to apply ONE of the input values to each output item according to the position of the output item and the ruleset.

In other words:

  1. We have an input sequence of M items. M is known.
  2. We have an output sequence of 0 to N items. N is unknown and may be zero, one, or "large".
  3. We have a ruleset delivered with optionSplit that specifies how the input sequence should be applied to the output sequence.

In the following we'll try to shed light on this.

PHP-Code

Lookout for usages of the function \TYPO3\CMS\Core\TypoScript\TemplateService::splitConfArray().

Terminology

It's useful to agree about some terms first: delimiter string, mainpart, subpart.

Mainparts

optionSplit uses the string |*| to split the total string into mainparts. Up to three mainparts will be used. If there are more they will be ignored. On the input side we may have for example:

wrap =                      We have: M=0  items; 1  mainpart : A      ; mainpart is empty
wrap = A                    We have: M=1  items; 1  mainpart : A      ;
wrap = A |*| R              We have: M=2  items; 2  mainparts: A, R   ;
wrap = A |*| R |*| Z        We have: M=3  items; 3  mainparts: A, R, Z;
wrap = A |*| R |*| Z |*| X  We have: M=3! items; 3! mainparts: A, R, Z; only two delimiters are important
Our terminology:
A always implies that it's the first mainpart.
R stands for a second mainpart.
Z denotes the third mainpart.

Viewed from the perspective of how many mainpart delimiters |*| we have the cases:

  1. We have only mainpart A if there is no |*|.
  2. We have mainparts A and R if |*| occurs exactly once.
  3. We have mainparts A, R and Z if |*| occurs - at least - twice.
Subparts

Each mainpart may be split further into subparts. The delimiter for splitting a mainpart into subparts is ||.

Example:

wrap = a                       We have: M=1  item,  1 mainpart,  1 subparts
wrap = a || b                  We have: M=2  items, 1 mainpart,  2 subparts
wrap = a || b || c             We have: M=3  items, 1 mainpart,  3 subparts
wrap = a || b || c || d        We have: M=4  items, 1 mainpart,  4 subparts
wrap = a || b || c || d || ... We have: M>4  items, 1 mainpart, >4 subparts

Rule: There can be any number of subparts.

Full example to see how it works

Let's look at a full example that visualizes what we have said so far.

Three by three items

We have all three mainparts A, R and Z. And each mainpart is split into three subparts:

wrap = a || b || c  |*|  r || s || t  |*|  x || y || z

Mainpart A (the first one) consists of the three subparts a, b, c.

Mainpart R (the second one) consists of the three subparts r, s, t.

Mainpart Z (the third one) consists of the three subparts x, y, z.

And this is what happens:

input:
   wrap = a || b || c  |*|  r || s || t  |*|  x || y || z

output:
    N     output sequence
    1     z
    2     y z
    3     x y z
    4     a x y z
    5     a b x y z
    6     a b c x y z
    7     a b c r x y z
    8     a b c r s x y z
    9     a b c r s t x y z
   10     a b c r s t r x y z
   11     a b c r s t r s x y z
   12     a b c r s t r s t x y z
   13     a b c r s t r s t r x y z
   14     a b c r s t r s t r s x y z
   15     a b c r s t r s t r s t x y z
   16     a b c r s t r s t r s t r x y z
   17     a b c r s t r s t r s t r s x y z
   18     a b c r s t r s t r s t r s t x y z
   19     a b c r s t r s t r s t r s t r x y z
   20     a b c r s t r s t r s t r s t r s x y z
The optionSplit ruleset

From the full example we can deduce the builtin ruleset:

  1. The items of mainpart Z are used first.
  2. The items of mainpart A are used second.
  3. The items of mainpart R are used third.
  4. The order in which input items appear in the output is from left to right exactly as in the input.
  5. For mainpart Z the start position is as close to the end as possible.
  6. For mainpart A subparts are taken from the beginning.
  7. For mainpart R subparts are taken from the beginning and the whole sequence R is repeated from the beginning as long as necessary.
More Examples
Three by two items

Rules 1 to 7 define this behavior:

input:
   wrap = a || b  |*|  r || s  |*|  y || z

output:
    N     output sequence
    1     z
    2     y z
    3     a y z
    4     a b y z
    5     a b r y z
    6     a b r s y z
    7     a b r s r y z
    8     a b r s r s y z
    9     a b r s r s r y z
   10     a b r s r s r s y z
   11     a b r s r s r s r y z
   12     a b r s r s r s r s y z
   13     a b r s r s r s r s r y z
   14     a b r s r s r s r s r s y z
   15     a b r s r s r s r s r s r y z
   16     a b r s r s r s r s r s r s y z
   17     a b r s r s r s r s r s r s r y z
   18     a b r s r s r s r s r s r s r s y z
   19     a b r s r s r s r s r s r s r s r y z
   20     a b r s r s r s r s r s r s r s r s y z
Three by one items

And again:

input:
   wrap = a   |*|  r   |*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a r z
    4     a r r z
    5     a r r r z
    6     a r r r r z
    7     a r r r r r z
    8     a r r r r r r z
    9     a r r r r r r r z
   10     a r r r r r r r r z
   11     a r r r r r r r r r z
   12     a r r r r r r r r r r z
   13     a r r r r r r r r r r r z
   14     a r r r r r r r r r r r r z
   15     a r r r r r r r r r r r r r z
   16     a r r r r r r r r r r r r r r z
   17     a r r r r r r r r r r r r r r r z
   18     a r r r r r r r r r r r r r r r r z
   19     a r r r r r r r r r r r r r r r r r z
   20     a r r r r r r r r r r r r r r r r r r z
Two by three items

Now the mainpart delimiter |*| occurs only once. So we are dealing with the first two mainparts A and R.

According to rules 1 to 7 we get:

input:
   wrap = a || b || c  |*|  r || s || t

output:
    N     output sequence
    1     a
    2     a b
    3     a b c
    4     a b c r
    5     a b c r s
    6     a b c r s t
    7     a b c r s t r
    8     a b c r s t r s
    9     a b c r s t r s t
   10     a b c r s t r s t r
   11     a b c r s t r s t r s
   12     a b c r s t r s t r s t
   13     a b c r s t r s t r s t r
   14     a b c r s t r s t r s t r s
   15     a b c r s t r s t r s t r s t
   16     a b c r s t r s t r s t r s t r
   17     a b c r s t r s t r s t r s t r s
   18     a b c r s t r s t r s t r s t r s t
   19     a b c r s t r s t r s t r s t r s t r
   20     a b c r s t r s t r s t r s t r s t r s
Two by two items

According to rules 1 to 7 we get:

input:
   wrap = a || b  |*|  r || s

output:
    N     output sequence
    1     a
    2     a b
    3     a b r
    4     a b r s
    5     a b r s r
    6     a b r s r s
    7     a b r s r s r
    8     a b r s r s r s
    9     a b r s r s r s r
   10     a b r s r s r s r s
   11     a b r s r s r s r s r
   12     a b r s r s r s r s r s
   13     a b r s r s r s r s r s r
   14     a b r s r s r s r s r s r s
   15     a b r s r s r s r s r s r s r
   16     a b r s r s r s r s r s r s r s
   17     a b r s r s r s r s r s r s r s r
   18     a b r s r s r s r s r s r s r s r s
   19     a b r s r s r s r s r s r s r s r s r
   20     a b r s r s r s r s r s r s r s r s r s
Two by one items

According to rules 1 to 7 we get:

input:
   wrap = a  |*|  r

output:
    N     output sequence
    1     a
    2     a r
    3     a r r
    4     a r r r
    5     a r r r r
    6     a r r r r r
    7     a r r r r r r
    8     a r r r r r r r
    9     a r r r r r r r r
   10     a r r r r r r r r r
   11     a r r r r r r r r r r
   12     a r r r r r r r r r r r
   13     a r r r r r r r r r r r r
   14     a r r r r r r r r r r r r r
   15     a r r r r r r r r r r r r r r
   16     a r r r r r r r r r r r r r r r
   17     a r r r r r r r r r r r r r r r r
   18     a r r r r r r r r r r r r r r r r r
   19     a r r r r r r r r r r r r r r r r r r
   20     a r r r r r r r r r r r r r r r r r r r
One by one items

With no delimiters at all we still have - implicitly - one mainpart A with one subpart a:

input:
   wrap = a

output:
    N     output sequence
    1     a
    2     a a
    3     a a a
    4     a a a a
    5     a a a a a
    6     a a a a a a
    7     a a a a a a a
    8     a a a a a a a a
    9     a a a a a a a a a
   10     a a a a a a a a a a
   11     a a a a a a a a a a a
   12     a a a a a a a a a a a a
   13     a a a a a a a a a a a a a
   14     a a a a a a a a a a a a a a
   15     a a a a a a a a a a a a a a a
   16     a a a a a a a a a a a a a a a a
   17     a a a a a a a a a a a a a a a a a
   18     a a a a a a a a a a a a a a a a a a
   19     a a a a a a a a a a a a a a a a a a a
   20     a a a a a a a a a a a a a a a a a a a a
One by two items

One mainpart A with two subparts a and b:

input:
   wrap = a || b

output:
    N     output sequence
    1     a
    2     a b
    3     a b b
    4     a b b b
    5     a b b b b
    6     a b b b b b
    7     a b b b b b b
    8     a b b b b b b b
    9     a b b b b b b b b
   10     a b b b b b b b b b
   11     a b b b b b b b b b b
   12     a b b b b b b b b b b b
   13     a b b b b b b b b b b b b
   14     a b b b b b b b b b b b b b
   15     a b b b b b b b b b b b b b b
   16     a b b b b b b b b b b b b b b b
   17     a b b b b b b b b b b b b b b b b
   18     a b b b b b b b b b b b b b b b b b
   19     a b b b b b b b b b b b b b b b b b b
   20     a b b b b b b b b b b b b b b b b b b b
One by three items

More:

input:
   wrap = a || b || c

output:
    N     output sequence
    1     a
    2     a b
    3     a b c
    4     a b c c
    5     a b c c c
    6     a b c c c c
    7     a b c c c c c
    8     a b c c c c c c
    9     a b c c c c c c c
   10     a b c c c c c c c c
   11     a b c c c c c c c c c
   12     a b c c c c c c c c c c
   13     a b c c c c c c c c c c c
   14     a b c c c c c c c c c c c c
   15     a b c c c c c c c c c c c c c
   16     a b c c c c c c c c c c c c c c
   17     a b c c c c c c c c c c c c c c c
   18     a b c c c c c c c c c c c c c c c c
   19     a b c c c c c c c c c c c c c c c c c
   20     a b c c c c c c c c c c c c c c c c c c
One by four items

More:

input:
   wrap = a || b || c || d

output:
    N     output sequence
    1     a
    2     a b
    3     a b c
    4     a b c d
    5     a b c d d
    6     a b c d d d
    7     a b c d d d d
    8     a b c d d d d d
    9     a b c d d d d d d
   10     a b c d d d d d d d
   11     a b c d d d d d d d d
   12     a b c d d d d d d d d d
   13     a b c d d d d d d d d d d
   14     a b c d d d d d d d d d d d
   15     a b c d d d d d d d d d d d d
   16     a b c d d d d d d d d d d d d d
   17     a b c d d d d d d d d d d d d d d
   18     a b c d d d d d d d d d d d d d d d
   19     a b c d d d d d d d d d d d d d d d d
   20     a b c d d d d d d d d d d d d d d d d d
More examples: Tricky stuff
Three items A, no item R, three items Z

In this situation with still have three mainparts. We can tell this from the fact that we have TWO occurrences of the mainpart delimiter. And the second mainpart R is really empty.

As result we get:

input:
   wrap = a || b || c  |*||*|  x || y || z

output:
    N     output sequence
    1     z
    2     y z
    3     x y z
    4     a x y z
    5     a b x y z
    6     a b c x y z
    7     a b c c x y z
    8     a b c c c x y z
    9     a b c c c c x y z
   10     a b c c c c c x y z
   11     a b c c c c c c x y z
   12     a b c c c c c c c x y z
   13     a b c c c c c c c c x y z
   14     a b c c c c c c c c c x y z
   15     a b c c c c c c c c c c x y z
   16     a b c c c c c c c c c c c x y z
   17     a b c c c c c c c c c c c c x y z
   18     a b c c c c c c c c c c c c c x y z
   19     a b c c c c c c c c c c c c c c x y z
   20     a b c c c c c c c c c c c c c c c x y z

`optionSplit` rules:

  1. If mainpart R is empty the last subpart of A is repeated.
One item A, no item R, one items Z

With rules 1 to 8 we get:

input:
   wrap = a  |*||*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a a z
    4     a a a z
    5     a a a a z
    6     a a a a a z
    7     a a a a a a z
    8     a a a a a a a z
    9     a a a a a a a a z
   10     a a a a a a a a a z
   11     a a a a a a a a a a z
   12     a a a a a a a a a a a z
   13     a a a a a a a a a a a a z
   14     a a a a a a a a a a a a a z
   15     a a a a a a a a a a a a a a z
   16     a a a a a a a a a a a a a a a z
   17     a a a a a a a a a a a a a a a a z
   18     a a a a a a a a a a a a a a a a a z
   19     a a a a a a a a a a a a a a a a a a z
   20     a a a a a a a a a a a a a a a a a a a z
One item A, one (unexpected!?) item R, one item Z

Attention

To really make mainpart R empty there must not be a space in the middle of |*||*|!

What happens if there IS a space? Normal behavior of a three by one case!

input:
   wrap = a  |*| |*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a  z
    4     a   z
    5     a    z
    6     a     z
    7     a      z
    8     a       z
    9     a        z
   10     a         z
   11     a          z
   12     a           z
   13     a            z
   14     a             z
   15     a              z
   16     a               z
   17     a                z
   18     a                 z
   19     a                  z
   20     a                   z
More
input:
   wrap = |*||*|  z

output:
    N     output sequence
    1     z
    2     z z
    3     z z z
    4     z z z z
    5     z z z z z
    6     z z z z z z
    7     z z z z z z z
    8     z z z z z z z z
    9     z z z z z z z z z
   10     z z z z z z z z z z
   11     z z z z z z z z z z z
   12     z z z z z z z z z z z z
   13     z z z z z z z z z z z z z
   14     z z z z z z z z z z z z z z
   15     z z z z z z z z z z z z z z z
   16     z z z z z z z z z z z z z z z z
   17     z z z z z z z z z z z z z z z z z
   18     z z z z z z z z z z z z z z z z z z
   19     z z z z z z z z z z z z z z z z z z z
   20     z z z z z z z z z z z z z z z z z z z z
input:
   wrap = |*| |*|  z

output:
    N     output sequence
    1     z
    2      z
    3       z
    4        z
    5         z
    6          z
    7           z
    8            z
    9             z
   10              z
   11               z
   12                z
   13                 z
   14                  z
   15                   z
   16                    z
   17                     z
   18                      z
   19                       z
   20                        z
input:
   wrap = |*| r || s || t  |*|

output:
    N     output sequence
    1     r
    2     r s
    3     r s t
    4     r s t r
    5     r s t r s
    6     r s t r s t
    7     r s t r s t r
    8     r s t r s t r s
    9     r s t r s t r s t
   10     r s t r s t r s t r
   11     r s t r s t r s t r s
   12     r s t r s t r s t r s t
   13     r s t r s t r s t r s t r
   14     r s t r s t r s t r s t r s
   15     r s t r s t r s t r s t r s t
   16     r s t r s t r s t r s t r s t r
   17     r s t r s t r s t r s t r s t r s
   18     r s t r s t r s t r s t r s t r s t
   19     r s t r s t r s t r s t r s t r s t r
   20     r s t r s t r s t r s t r s t r s t r s
input:
   wrap = a || b || c  |*||*|

output:
    N     output sequence
    1     a
    2     a b
    3     a b c
    4     a b c c
    5     a b c c c
    6     a b c c c c
    7     a b c c c c c
    8     a b c c c c c c
    9     a b c c c c c c c
   10     a b c c c c c c c c
   11     a b c c c c c c c c c
   12     a b c c c c c c c c c c
   13     a b c c c c c c c c c c c
   14     a b c c c c c c c c c c c c
   15     a b c c c c c c c c c c c c c
   16     a b c c c c c c c c c c c c c c
   17     a b c c c c c c c c c c c c c c c
   18     a b c c c c c c c c c c c c c c c c
   19     a b c c c c c c c c c c c c c c c c c
   20     a b c c c c c c c c c c c c c c c c c c
input:
   wrap = |*||*|  x || y || z

output:
    N     output sequence
    1     z
    2     y z
    3     x y z
    4     x x y z
    5     x x x y z
    6     x x x x y z
    7     x x x x x y z
    8     x x x x x x y z
    9     x x x x x x x y z
   10     x x x x x x x x y z
   11     x x x x x x x x x y z
   12     x x x x x x x x x x y z
   13     x x x x x x x x x x x y z
   14     x x x x x x x x x x x x y z
   15     x x x x x x x x x x x x x y z
   16     x x x x x x x x x x x x x x y z
   17     x x x x x x x x x x x x x x x y z
   18     x x x x x x x x x x x x x x x x y z
   19     x x x x x x x x x x x x x x x x x y z
   20     x x x x x x x x x x x x x x x x x x y z
input:
   wrap = a   |*|||s|*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a  z
    4     a  s z
    5     a  s  z
    6     a  s  s z
    7     a  s  s  z
    8     a  s  s  s z
    9     a  s  s  s  z
   10     a  s  s  s  s z
   11     a  s  s  s  s  z
   12     a  s  s  s  s  s z
   13     a  s  s  s  s  s  z
   14     a  s  s  s  s  s  s z
   15     a  s  s  s  s  s  s  z
   16     a  s  s  s  s  s  s  s z
   17     a  s  s  s  s  s  s  s  z
   18     a  s  s  s  s  s  s  s  s z
   19     a  s  s  s  s  s  s  s  s  z
   20     a  s  s  s  s  s  s  s  s  s z
input:
   wrap = a   |*|r|||*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a r z
    4     a r  z
    5     a r  r z
    6     a r  r  z
    7     a r  r  r z
    8     a r  r  r  z
    9     a r  r  r  r z
   10     a r  r  r  r  z
   11     a r  r  r  r  r z
   12     a r  r  r  r  r  z
   13     a r  r  r  r  r  r z
   14     a r  r  r  r  r  r  z
   15     a r  r  r  r  r  r  r z
   16     a r  r  r  r  r  r  r  z
   17     a r  r  r  r  r  r  r  r z
   18     a r  r  r  r  r  r  r  r  z
   19     a r  r  r  r  r  r  r  r  r z
   20     a r  r  r  r  r  r  r  r  r  z
input:
   wrap = a   |*|r|||||*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a r z
    4     a r  z
    5     a r   z
    6     a r   r z
    7     a r   r  z
    8     a r   r   z
    9     a r   r   r z
   10     a r   r   r  z
   11     a r   r   r   z
   12     a r   r   r   r z
   13     a r   r   r   r  z
   14     a r   r   r   r   z
   15     a r   r   r   r   r z
   16     a r   r   r   r   r  z
   17     a r   r   r   r   r   z
   18     a r   r   r   r   r   r z
   19     a r   r   r   r   r   r  z
   20     a r   r   r   r   r   r   z
input:
   wrap = a   |*|r|||||||*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a r z
    4     a r  z
    5     a r   z
    6     a r    z
    7     a r    r z
    8     a r    r  z
    9     a r    r   z
   10     a r    r    z
   11     a r    r    r z
   12     a r    r    r  z
   13     a r    r    r   z
   14     a r    r    r    z
   15     a r    r    r    r z
   16     a r    r    r    r  z
   17     a r    r    r    r   z
   18     a r    r    r    r    z
   19     a r    r    r    r    r z
   20     a r    r    r    r    r  z
Test Code 1 (TypoScript)

Constants:

os_1 = a
os_2 = a || b || c
os_3 = |*|  |*| a || b
os_4 = a |*| b || c |*|
os_5 = a || b |*|  |*| d || e
os_6 = a || b |*| c |*| d || e

os1 = a
os2 = a||b||c
os3 = |*||*|a||b
os4 = a|*|b||c|*|
os5 = a||b|*||*|d||e
os6 = a||b|*|c|*|d||e

Setup:

temp.marray = HMENU
temp.marray {
  special = directory
  # enter a page with at least 9 visible subpages!
  special.value = 123
  maxItems = 5

  1 = TMENU
  1 {
    NO {
      // the underscore is used to represent each item and avoid a collapsing of whitespace in html
      before = _
      doNotShowLink = 1
    }
  }
}

temp.mrow = COA
temp.mrow {
  1 = LOAD_REGISTER
  1.os = {$os4}

  5 = TEXT
  5.data = register:os
  5.wrap = <th>|</th>

  10 < temp.marray
  10.maxItems = 1
  10.wrap = <td>[|]</td>

  20 < .10
  20.maxItems = 2

  30 < .10
  30.maxItems = 3

  40 < .10
  40.maxItems = 4

  50 < .10
  50.maxItems = 5

  60 < .10
  60.maxItems = 6

  70 < .10
  70.maxItems = 7

  80 < .10
  80.maxItems = 8

  90 < .10
  90.maxItems = 9

  100 = RESTORE_REGISTER

  wrap = <tr>|</tr>
}

# Default PAGE object:
page = PAGE

page.10 = COA
page.10 {
  wrap = <pre>|</pre>
  10 = COA
  10 {
    wrap (
    <table>
      <tr>
        <th>optionsplit</th>
        <th>1</th>
        <th>2</th>
        <th>3</th>
        <th>4</th>
        <th>5</th>
        <th>6</th>
        <th>7</th>
        <th>8</th>
        <th>9</th>
      </tr>
      |
    </table>
    )

    10 < temp.mrow
    10 {
      1.os = {$os1}
      10.1.NO.before.wrap = {$os1}
      20.1.NO.before.wrap = {$os1}
      30.1.NO.before.wrap = {$os1}
      40.1.NO.before.wrap = {$os1}
      50.1.NO.before.wrap = {$os1}
      60.1.NO.before.wrap = {$os1}
      70.1.NO.before.wrap = {$os1}
      80.1.NO.before.wrap = {$os1}
      90.1.NO.before.wrap = {$os1}
    }

    20 < .10
    20 {
      1.os = {$os2}
      10.1.NO.before.wrap = {$os2}
      20.1.NO.before.wrap = {$os2}
      30.1.NO.before.wrap = {$os2}
      40.1.NO.before.wrap = {$os2}
      50.1.NO.before.wrap = {$os2}
      60.1.NO.before.wrap = {$os2}
      70.1.NO.before.wrap = {$os2}
      80.1.NO.before.wrap = {$os2}
      90.1.NO.before.wrap = {$os2}
    }

    30 < .10
    30 {
      1.os = {$os3}
      10.1.NO.before.wrap = {$os3}
      20.1.NO.before.wrap = {$os3}
      30.1.NO.before.wrap = {$os3}
      40.1.NO.before.wrap = {$os3}
      50.1.NO.before.wrap = {$os3}
      60.1.NO.before.wrap = {$os3}
      70.1.NO.before.wrap = {$os3}
      80.1.NO.before.wrap = {$os3}
      90.1.NO.before.wrap = {$os3}
    }


    40 < .10
    40 {
      1.os = {$os4}
      10.1.NO.before.wrap = {$os4}
      20.1.NO.before.wrap = {$os4}
      30.1.NO.before.wrap = {$os4}
      40.1.NO.before.wrap = {$os4}
      50.1.NO.before.wrap = {$os4}
      60.1.NO.before.wrap = {$os4}
      70.1.NO.before.wrap = {$os4}
      80.1.NO.before.wrap = {$os4}
      90.1.NO.before.wrap = {$os4}
    }


    50 < .10
    50 {
      1.os = {$os5}
      10.1.NO.before.wrap = {$os5}
      20.1.NO.before.wrap = {$os5}
      30.1.NO.before.wrap = {$os5}
      40.1.NO.before.wrap = {$os5}
      50.1.NO.before.wrap = {$os5}
      60.1.NO.before.wrap = {$os5}
      70.1.NO.before.wrap = {$os5}
      80.1.NO.before.wrap = {$os5}
      90.1.NO.before.wrap = {$os5}
    }


    60 < .10
    60 {
      1.os = {$os6}
      10.1.NO.before.wrap = {$os6}
      20.1.NO.before.wrap = {$os6}
      30.1.NO.before.wrap = {$os6}
      40.1.NO.before.wrap = {$os6}
      50.1.NO.before.wrap = {$os6}
      60.1.NO.before.wrap = {$os6}
      70.1.NO.before.wrap = {$os6}
      80.1.NO.before.wrap = {$os6}
      90.1.NO.before.wrap = {$os6}
    }
  }

  20 = TEXT
  20.value = <hr />

  30 = COA
  30 {
    wrap (
    <table>
      <tr>
        <th>optionsplit</th>
        <th>1</th>
        <th>2</th>
        <th>3</th>
        <th>4</th>
        <th>5</th>
        <th>6</th>
        <th>7</th>
        <th>8</th>
        <th>9</th>
      </tr>
      |
    </table>
    )

    10 < temp.mrow
    10 {
      1.os = {$os_1}
      10.1.NO.before.wrap = {$os_1}
      20.1.NO.before.wrap = {$os_1}
      30.1.NO.before.wrap = {$os_1}
      40.1.NO.before.wrap = {$os_1}
      50.1.NO.before.wrap = {$os_1}
      60.1.NO.before.wrap = {$os_1}
      70.1.NO.before.wrap = {$os_1}
      80.1.NO.before.wrap = {$os_1}
      90.1.NO.before.wrap = {$os_1}
    }

    20 < .10
    20 {
      1.os = {$os_2}
      10.1.NO.before.wrap = {$os_2}
      20.1.NO.before.wrap = {$os_2}
      30.1.NO.before.wrap = {$os_2}
      40.1.NO.before.wrap = {$os_2}
      50.1.NO.before.wrap = {$os_2}
      60.1.NO.before.wrap = {$os_2}
      70.1.NO.before.wrap = {$os_2}
      80.1.NO.before.wrap = {$os_2}
      90.1.NO.before.wrap = {$os_2}
    }

    30 < .10
    30 {
      1.os = {$os_3}
      10.1.NO.before.wrap = {$os_3}
      20.1.NO.before.wrap = {$os_3}
      30.1.NO.before.wrap = {$os_3}
      40.1.NO.before.wrap = {$os_3}
      50.1.NO.before.wrap = {$os_3}
      60.1.NO.before.wrap = {$os_3}
      70.1.NO.before.wrap = {$os_3}
      80.1.NO.before.wrap = {$os_3}
      90.1.NO.before.wrap = {$os_3}
    }


    40 < .10
    40 {
      1.os = {$os_4}
      10.1.NO.before.wrap = {$os_4}
      20.1.NO.before.wrap = {$os_4}
      30.1.NO.before.wrap = {$os_4}
      40.1.NO.before.wrap = {$os_4}
      50.1.NO.before.wrap = {$os_4}
      60.1.NO.before.wrap = {$os_4}
      70.1.NO.before.wrap = {$os_4}
      80.1.NO.before.wrap = {$os_4}
      90.1.NO.before.wrap = {$os_4}
    }


    50 < .10
    50 {
      1.os = {$os_5}
      10.1.NO.before.wrap = {$os_5}
      20.1.NO.before.wrap = {$os_5}
      30.1.NO.before.wrap = {$os_5}
      40.1.NO.before.wrap = {$os_5}
      50.1.NO.before.wrap = {$os_5}
      60.1.NO.before.wrap = {$os_5}
      70.1.NO.before.wrap = {$os_5}
      80.1.NO.before.wrap = {$os_5}
      90.1.NO.before.wrap = {$os_5}
    }


    60 < .10
    60 {
      1.os = {$os_6}
      10.1.NO.before.wrap = {$os_6}
      20.1.NO.before.wrap = {$os_6}
      30.1.NO.before.wrap = {$os_6}
      40.1.NO.before.wrap = {$os_6}
      50.1.NO.before.wrap = {$os_6}
      60.1.NO.before.wrap = {$os_6}
      70.1.NO.before.wrap = {$os_6}
      80.1.NO.before.wrap = {$os_6}
      90.1.NO.before.wrap = {$os_6}
    }
  }
}
Test Code 1 Result

output:

 optionsplit       1      2        3          4            5              6                7                  8                    9
a                 [a_]  [a_a_]  [a_a_a_]  [a_a_a_a_]  [a_a_a_a_a_]  [a_a_a_a_a_a_]  [a_a_a_a_a_a_a_]  [a_a_a_a_a_a_a_a_]  [a_a_a_a_a_a_a_a_a_]
a||b||c           [a_]  [a_b_]  [a_b_c_]  [a_b_c_c_]  [a_b_c_c_c_]  [a_b_c_c_c_c_]  [a_b_c_c_c_c_c_]  [a_b_c_c_c_c_c_c_]  [a_b_c_c_c_c_c_c_c_]
|*||*|a||b        [b_]  [a_b_]  [a_a_b_]  [a_a_a_b_]  [a_a_a_a_b_]  [a_a_a_a_a_b_]  [a_a_a_a_a_a_b_]  [a_a_a_a_a_a_a_b_]  [a_a_a_a_a_a_a_a_b_]
a|*|b||c|*|       [a_]  [a_b_]  [a_b_c_]  [a_b_c_b_]  [a_b_c_b_c_]  [a_b_c_b_c_b_]  [a_b_c_b_c_b_c_]  [a_b_c_b_c_b_c_b_]  [a_b_c_b_c_b_c_b_c_]
a||b|*||*|d||e    [e_]  [d_e_]  [a_d_e_]  [a_b_d_e_]  [a_b_b_d_e_]  [a_b_b_b_d_e_]  [a_b_b_b_b_d_e_]  [a_b_b_b_b_b_d_e_]  [a_b_b_b_b_b_b_d_e_]
a||b|*|c|*|d||e   [e_]  [d_e_]  [a_d_e_]  [a_b_d_e_]  [a_b_c_d_e_]  [a_b_c_c_d_e_]  [a_b_c_c_c_d_e_]  [a_b_c_c_c_c_d_e_]  [a_b_c_c_c_c_c_d_e_]


   optionsplit            1      2        3          4            5              6                7                  8                    9
a                        [a_]  [a_a_]  [a_a_a_]  [a_a_a_a_]  [a_a_a_a_a_]  [a_a_a_a_a_a_]  [a_a_a_a_a_a_a_]  [a_a_a_a_a_a_a_a_]  [a_a_a_a_a_a_a_a_a_]
a || b || c              [a_]  [a_b_]  [a_b_c_]  [a_b_c_c_]  [a_b_c_c_c_]  [a_b_c_c_c_c_]  [a_b_c_c_c_c_c_]  [a_b_c_c_c_c_c_c_]  [a_b_c_c_c_c_c_c_c_]
|*| |*| a || b           [b_]  [a_b_]  [_a_b_]   [__a_b_]    [___a_b_]     [____a_b_]      [_____a_b_]       [______a_b_]        [_______a_b_]
a |*| b || c |*|         [a_]  [a_b_]  [a_b_c_]  [a_b_c_b_]  [a_b_c_b_c_]  [a_b_c_b_c_b_]  [a_b_c_b_c_b_c_]  [a_b_c_b_c_b_c_b_]  [a_b_c_b_c_b_c_b_c_]
a || b |*| |*| d || e    [e_]  [d_e_]  [a_d_e_]  [a_b_d_e_]  [a_b__d_e_]   [a_b___d_e_]    [a_b____d_e_]     [a_b_____d_e_]      [a_b______d_e_]
a || b |*| c |*| d || e  [e_]  [d_e_]  [a_d_e_]  [a_b_d_e_]  [a_b_c_d_e_]  [a_b_c_c_d_e_]  [a_b_c_c_c_d_e_]  [a_b_c_c_c_c_d_e_]  [a_b_c_c_c_c_c_d_e_]
Test Code 2 (TypoScript)

This is the code that was used to produce many of the above examples.

Constants:

os1 = a
os2 = a||b||c
os3 = |*||*|a||b
os4 = a|*|b||c|*|
os5 = a||b|*||*|d||e
os6 = a||b|*|c|*|d||e

os1 = a
os2 = a ||
os3 = a || b
os4 = a || b ||
os5 = a || b || c
os6 = a |||| c

os1 = a
os2 = a |*|
os3 = a |*| b
os4 = a |*| b |*|
os5 = a |*| b |*| c
os6 = a |*| b |*| c |*| d

os1 = a || b || c
os2 = a || b || c  |*|
os3 = a || b || c  |*|  r ||
os4 = a || b || c  |*|  r || s || t
os5 = a || b || c  |*||*|  x || y || z
os6 = a || b || c  |*|  r || s || t  |*|  x || y || z


os6 = a   |*|  r   |*|  z
os6 = a || b  |*|  r || s  |*|  y || z
os6 = a || b || c  |*|  r || s || t  |*|  x || y || z


os6 = a || b || c  |*|  r || s || t
os6 = a || b  |*|  r || s
os6 = a  |*|  r

os6 = a
os6 = a || b
os6 = a || b || c


os6 = a || b || c  |*||*|  x || y || z

os6 = a  |*||*| z
os6 =  |*||*|  z
os6 =  |*| |*| z

os6 =  |*| r || s || t  |*|
os6 = a || b || c  |*||*|
os6 = |*||*|  x || y || z


os6 = a   |*|||s|*|  z
os6 = a   |*|r|||*|  z
os6 = a   |*|r|||||*|  z
os6 = a   |*|r|||||||*|  z

Setup:

lib.marray = HMENU
lib.marray {
    special = directory
    # enter the uid of a page with at least 20 visible subpages!
    special.value = 2
    maxItems = 999

    1 = TMENU
    1 {
        NO {
            before = _
            // use non-breaking space for each item instead of underscore
            before = &nbsp;
            before.wrap = {$os6}
            doNotShowLink = 1
        }
    }
}

lib.mrow = COA
lib.mrow {
    1 = LOAD_REGISTER
    1.os = {$os6}

    4 = TEXT
    4.value = input:
    4.wrap =  |<br/>

    5 = TEXT
    5.data = register:os
    5.wrap = &nbsp;&nbsp;&nbsp;wrap =&nbsp; |<br/><br/>output:<br>    N     output sequence<br/>

    10 < lib.marray
    10.maxItems = 1
    10.wrap = &nbsp;&nbsp;&nbsp;&nbsp;1    &nbsp; |<br/>

    20 < .10
    20.maxItems = 2
    20.wrap = &nbsp;&nbsp;&nbsp;&nbsp;2    &nbsp; |<br/>

    30 < .10
    30.maxItems = 3
    30.wrap = &nbsp;&nbsp;&nbsp;&nbsp;3    &nbsp; |<br/>

    40 < .10
    40.maxItems = 4
    40.wrap = &nbsp;&nbsp;&nbsp;&nbsp;4    &nbsp; |<br/>

    50 < .10
    50.maxItems = 5
    50.wrap = &nbsp;&nbsp;&nbsp;&nbsp;5    &nbsp; |<br/>

    60 < .10
    60.maxItems = 6
    60.wrap = &nbsp;&nbsp;&nbsp;&nbsp;6    &nbsp; |<br/>

    70 < .10
    70.maxItems = 7
    70.wrap = &nbsp;&nbsp;&nbsp;&nbsp;7    &nbsp; |<br/>

    80 < .10
    80.maxItems = 8
    80.wrap = &nbsp;&nbsp;&nbsp;&nbsp;8    &nbsp; |<br/>

    90 < .10
    90.maxItems = 9
    90.wrap = &nbsp;&nbsp;&nbsp;&nbsp;9    &nbsp; |<br/>

    120 < .10
    120.maxItems = 10
    120.wrap = &nbsp;&nbsp;&nbsp;10    &nbsp; |<br/>

    130 < .10
    130.maxItems = 11
    130.wrap = &nbsp;&nbsp;&nbsp;11    &nbsp; |<br/>

    140 < .10
    140.maxItems = 12
    140.wrap = &nbsp;&nbsp;&nbsp;12    &nbsp; |<br/>

    150 < .10
    150.maxItems = 13
    150.wrap = &nbsp;&nbsp;&nbsp;13    &nbsp; |<br/>

    160 < .10
    160.maxItems = 14
    160.wrap = &nbsp;&nbsp;&nbsp;14    &nbsp; |<br/>

    170 < .10
    170.maxItems = 15
    170.wrap = &nbsp;&nbsp;&nbsp;15    &nbsp; |<br/>

    180 < .10
    180.maxItems = 16
    180.wrap = &nbsp;&nbsp;&nbsp;16    &nbsp; |<br/>

    190 < .10
    190.maxItems = 17
    190.wrap = &nbsp;&nbsp;&nbsp;17    &nbsp; |<br/>

    200 < .10
    200.maxItems = 18
    200.wrap = &nbsp;&nbsp;&nbsp;18    &nbsp; |<br/>

    210 < .10
    210.maxItems = 19
    210.wrap = &nbsp;&nbsp;&nbsp;19    &nbsp; |<br/>

    220 < .10
    220.maxItems = 20
    220.wrap = &nbsp;&nbsp;&nbsp;20    &nbsp; |<br/>

    1100 = RESTORE_REGISTER

    wrap = | <br>
}

# Default PAGE object:
page = PAGE

page.10 = COA
page.10 {
    wrap = <pre>|</pre>
    10 = COA
    10 {
        wrap =

        10 < lib.mrow
        #10 {
        #    1.os = {$os6}
        #    10.1.NO.before.wrap  = {$os6}
        #}
    }
}
Test Code 2 Result

output:

input:
   wrap = a   |*|r|||||||*|  z

output:
    N     output sequence
    1     z
    2     a z
    3     a r z
    4     a r  z
    5     a r   z
    6     a r    z
    7     a r    r z
    8     a r    r  z
    9     a r    r   z
   10     a r    r    z
   11     a r    r    r z
   12     a r    r    r  z
   13     a r    r    r   z
   14     a r    r    r    z
   15     a r    r    r    r z
   16     a r    r    r    r  z
   17     a r    r    r    r   z
   18     a r    r    r    r    z
   19     a r    r    r    r    r z
   20     a r    r    r    r    r  z

Objects and stdWrap

"... /stdWrap"

When a data type is set to "type / stdWrap" it means that the value is parsed through the stdWrap function with the properties of the value as parameters.

stdWrap example:

If the property "pixels" has the data type "integer / stdWrap", the value should be set to an integer and can be parsed through stdWrap.

In a real application we could do like this:

.pixels.field = imagewidth
.pixels.intval = 1

This example imports the value from the field "imagewidth" of the current $cObj->data-array. But we don't trust the result to be an integer so we parse it through the intval()-function.

Conditions

See also

For full explanations about conditions, especially about condition syntax, please refer to the TypoScript Syntax chapter of the Core API.

See also

TypoScript also offers the "if" function to create conditions.

Topics:

About The Syntax Of Conditions

See also

For full explanations about conditions, especially about condition syntax, please refer to the TypoScript Syntax chapter of the Core API.

General syntax

Each condition is encapsulated by square brackets. For a list of available conditions see below.

[ELSE] is available as else operator. It is a condition, which will return TRUE, if the previous condition returned FALSE.

Each condition block is ended with [END].

[GLOBAL] is a condition by itself that always returns "true". It ensures that the following TypoScript code is located in the global scope. So you can be sure that it's not affected by previous TypoScript, for example if a closing bracket is missing. The Template Analyzer shows this very well: TYPO3 places a [GLOBAL] condition at the beginning of each TypoScript file.

As a developer you can use [GLOBAL] for testing purposes to ensure that your own condition works as expected. See The special [ELSE], [END] and [GLOBAL] conditions for additional documentation.

Example

Test day of month:

[dayofmonth = 9]
  # TypoScript for the ninth day of the month.
[ELSE]
  # TypoScript for other days.
[END]
Trimming, braces and condition operators

Values are normally trimmed before comparison, so leading and trailing blanks are not taken into account.

Note that conditions cannot be used inside of curly brackets.

You may combine several conditions with two operators: && (and), || (or). Alternatively you may use "AND" and "OR" instead of "&&" and "||". The AND operator always takes higher precedence over OR. If no operator has been specified, it will default to OR.

Examples
Test day of month and month

This condition will match on May 9th:

[dayofmonth = 9] && [month = 5]
Test day of month

This will match on either the ninth or the tenth of a month:

[dayofmonth = 9] || [dayofmonth = 10]
Test month and day of month

This will match in either June or May. In case of May, the day of the month must be above 8:

[month = 6] || [month = 5] && [dayofmonth => 8]

Description

The symfony expression language has been implemented for TypoScript conditions in both frontend and backend since TYPO3 9.4.

Upgrading

The existing conditions are available as variables and/or functions but were already marked as deprecated. So expect deprecation messages when using the old syntax with TYPO3 9. The existing conditions will be removed early in version 10. If you want to know what your conditions did until now, have a look at an older version of this document .

General Usage

To learn the full power of the symfony expression language please check the documentation for the common expression syntax. Here are some examples to understand the power of the expression language:

[page["uid"] in 18..45]
# This condition matches if current page uid is between 18 and 45
[END]

[userId in [1,5,7]]
# This condition matches if current logged in user has the uid 1, 5 or 7
[END]

[not ("foo" matches "/bar/")]
# This condition does match if "foo" **not** matches the regExp: `/bar/`
[END]

[applicationContext == "Production"] && [userId == 15]
# This condition match if application context is "Production" AND logged in user has the uid 15
# This condition could also be combined in one condition:
# [applicationContext == "Production" && userId == 15]
[END]

[request.getNormalizedParams().getHttpHost() == 'typo3.org']
# This condition matches if current hostname is typo3.org
[END]

[like(request.getNormalizedParams().getHttpHost(), "*.devbox.local")]
# This condition matches if current hostname is any subdomain of devbox.local
[END]

[request.getNormalizedParams().isHttps() == false]
# This condition matches if current request is **not** https
[END]
Variables

The following variables are available. The values are context related.

Variable Type Description
applicationContext String current application context as string
page Array current page record as array
{$foo.bar} Constant Any TypoScript constant is available like before. Depending on the type of the constant you have to use different conditions, see examples below: - if constant is an integer: - [{$foo.bar} == 4711] - if constant is a string put constant in quotes: - ["{$foo.bar}" == "4711"]
tree .level .rootLine .rootLineIds Object Integer Array Array object with tree information current tree level array of arrays with uid and pid an array with UIDs of the rootline
backend .user .user.isAdmin .user.isLoggedIn .user.userId .user.userGroupList Object Object Boolean Boolean Integer String object with backend information (available in BE only) object with current backend user information true if current user is admin true if current user is logged in UID of current user comma list of group UIDs
frontend .user .user.isLoggedIn .user.userId .user.userGroupList Object Object Boolean Integer String object with frontend information (available in FE only) object with current frontend user information true if current user is logged in UID of current user comma list of group UIDs
typo3 .version .branch .devIpMask Object String String String object with TYPO3 related information TYPO3_version (e.g. 9.4.0-dev) TYPO3_branch (e.g. 9.4) $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']
Functions

Functions take over the logic of the old conditions which do more than a simple comparison check. The following functions are available in any context:

Function Parameter Description
request .getQueryParams() .getParsedBody() .getHeaders() .getCookieParams() .getNormalizedParams() Custom Object This object provides 4 methods - [request.getQueryParams()['foo'] == 1] - [request.getParsedBody()['foo'] == 1] - [request.getHeaders()['Accept'] == 'json'] - [request.getCookieParams()['foo'] == 1] - [request.getNormalizedParams().isHttps()]
date String Get current date in given format. Examples: - true if day of current month is 7: - [date("j") == 7] - true if day of current week is 7: - [date("w") == 7] - true if day of current year is 7: - [date("z") == 7] - true if current hour is 7: - [date("G") == 7]
like String This function has two parameters: the first parameter is the string to search in the second parameter is the search string Example: - [like("foobarbaz", "bar")]
ip String Value or Constraint, Wildcard or RegExp possible special value: devIP (match the devIPMask
compatVersion String version constraint, e.g. 9.4 or 9.4.0
loginUser String value or constraint, wildcard or RegExp possible Examples: - [loginUser('*')] // any logged in user - [loginUser(1)] // user with uid 1 - [loginUser('1,3,5')] // user 1, 3 or 5 - [loginUser('*') == false] // not logged in
getTSFE Object TypoScriptFrontendController ($GLOBALS['TSFE'])
getenv String PHP function: getenv()
usergroup String value or constraint, wildcard or RegExp possible

The following functions are only available in frontend context:

Function Parameter Description
session String Get value from session Example, matches if session value = 1234567 - [session("session:foo|bar") == 1234567]
site String get value from site configuration, or null if no site was found or property does not exists Example, matches if site identifier = foo - [site("identifier") == "foo"] Example, matches if site base = http://localhost - [site("base") == "http://localhost"]
siteLanguage String get vale from siteLanguage configuration, or null if no site was found or property not exists Example, match if siteLanguage locale = foo - [siteLanguage("locale") == "de_CH"] Example, match if siteLanguage title = Italy - [siteLanguage("title") == "Italy"]
Extending the expression language with own functions (like old userFunc)

It is possible to extend the expression language with own functions like before userFunc in the old conditions. An example could be TYPO3\CMS\Core\ExpressionLanguage\TypoScriptConditionFunctionsProvider which implements the most core functions.

Add new methods by implementing own providers which implement the ExpressionFunctionProviderInterface and register the provider in ext_localconf.php:

if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\ExpressionLanguage\TypoScriptConditionProvider']['additionalExpressionLanguageProvider'])) {
   $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\ExpressionLanguage\TypoScriptConditionProvider']['additionalExpressionLanguageProvider'] = [];
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\ExpressionLanguage\TypoScriptConditionProvider']['additionalExpressionLanguageProvider'][] = \My\NameSpace\Provider\TypoScriptConditionProvider::class;

Functions

addParams

Adds parameters to an HTML tag.

_offset
Property
_offset
Data type
integer
Description

Use this to define which tag you want to manipulate.

1 is the first tag in the input, 2 is the second, -1 is the last, -2 is the second last.

Default
1
(array of strings)
Property
(array of strings)
Data type
string / stdWrap
Description

The name of the property defines the property to be added to the tag. The value is what will be set as content of the property.

If the tag already has a property with this name (case-sensitive!), that property will be overridden!

If the returned value is a blank string (but not zero!), then the property will not be set and (if it exists already) not be overridden.

Example
page.13 = TEXT
page.13.value = <tr><td>
page.13.stdWrap.addParams.bgcolor = white
page.13.stdWrap.addParams._offset = -1

Result example:

<tr><td bgcolor="white">

This example adds the bgColor property to the value of the TEXT cObject.

cache

Stores the rendered content into the caching framework and reads it from there. This allows you to reuse this content without prior rendering. The presence of cache.key will trigger this feature. It is evaluated twice:

Content is read from cache directly after the stdWrapPreProcess hook and before setContentToCurrent. If there is a cache entry for the given cache key, stdWrap processing will stop and the cached content will be returned. If no cache content is found for this key, the stdWrap processing continues as usual.

Writing to cache happens at the end of rendering, directly before the stdWrapPostProcess hook is called and before the "debug*" functions. The rendered content will be stored in the cache, if cache.key was set. The configuration options cache.tags and cache.lifetime allow to control the caching.

key
Property
key
Data type
string / stdWrap
Description

The cache identifier that is used to store the rendered content into the cache and to read it from there.

Note

Make sure to use a valid cache identifier. Also take care to choose a cache key that is accurate enough to distinguish different versions of the rendered content while being generic enough to stay efficient.

lifetime
Property
lifetime
Data type
mixed / stdWrap
Description

Lifetime of the content in cache.

Allows you to determine the lifetime of the cached object independently of the lifetime of the cached version of the page on which it is used.

Possible values are any positive integer and the keywords unlimited and default:

integer
Lifetime in seconds.
unlimited
Cached content will not expire unless actively purged by id or by tag or if the complete cache is flushed.
default
The default cache lifetime as configured in config.cache_period is used.
Default
default
tags
Property
tags
Data type
string / stdWrap
Description
Can hold a comma-separated list of tags. These tags will be attached to the entry added to the cache_hash cache (but not to cache_pages cache) and can be used to purge the cached content.
Examples
5 = TEXT
5 {
    stdWrap {
        cache {
            key = mycurrenttimestamp
            tags = tag_a,tag_b,tag_c
            lifetime = 3600
        }
        data = date : U
        strftime = %H:%M:%S
    }
}

In the above example the current time will be cached with the key "mycurrenttimestamp". This key is fixed and does not take the current page id into account. So if you add this to your TypoScript, the cObject will be cached and reused on all pages (showing you the same timestamp).

5 = TEXT
5 {
    stdWrap.cache {
        key = mycurrenttimestamp_{page:uid}_{TSFE:sys_language_uid}
        key.insertData = 1
}

Here a dynamic key is used. It takes the page id and the language uid into account making the object page and language specific.

cache as first-class function

The stdWrap.cache. property is also available as first-class function to all content objects. This skips the rendering even for content objects that evaluate stdWrap after rendering (e.g. COA).

Usage:

page = PAGE
page.10 = COA
page.10 {
    cache.key = coaout
    cache.lifetime = 60
    #stdWrap.cache.key = coastdWrap
    #stdWrap.cache.lifetime = 60
    10 = TEXT
    10 {
        cache.key = mycurrenttimestamp
        cache.lifetime = 60
        data = date : U
        strftime = %H:%M:%S
        noTrimWrap = |10: | |
    }
    20 = TEXT
    20 {
        data = date : U
        strftime = %H:%M:%S
        noTrimWrap = |20: | |
    }
}

The commented part is stdWrap.cache. property available since 4.7, that does not stop the rendering of COA including all sub-cObjects.

Additionally, stdWrap support is added to key, lifetime and tags.

If you've previously used the cache. property in your custom cObject, this will now fail, because cache. is unset to avoid double caching. You are encouraged to rely on the core methods for caching cObjects or rename your property.

stdWrap.cache continues to exists and can be used as before. However the top level stdWrap of certain cObjects (e.g. TEXT cObject) will not evaluate cache. as part of stdWrap, but before starting the rendering of the cObject. In conjunction the storing will happen after the stdWrap processing right before the content is returned.

Top level cache. will not evaluate the hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] any more.

encapsLines

encapsTagList
Property
encapsTagList
Data type
list of strings
Description
List of tags which qualify as encapsulating tags. Must be lowercase.

Example

encapsTagList = div, p

This setting will recognize the red line below as encapsulated lines:

First line of text
Some <div>text</div>
<p>Some text</p>
<div>Some text</div>
<B>Some text</B>
remapTag.[tagname]
Property
remapTag.[tagname]
Data type
string
Description

Enter a new tag name here if you wish the tagname of any encapsulation to be unified to a single tag name.

For instance, setting this value to remapTag.P=DIV would convert:

<p>Some text</p>
<div>Some text</div>

to :

<div>Some text</div>
<div>Some text</div>

([tagname] is in uppercase.)

addAttributes.[tagname]
Property
addAttributes.[tagname]
Data type
(array of strings)
Description

Attributes to set in the encapsulation tag.

([tagname] is in uppercase.)

.setOnly =
exists
This will set the value ONLY if the property does not already exist.
blank
This will set the value ONLY if the property does not already exist OR is blank ("").
Default
Always override/set the value of the attributes.
Example
addAttributes.P {
      style = padding-bottom: 0px; margin-top: 1px; margin-bottom: 1px;
      align = center
}
removeWrapping
Property
removeWrapping
Data type
boolean
Description

If set, then all existing wrapping will be removed.

This:

First line of text
Some <div>text</div>
<p>Some text</p>
<div>Some text</div>
<b>Some text</b>

becomes this:

First line of text
Some <div>text</div>
Some text
Some text
<b>Some text</b>
wrapNonWrappedLines
Property
wrapNonWrappedLines
Data type
wrap
Description
Wrapping for non-encapsulated lines

Example

wrapNonWrappedLines = <p>|</p>

This:

First line of text
<p>Some text</p>

becomes this:

<P>First line of text</P>
<p>Some text</p>
innerStdWrap_all
Property
innerStdWrap_all
Data type
stdWrap
Description
Wraps the content inside all lines, whether they are encapsulated or not.
encapsLinesStdWrap.[tagname]
Property
encapsLinesStdWrap.[tagname]
Data type
stdWrap
Description

Wraps the content inside all encapsulated lines.

([tagname] is in uppercase.)

defaultAlign
Property
defaultAlign
Data type
string / stdWrap
Description
If set, this value is set as the default "align" value of the wrapping tags, both from encapsTagList, bypassEncapsTagList and nonWrappedTag
nonWrappedTag
Property
nonWrappedTag
Data type
tagname
Description
For all non-wrapped lines, you can here set a tag in which they should be wrapped. Example would be "p". This is an alternative to wrapNonWrappedLines and has the advantage that its attributes are set by addAttributes as well as defaultAlign. Thus you can match the wrapping tags used for non-wrapped and wrapped lines more easily.
Example
encapsLines {
    encapsTagList = div,p
    remapTag.DIV = P
    wrapNonWrappedLines = <p>|</p>
    innerStdWrap_all.ifEmpty = &nbsp;
}

This example shows how to handle content rendered by TYPO3 and stylesheets where the <p> tag is used to encapsulate each line.

Say, you have made this content with the Rich Text Editor:

This is line # 1

[Above is an empty line!]
<div style="text-align: right;">This line is right-aligned.</div>

After being processed by encapsLines with the above configuration, the content looks like this:

<p>This is line # 1 </p>
<p>&nbsp;</p>
<p>[Above is an empty line!] </p>
<p style="text-align: right;">This line is right-aligned.</p>

Each line is nicely wrapped with <p> tags. The line from the database which was already wrapped (but in <div>-tags) has been converted to <p>, but keeps it's alignment. Overall, notice that the Rich Text Editor ONLY stored the line which was in fact right-aligned - every other line from the RTE was stored without any wrapping tags, so that the content in the database remains as human readable as possible.

Example
# Make sure nonTypoTagStdWrap operates
# on content outside <typolist> and <typohead> only:
tt_content.text.20.parseFunc.tags.typolist.breakoutTypoTagContent = 1
tt_content.text.20.parseFunc.tags.typohead.breakoutTypoTagContent = 1
# ... and no <br> before typohead.
tt_content.text.20.parseFunc.tags.typohead.stdWrap.wrap >
# Setting up nonTypoTagStdWrap to wrap the text with p-tags
tt_content.text.20.parseFunc.nonTypoTagStdWrap >
tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines {
    encapsTagList = div,p
    remapTag.DIV = P
    wrapNonWrappedLines = <p style="margin: 0 0 0;">|</p>

    # Forcing these attributes onto the encapsulation-tags if any
    addAttributes.P {
        style=margin: 0 0 0;
    }
    innerStdWrap_all.ifEmpty = &nbsp;
}
# Finally removing the <br>-tag after the content...
tt_content.text.20.wrap >

This is an example of how to wrap traditional tt_content bodytext with <p> tags, setting the line-distances to regular space like that generated by a <br> tag, but staying compatible with the RTE features such as assigning classes and alignment to paragraphs.

getEnv

Allows to override static values with environment variables.

The modifier checks if the variable given as its argument is set and reads the value if so, overriding any existing value. If the environment variable is not set, the variable given on the left-hand side of the expression is not changed.

To have a value actually inserted, your PHP execution environment (webserver, PHP-FPM) needs to have these variables set, or you need a mechanism like dotenv to set them in your running TYPO3.

As it is a syntax feature you can use it in both constants and setup plus it gets cached, as opposed to the getText.getenv feature.

Example
# Define default value
myConstant = defaultValue
# Enable overriding by environment variable
myConstant := getEnv(TS_MYCONSTANT)

HTMLparser

allowTags
Property
allowTags
Data type
list of tags
Description
Default allowed tags
stripEmptyTags
Property
stripEmptyTags
Data type
boolean
Description
Passes the content to PHPs strip_tags().
stripEmptyTags.keepTags
Property
stripEmptyTags.keepTags
Data type
string
Description
Comma separated list of tags to keep when applying strip_tags().
tags.[tagname]
Property
tags.[tagname]
Data type
boolean / HTMLparser_tags
Description

Either set this property to 0 or 1 to allow or deny the tag. If you enter HTMLparser_tags properties, those will automatically overrule this option, thus it's not needed then.

[tagname] in lowercase.

localNesting
Property
localNesting
Data type
list of tags, must be among preserved tags
Description
List of tags (among the already set tags), which will be forced to have the nesting-flag set to true
globalNesting
Property
globalNesting
Data type
(ibid)
Description
List of tags (among the already set tags), which will be forced to have the nesting-flag set to "global"
rmTagIfNoAttrib
Property
rmTagIfNoAttrib
Data type
(ibid)
Description
List of tags (among the already set tags), which will be forced to have the rmTagIfNoAttrib set to true
noAttrib
Property
noAttrib
Data type
(ibid)
Description
List of tags (among the already set tags), which will be forced to have the allowedAttribs value set to zero (which means, all attributes will be removed.
removeTags
Property
removeTags
Data type
(ibid)
Description
List of tags (among the already set tags), which will be configured so they are surely removed.
keepNonMatchedTags
Property
keepNonMatchedTags
Data type
boolean / "protect"
Description

If set (1), then all tags are kept regardless of tags present as keys in $tags-array.

If protect, then the preserved tags have their <> converted to &lt; and &gt;

Default is to REMOVE all tags, which are not specifically assigned to be allowed! So you might probably want to set this value!

htmlSpecialChars
Property
htmlSpecialChars
Data type
-1 / 0 / 1 / 2
Description

This regards all content which is not tags:

-1 Does the opposite of "1". It converts &lt; to <, &gt; to >, &quot; to " etc.
0
Disabled - nothing is done.
1
The content outside tags is htmlspecialchar()'ed (PHP-function which converts &"<> to &...;).
2
Same as "1", but entities like &amp; or &#234 are untouched.

HTMLparser_tags

overrideAttribs
Property
overrideAttribs
Data type
string
Description
If set, this string is preset as the attributes of the tag.
allowedAttribs
Property
allowedAttribs
Data type
mixed
Description

Defines the allowed attributes.

Possible values:

0
No attributes allowed.
(comma-separated list of attributes)
Only attributes in this list are allowed.
(blank/not set)
All attributes are allowed.
fixAttrib.[attribute].set
Property
fixAttrib.[attribute].set
Data type
string
Description
Force the attribute value to this value.
fixAttrib.[attribute].unset
Property
fixAttrib.[attribute].unset
Data type
boolean
Description
If set, the attribute is unset.
fixAttrib.[attribute].default
Property
fixAttrib.[attribute].default
Data type
string
Description
If no attribute exists by this name, this value is set as default value (if this value is not blank)
fixAttrib.[attribute].always
Property
fixAttrib.[attribute].always
Data type
boolean
Description
If set, the attribute is always processed. Normally an attribute is processed only if it exists
Property

fixAttrib.[attribute].trim

fixAttrib.[attribute].intval

fixAttrib.[attribute].upper

fixAttrib.[attribute].lower

Data type
boolean
Description
If any of these keys are set, the value is passed through the respective PHP-functions.
fixAttrib.[attribute].range
Property
fixAttrib.[attribute].range
Data type
[low],[high]
Description
Setting integer range.
fixAttrib.[attribute].list
Property
fixAttrib.[attribute].list
Data type
list of values, trimmed
Description
Attribute value must be in this list. If not, the value is set to the first element.
fixAttrib.[attribute].removeIfFalse
Property
fixAttrib.[attribute].removeIfFalse
Data type
boolean / blank string
Description
If set, then the attribute is removed if it is false (= 0). If this value is set to blank then the value must be a blank string (that means a "zero" value will not be removed).
fixAttrib.[attribute].removeIfEquals
Property
fixAttrib.[attribute].removeIfEquals
Data type
string
Description
If the attribute value matches the value set here, then it is removed.
fixAttrib.[attribute].casesensitiveComp
Property
fixAttrib.[attribute].casesensitiveComp
Data type
boolean
Description
If set, the comparison in fixAttrib.[attribute].removeIfEquals and fixAttrib.[attribute].list will be case-sensitive. At this point, it's insensitive.
fixAttrib.[attribute].prefixLocalAnchors
Property
fixAttrib.[attribute].prefixLocalAnchors
Data type
integer
Description

If the first char is a "#" character (anchor of fx. <a> tags) this will prefix either a relative or absolute path.

1
will get the absolute path (TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')).
2
will get the relative path (stripping of TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')).
Example
...fixAttrib.href.prefixLocalAnchors = 1
fixAttrib.[attribute].prefixRelPathWith
Property
fixAttrib.[attribute].prefixRelPathWith
Data type
string
Description
If the value of the attribute seems to be a relative URL (no scheme like "http" and no "/" as first char) then the value of this property will be prefixed the attribute.

Example

...fixAttrib.src.prefixRelPathWith = http://192.168.230.3/typo3/32/dummy/
fixAttrib.[attribute].userFunc
Property
fixAttrib.[attribute].userFunc
Data type
function name
Description
User function for processing of the attribute. The return value of this function will be used as the new tag value.
Example
...fixAttrib.href.userFunc = \Vendor\ExtName\ClassName->function

Two parameters are passed to the function:

  1. The tag value as a string or an array containing the tag value and additional configuration (see below).
  2. The reference the to HtmlParser instance that calls the method.

By default the first parameter is the value of the processed tag. This changes when you pass additional configuration options to the user function:

...fixAttrib.href.userFunc.myCustomParm = myCustomValue

In that case the first parameter passed to the user function will be an array containing these values:

protect
Property
protect
Data type
boolean
Description
If set, the tag <> is converted to &lt; and &gt;
remap
Property
remap
Data type
string
Description
If set, the tagname is remapped to this tagname
rmTagIfNoAttrib
Property
rmTagIfNoAttrib
Data type
boolean
Description
If set, then the tag is removed if no attributes happened to be there.
nesting
Property
nesting
Data type
mixed
Description

If set true, then this tag must have starting and ending tags in the correct order. Any tags not in this order will be discarded. Thus </B><B><I></B></I></B> will be converted to <B><I></B></I>.

Is the value "global" then true nesting in relation to other tags marked for "global" nesting control is preserved. This means that if <B> and <I> are set for global nesting then this string </B><B><I></B></I></B> is converted to <B></B>

if

Allows you to check multiple conditions.

This function returns true, if ALL of the present conditions are met (they are connected with an "AND", a logical conjunction). If a single condition is false, the value returned is false.

The returned value may still be negated by the negate-property.

There is no else property available. The else branch of an if statement is a missing feature. You can implement a workaround by a logic based on the Override and conditions .

Also check the explanations and the examples further below!

directReturn
Property
directReturn
Data type
boolean
Description
If this property exists, no other conditions will be checked. Instead the true/false of this value is returned. Can be used to set true/false with a TypoScript constant.
isNull
Property
isNull
Data type
stdWrap
Description

If the resulting content of the stdWrap is null (NULL type in PHP).

Since null values cannot be assigned in TypoScript, only the stdWrap features are available below this property.

Example

page.10 = COA_INT
page.10.10 = TEXT
page.10.10 {
      stdWrap.if.isNull.field = description
      value = No description available.
}

This example returns "No description available.", if the content of the field "description" is NULL.

isTrue
Property
isTrue
Data type
string / stdWrap
Description
If the content is "true", which is not empty string and not zero.
isFalse
Property
isFalse
Data type
string / stdWrap
Description
If the content is "false", which is empty or zero.
isPositive
Property
isPositive
Data type
integer / stdWrap + Calc
Description
Returns true, if the content is positive.
isGreaterThan
Property
isGreaterThan
Data type
value / stdWrap
Description
Returns true, if the content is greater than value.
isLessThan
Property
isLessThan
Data type
value / stdWrap
Description
Returns true, if the content is less than value.
equals
Property
equals
Data type
value / stdWrap
Description
Returns true, if the content is equal to value.

Example

if.equals = POST
if.value.data = GETENV:REQUEST_METHOD
isInList
Property
isInList
Data type
value / stdWrap
Description

Returns true, if the content is in the comma-separated list .value.

Note: The list in value may not have spaces between elements!

Example

if.isInList.field = uid
if.value = 1,2,34,50,87

This returns true, if the uid is part of the list in value.

value
Property
value
Data type
value / stdWrap
Description
The value to check. This is the comparison value mentioned above.
negate
Property
negate
Data type
boolean
Description

This property is checked after all other properties. If set, it negates the result, which is present before its execution.

So if all other conditions, which were used, returned true, with this property the overall return ends up being false. If at least one of the other conditions, which were used, returned false, the overall return ends up being true.

Default
0
Explanation

The "if"-function is a very odd way of returning true or false! Beware!

"if" is normally used to decide whether to render an object or to return a value (see the cObject and stdWrap).

Here is how it works:

The function returns true or false. Whether it returns true or false depends on the properties of this function. Say if you set isTrue = 1 then the result is true. If you set isTrue.field = header, the function returns true if the field "header" in $cObj->data is set!

If you want to compare values, you must load a base-value in the value-property. Example:

.value = 10
.isGreaterThan = 11

This would return true because the value of isGreaterThan is greater than 10, which is the base-value.

More complex is this:

.value = 10
.isGreaterThan = 11
.isTrue.field = header
.negate = 1

There are two conditions - isGreaterThan and isTrue. If they are both true, the total is true (both are connected with an AND). BUT(!) then the result of the function in total would be false because the negate-flag inverts the result!

Examples

This is a GIFBUILDER object that will write "NEW" on a menu-item if the field "newUntil" has a date less than the current date!

30 = TEXT
30.text = NEW!
30.offset = 10,10
30.if {
    value.data = date: U
    isLessThan.field = newUntil
    negate = 1
}

Properties

Property Data types stdWrap Default
imageLinkWrap_ = boolean yes 0
enable = boolean yes 0
file = stdWrap yes  
width = positive integer yes  
height = positive integer yes  
effects = like EFFECT of GIFBUILDER yes  
sample = boolean yes 0
alternativeTempPath = path yes  
title = string yes  
bodyTag = <tag> yes  
wrap = wrap (?)  
target = target yes "thePicture"
JSwindow = boolean yes  
JSwindow.expand = x, y (both integer) yes  
JSwindow.newWindow = boolean yes  
JSwindow.altUrl = string yes  
JSwindow.altUrl_noDefaultParams = boolean (?) 0
typolink = like typolink (?)  
directImageLink = boolean yes 0
linkParams = any of the options of typolink (?)  
stdWrap = stdWrap yes  

enable

imageLinkWrap.enable = boolean

Whether or not to link the image. Must be set to True to make imageLinkWrap do anything at all.

file

imageLinkWrap.file = stdWrap

Apply stdWrap functionality to the file path.

width

imageLinkWrap.width = positive integer

Width of the image to be shown in pixels. If you add "m" to width or height or both then the width and height parameters will be interpreted as maximum and proportions of the image will be preserved.

height

imageLinkWrap.height = positive integer

Width of the image to be shown in pixels. If you add "m" to width or height or both then the width and height parameters will be interpreted as maximum and proportions of the image will be preserved.

effects

imageLinkWrap.effects = like EFFECT of GIFBUILDER

Apply image effects to the preview image.

Example for effects
imageLinkWrap {
   effects = gamma=1.3 | sharpen=80 | solarize=70
      # effects only works when directImageLink is FALSE
   directImageLink = 0
      # at most 800 pixels wide. Keep proportions.
   width = 800m
      # at most 600 pixels wide. Keep proportions.
   height = 600m
}

sample

imageLinkWrap.sample = boolean

sample is a switch which determines how the image processor (often GraphicsMagick or ImageMagick) calculates the preview image. If sample is true then - sample is used with GraphicsMagick or ImageMagick instead of - geometry to calculate the preview image. sample does not use antialiasing and is therefore much faster than the geometry procedure of GraphicsMagick or ImageMagick.

alternativeTempPath

imageLinkWrap.alternativeTempPath = path

This is used to specify an alternative path to be used for temporary images.

title

imageLinkWrap.title = string

Specifies the html-page-title of the preview window. Needs JSwindow = 1.

bodyTag

imageLinkWrap.bodyTag = <tag>

This is the <body>-tag of the preview window. Needs JSwindow = 1.

Example:

# with all margins set to zero the window will exactly fit the image.
# "onBlur" closes the window automatically if it looses focus
imageLinkWrap.JSwindow = 1
imageLinkWrap.bodyTag (
   <body style="background-color:black; margin:0; padding:0;"
         bgColor="#000", leftmargin="0" topmargin="0"
         marginwidth="0" marginheight="0"
         onBlur="self.close()"
         >
)

wrap

imageLinkWrap.wrap = wrap

This wrap is placed around the <img>-tag in the preview window. Needs JSwindow = 1.

target

imageLinkWrap.target = target

This specifies the target attribute of the link. The attribute will only be created if the current Doctype allows it. Needs JSwindow = 1. Default: 'thePicture'.

Examples:

# (1) to produce:  <a target="preview" ... >
imageLinkWrap.target = preview

# (2) to use the default:  <a target="thePicture" ...>
// do nothing - use the built in default value of ".target"

# (3) to use a new window for each image
# let there be:  <a target="<hash-code>" ... >
imageLinkWrap.JSwindow = 1
imageLinkWrap.JSwindow.newWindow = 1

JSwindow

imageLinkWrap.JSwindow = boolean

If true (JSwindow = 1) Javascript will be used to open the image in a new window. The window is automatically resized to match the dimensions of the image.

JSwindow.expand

imageLinkWrap.JSwindow.expand = x, y

x and x are of data type integer. The values are added to the width and height of the preview image when calculating the width and height of the preview window.

JSwindow.newWindow

imageLinkWrap.JSwindow.newWindow = boolean

If the Doctype allows the target attribute then the image will be opened in a window with the name given by target. If that windows is kept open and the next image with the same target attribute is to be shown then it will appear in the same preview window. If JSwindow.newWindow is set to True, then a unique hash value is used as target value for each image. This guarantees that each image is opened in a new window.

JSwindow.altUrl

imageLinkWrap.JSwindow.altUrl = string

If this returns anything then it is used as URL of the preview window. Otherwise the default "showpic" script will be used.

JSwindow.altUrl_noDefaultParams

imageLinkWrap.JSwindow.altUrl_noDefaultParams = boolean

If true (JSwindow.altUrl_noDefaultParams = 1) then the image parameters are not automatically appended to the altUrl. This is useful if you want to add them yourself in a special way.

linkParams

imageLinkWrap.linkParams = any of the options of typolink

When the direct link for the preview image is calculated all attributes of linkParams are used as settings for the typolink function. In other words: Use the same parameters for linkParams that you would use for typolink. Needs JSwindow = 0.

Example:

JSwindow = 0
directImageLink = 1
linkParams.ATagParams.dataWrap (
   class="{$styles.content.imgtext.linkWrap.lightboxCssClass}"
   rel="{$styles.content.imgtext.linkWrap.lightboxRelAttribute}"
)

This way it is easy to use a lightbox and to display resized images in the frontend. More complete examples are Example: Images in lightbox "fancybox" and Example: Images in lightbox "TopUp".

stdWrap

imageLinkWrap.stdWrap = stdWrap

This adds stdWrap functionality to the almost final result.

What it does

imageLinkWrap = 1

If set to True (= 1) then this function attaches a link to an image that opens a special view of the image. By default the link points to the a "showpic" script that knows how to deal with several parameters. The script checks an md5-hash to make sure that the parameters are unchanged. See Basic example: Create a link to the showpic script.

There is an alternative. You may set directImageLink to True (= 1). In that case the link will directly point to the image - no intermediate script is involved. This method can well be used to display images in a lightbox. See Basic example: Link directly to the original image and the lightbox examples on this page.

If JSwindow is True (= 1) more fancy features are available since the preview now is opened by Javascript. Then the Javascript window title, size, background-color and more can be set to special values.

Implementation

  • imageLinkWrap in API,
  • method imageLinkWrap in
  • class ContentObjectRenderer in
  • namespace namespace TYPO3\CMS\Frontend\ContentObject; in
  • file ContentObjectRenderer.php in
  • folder typo3/sysext/frontend/Classes/ContentObject.

Examples for imageLinkWrap

Example: Larger display in a popup window
page = PAGE
page.10 = IMAGE
page.10 {
   # the relative path to the image
   # find the images in the 'lorem_ipsum' extension an copy them here
   file = fileadmin/demo/lorem_ipsum/images/b1.jpg
   # let's make the normal image small
   file.width = 80
   # yes, we want to have a preview link on the image
   imageLinkWrap = 1
   imageLinkWrap {
      # must be TRUE for anything to happen
      enable = 1
      # "m" = at most 400px wide - keep proportions
      width = 400m
      # "m" = at most 300px high - keep proportions
      height = 300
      # let's use fancy Javascript features
      JSwindow = 1
      # black background
      bodyTag = <body style="background-color:black; margin:0; padding:0;">
      # place a Javascript "close window" link onto the image
      wrap = <a href="javascript:close();"> | </a>
      # let there be a new and unique window for each image
      JSwindow.newWindow = 1
      # make the preview window 30px wider and 20px higher
      # than what the image requires
      JSwindow.expand = 30,20
}
Example: Images in lightbox "fancybox"

Let's follow this lightbox.ts example and use fancybox:

# Add the CSS and JS files
page {
   includeCSS {
      file99 = fileadmin/your-fancybox.css
   }
   includeJSFooter {
      fancybox = fileadmin/your-fancybox.js
   }
}

# Change the default rendering of images to match lightbox requirements
tt_content.image.20.1.imageLinkWrap {
   JSwindow = 0
   directImageLink = 1
   linkParams.ATagParams {
      dataWrap = class= "lightbox" data-fancybox-group="lightbox{field:uid}"
   }
}
Example: Images in lightbox "TopUp"

In this blog post (german) Paul Lunow shows a way to integrate the jQuery TopUp lightbox:

tt_content.image.20.1.imageLinkWrap >
tt_content.image.20.1.imageLinkWrap = 1
tt_content.image.20.1.imageLinkWrap {
   enable = 1
   typolink {
      # directly link to the recent image
      parameter.cObject = IMG_RESOURCE
      parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile
      parameter.cObject.file.maxW = {$styles.content.imgtext.maxW}
      parameter.override.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
      title.field = imagecaption // title
      title.split.token.char = 10
      title.if.isTrue.field = imagecaption // header
      title.split.token.char = 10
      title.split.returnKey.data = register : IMAGE_NUM_CURRENT
      parameter.cObject = IMG_RESOURCE
      parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile
      ATagParams = target="_blank"
   }
}

imgResource

imgResource contains the properties that are used with the data type imgResource.

ext
Property
ext
Data type
imageExtension / stdWrap
Default
web
Description
Target file extension for the processed image. The value web checks if the file extension is one of gif, jpg, jpeg, or png and if not it will find the best target extension. The target extension must be in the list of file extensions perceived as images. This is defined in $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] in the install tool.
width
Property
width
Data type
pixels / stdWrap
Description

If both the width and the height are set and one of the numbers is appended by an m, the proportions will be preserved and thus width and height are treated as maximum dimensions for the image. The image will be scaled to fit into the rectangle of the dimensions width and height.

If both the width and the height are set and at least one of the numbers is appended by a c, crop-scaling will be enabled. This means that the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.

The c can have a percentage value (-100 ... +100) after it, which defines how much the cropping will be moved off the center to the border.

Notice that you can only use either m or c at the same time!

Examples

This crops 120x80px from the center of the scaled image:

.width = 120c
.height = 80c

This crops 100x100px; from landscape-images at the left and portrait- images centered:

.width = 100c-100
.height = 100c

This crops 100x100px; from landscape-images a bit right of the center and portrait-images a bit higher than centered:

.width = 100c+30
.height = 100c-25
height
Property
height
Data type
pixels / stdWrap
Description
See width
params
Property
params
Data type
string / stdWrap
Description

GraphicsMagick/ImageMagick command-line:

fx. -rotate 90, -negate or -quality 90

sample
Property
sample
Data type
boolean
Description
If set, -sample is used to scale images instead of -geometry. Sample does not use anti-aliasing and is therefore much faster.
Default
0
noScale
Property
noScale
Data type
boolean / stdWrap
Description
If set, the image itself will never be scaled. Only width and height are calculated according to the other properties, so that the image is displayed resized, but the original file is used. Can be used for creating PDFs or printing of pages, where the original file could provide much better quality than a rescaled one.
Default
0
Example

Here test.jpg could have 1600 x 1200 pixels for example:

file = fileadmin/test.jpg
file.width = 240m
file.height = 240m
file.noScale = 1

This example results in an image tag like the following. Note that src="fileadmin/test.jpg" is the original file:

<img src="fileadmin/test.jpg" width="240" height="180" />
crop
Property
crop
Data type
string / stdWrap
Description
It is possible to define an area that should be taken (cropped) from the image. When not defined in typoscript the value will be taken from the file_reference when possible. With this setting you can override this behavior.
Default
not-set (when file/image is a file_reference the crop value of the file reference is used)
Examples

Disable cropping set by the editor in the back-end:

tt_content.image.20.1.file.crop =

Overrule/set cropping for all images:

tt_content.image.20.1.file.crop = 50,50,100,100
cropVariant
Property
cropVariant
Data type
string
Description
Since it's possible to define certain crop variants you can specify which one to use here.
Default
default
Examples

Use 'desktop' crop variant:

tt_content.image.20.1.file {
    crop.data = file:current:crop
    cropVariant = desktop
}
alternativeTempPath
Property
alternativeTempPath
Data type
string
Description
Enter an alternative path to use for temporary images.
frame
Property
frame
Data type
integer / stdWrap
Description

Chooses the frame in a PDF or GIF file.

"" = first frame (zero)

import
Property
import
Data type
path / stdWrap
Description

value should be set to the path of the file

with stdWrap you get the filename from the data-array

Example

This returns the first image in the field "image" from the data-array:

.import = uploads/pics/
.import.field = image
.import.listNum = 0
treatIdAsReference
Property
treatIdAsReference
Data type
boolean / stdWrap
Description
If set, given UIDs are interpreted as UIDs to sys_file_reference instead of to sys_file. This allows using file references, for example with import.data = levelmedia: ....
Default
0
maxW
Property
maxW
Data type
pixels / stdWrap
Description
Maximum width
maxH
Property
maxH
Data type
pixels / stdWrap
Description
Maximum height
minW
Property
minW
Data type
pixels / stdWrap
Description
Minimum width (overrules maxW/maxH)
minH
Property
minH
Data type
pixels / stdWrap
Description
Minimum height (overrules maxW/maxH)
stripProfile
Property
stripProfile
Data type
boolean
Description

If set, the GraphicsMagick/ImageMagick-command will use a stripProfile-command which shrinks the generated thumbnails. See the Install Tool for options and details.

If processor_stripColorProfileByDefault is set in the Install Tool, you can deactivate it by setting stripProfile=0.

Default
0
Example
10 = IMAGE
10.file = fileadmin/images/image1.jpg
10.file.stripProfile = 1
Property

Masking:

(Black hides, white shows)

Property
m.mask
Data type
imgResource
Description

The mask with which the image is masked onto m.bgImg. Both m.mask and m.bgImg is scaled to fit the size of the imgResource image!

Note: Both m.mask and m.bgImg must be valid images.

Property
m.bgImg
Data type
imgResource
Description
Note: Both m.mask and m.bgImg must be valid images.
Property
m.bottomImg
Data type
imgResource
Description

An image masked by m.bottomImg_mask onto m.bgImg before the imgResources is masked by m.mask.

Both m.bottomImg and m.bottomImg_mask is scaled to fit the size of the imgResource image!

This is most often used to create an underlay for the imgResource.

Note: Both "m.bottomImg" and m.bottomImg_mask must be valid images.

Property
m.bottomImg_mask
Data type
imgResource
Description

(optional)

Note: Both m.bottomImg and m.bottomImg_mask must be valid images.

Examples

This scales the image fileadmin/toplogo.gif to the width of 200 pixels:

file = fileadmin/toplogo.gif
file.width = 200

numberFormat

With this property you can format a float value and display it as you want, for example as a price. It is a wrapper for the number_format() function of PHP.

You can define how many decimals you want and which separators you want for decimals and thousands.

Since the properties are finally used by the PHP function number_format(), you need to make sure that they are valid parameters for that function. Consult the PHP manual, if unsure.

decimals
Property
decimals
Data type
integer / stdWrap
Description
Number of decimals the formatted number will have.
Default

0

Your input will in that case be rounded up or down to the next integer.

dec_point
Property
dec_point
Data type
string / stdWrap
Description
Character that divides the decimals from the rest of the number.
Default
.
thousands_sep
Property
thousands_sep
Data type
string / stdWrap
Description
Character that divides the thousands of the number. Set an empty value to have no thousands separator.
Default
,
Examples
lib.myPrice = TEXT
lib.myPrice {
  value = 0.8
  stdWrap.numberFormat {
    decimals = 2
    dec_point.cObject = TEXT
    dec_point.cObject {
      value = .
      stdWrap.lang.de = ,
    }
  }
  stdWrap.noTrimWrap = || &euro;|
}
# Will basically result in "0.80 €", but for German in "0,80 €".

lib.carViews = CONTENT
lib.carViews {
    table = tx_mycarext_car
    select.pidInList = 42
    renderObj = TEXT
    renderObj {
        stdWrap.field = views
        # By default use 3 decimals or
        # use the number given by the Get/Post variable precisionLevel, if set.
        stdWrap.numberFormat.decimals = 3
        stdWrap.numberFormat.decimals.override.data = GP:precisionLevel
        stdWrap.numberFormat.dec_point = ,
        stdWrap.numberFormat.thousands_sep = .
    }
}
# Could result in something like "9.586,007".

numRows

This object allows you to specify a SELECT query, which will be executed in the database. The object then returns the number of rows, which were returned by the query.

table
Property
table
Data type
Table name
Description
Name of the database table to query.
select
Property
select
Data type
select
Description

Select query for the operation.

The sub-property selectFields is overridden internally with count(*).

parseFunc

This object is used to parse some content for stuff like special typo tags, the makelinks-things and so on...

externalBlocks
Property
externalBlocks
Data type
list of tagnames / +properties
Description

This allows you to pre-split the content passed to parseFunc so that only content outside the blocks with the given tags is parsed.

Extra properties:

.[tagname] {

callRecursive: boolean. If set, the content of the block is directed into parseFunc again. Otherwise the content is just passed through with no other processing than stdWrap (see below).

callRecursive.dontWrapSelf: boolean. If set, the tags of the block is not wrapped around the content returned from parseFunc.

callRecursive.alternativeWrap: Alternative wrapping instead of the original tags.

callRecursive.tagStdWrap: stdWrap processing of the block-tags.

stdWrap: stdWrap processing of the whole block (regardless of whether callRecursive was set.)

stripNLprev: boolean. Strips off last line break of the previous outside block.

stripNLnext: boolean. Strips off first line break of the next outside block.

stripNL: boolean. Does both of the above.

HTMLtableCells: boolean. If set, then the content is expected to be a table and every table-cell is traversed.

Below, "default" means all cells and "1", "2", "3", ... overrides for specific columns.

HTMLtableCells.[default/1/2/3/...] {

callRecursive: boolean. The content is parsed through current parseFunc.

stdWrap: stdWrap processing of the content in the cell.

tagStdWrap: -> The <TD> tag is processed by stdWrap.

}

HTMLtableCells.addChr10BetweenParagraphs: boolean. If set, then all appearances of </P><P> will have a chr(10) inserted between them.

}

Example

This example is used to split regular bodytext content so that tables and blockquotes in the bodytext are processed correctly. The blockquotes are passed into parseFunc again (recursively) and further their top/bottom margins are set to 0 (so no apparent line breaks are seen)

The tables are also displayed with a number of properties of the cells overridden.

tt_content.text.20.parseFunc.externalBlocks {
      blockquote.callRecursive = 1
      blockquote.callRecursive.tagStdWrap.HTMLparser = 1
      blockquote.callRecursive.tagStdWrap.HTMLparser {
         tags.blockquote.fixAttrib.style.list = margin-bottom:0;margin-top:0;
         tags.blockquote.fixAttrib.style.always = 1
      }
      blockquote.stripNLprev = 1
      blockquote.stripNLnext = 1

      table.stripNL = 1
      table.stdWrap.HTMLparser = 1
      table.stdWrap.HTMLparser {
         tags.table.overrideAttribs = border="0" style="margin-top: 10px;"
         tags.tr.allowedAttribs = 0
         tags.td.overrideAttribs = class="table-cell" style="font-size: 10px;"
      }
}
constants
Property
constants
Data type
boolean
Description

You can define constants in the top-level object "constants" in the Setup field of your TypoScript template.

If this property is set, you can use markers (the constant name wrapped in "###") in your text. TYPO3 then substitutes the markers with the value of the according constant.

Example

constants.EMAIL = email@email.com

(The definition of the constant above is top-level TypoScript. It belongs on one level with the objects "config" and "page".)

If you now use parseFunc with constants = 1, all occurrences of the string ###EMAIL### in the text will be substituted with the actual address.

short
Property
short
Data type
(array of strings)
Description
Like constants above, but local.

Example

This substitutes all occurrences of "T3" with "TYPO3 CMS" and "T3web" with a link to typo3.org.

short {
      T3 = TYPO3 CMS
      T3web = <a href="http://typo3.org">typo3.org</a>
}
plainTextStdWrap
Property
plainTextStdWrap
Data type
stdWrap
Description
This is stdWrap properties for all non-tag content.
userFunc
Property
userFunc
Data type
function name
Description

This passes the non-tag content to a function of your own choice. Similar to e.g. postUserFunc in stdWrap.

Remember the function name must possibly be prepended user_.

nonTypoTagStdWrap
Property
nonTypoTagStdWrap
Data type
stdWrap
Description

Like plainTextStdWrap. Difference:

plainTextStdWrap works an ALL non-tag pieces in the text. nonTypoTagStdWrap is post processing of all text (including tags) between special TypoTags (unless breakoutTypoTagContent is not set for the TypoTag).

nonTypoTagUserFunc
Property
nonTypoTagUserFunc
Data type
function name
Description
Like userFunc. Differences is (like nonTypoTagStdWrap) that this is post processing of all content pieces around TypoTags while userFunc processes all non-tag content. (Notice: breakoutTypoTagContent must be set for the TypoTag if it's excluded from nonTypoTagContent).
sword
Property
sword
Data type
wrap
Description

Marks up any words from the GET-method send array sword_list[] in the text. The word MUST be at least two characters long!

Note: works only with $GLOBALS['TSFE']->no_cache = 1.

Default
<font color="red">|</font>
tags
Property
tags
Data type
tags
Description
Here you can define custom tags that will parse the content to something.
allowTags
Property
allowTags
Data type
list of strings
Description

List of tags, which are allowed to exist in code!

Highest priority: If a tag is found in allowTags, denyTags is ignored!

denyTags
Property
denyTags
Data type
list of strings
Description

List of tags, which may not exist in code! (use * for all.)

Lowest priority: If a tag is not found in allowTags, denyTags is checked. If denyTags is not * and the tag is not found in the list, the tag may exist!

Example

This allows <b>, <i>, <a> and <img> -tags to exist

.allowTags = b,i,a,img
.denyTags = *
if
Property
if
Data type
if
Description
if "if" returns false, the input value is not parsed, but returned directly.
Example

This example takes the content of the field "bodytext" and parses it through the makelinks-functions and substitutes all <LINK> and <TYPOLIST>-tags with something else.

tt_content.text.default {
    20 = TEXT
    20.stdWrap.field = bodytext
    20.stdWrap.wrap = | <br>
    20.stdWrap.brTag = <br>
    20.stdWrap.parseFunc {
        makelinks = 1
        makelinks.http.keep = path
        makelinks.http.extTarget = _blank
        makelinks.mailto.keep = path
        tags {
            link = TEXT
            link {
                stdWrap.current = 1
                stdWrap.typolink.extTarget = _blank
                stdWrap.typolink.target = {$cLinkTagTarget}
                stdWrap.typolink.wrap = <p style="color: red; font-weight: bold;">|</p>
                stdWrap.typolink.parameter.data = parameters : allParams
            }

            typolist < tt_content.bullets.default.20
            typolist.trim = 1
            typolist.field >
            typolist.current = 1
        }
    }

replacement

This object performs an ordered search and replace operation on the current content with the possibility of using PCRE regular expressions. An array with numeric indices defines the order of actions and thus allows multiple replacements at once.

replace
Property
replace
Data type
string / stdWrap
Description
Defines the string to be used for the replacement.
useRegExp
Property
useRegExp
Data type
boolean / stdWrap
Description
Defines that the search and replace strings are considered as PCRE regular expressions.
Default
0

Example

10 {
      search = #(a )CAT#i
      replace = \1cat
      useRegExp = 1
}
useOptionSplitReplace
Property
useOptionSplitReplace
Data type
boolean / stdWrap
Description
This property allows to use optionSplit for the replace property. That way the replace property can be different depending on the occurrence of the string (first/middle/last part, ...). This works for both normal and regular expression replacements. For examples see below.
Default
0
Examples
10 = TEXT
10 {
    value = There_are_a_cat,_a_dog_and_a_tiger_in_da_hood!_Yeah!
    stdWrap.replacement {
        10 {
            search = _
            replace.char = 32
        }
        20 {
            search = in da hood
            replace = around the block
        }
        30 {
            search = #a (Cat|Dog|Tiger)#i
            replace = an animal
            useRegExp = 1
        }
    }
}

This returns: "There are an animal, an animal and an animal around the block! Yeah!".

The following examples demonstrate the use of optionSplit:

20 = TEXT
20.value = There_are_a_cat,_a_dog_and_a_tiger_in_da_hood!_Yeah!
20.stdWrap.replacement.10 {
    search = _
    replace = 1 || 2 || 3
    useOptionSplitReplace = 1
}

This returns: "There1are2a3cat,3a3dog3and3a3tiger3in3da3hood!3Yeah!"

30 = TEXT
30.value = There are a cat, a dog and a tiger in da hood! Yeah!
30.stdWrap.replacement.10 {
    search = #(a) (Cat|Dog|Tiger)#i
    replace = ${1} tiny ${2} || ${1} midsized ${2} || ${1} big ${2}
    useRegExp = 1
    useOptionSplitReplace = 1
}

This returns: "There are a tiny cat, a midsized dog and a big tiger in da hood! Yeah!"

round

With this property you can round the value up, down or to a certain number of decimals. For each roundType the according PHP function will be used.

The value will be converted to a float value before applying the selected round method.

roundType
Property
roundType
Data type
string / stdWrap
Description

Round method which should be used.

Possible keywords:

ceil
Round the value up to the next integer.
floor
Round the value down to the previous integer.
round
Round the value to the specified number of decimals.
Default
round
decimals
Property
decimals
Data type
integer / stdWrap
Description
Number of decimals the rounded value will have. Only used with the roundType "round". Defaults to 0, so that your input will in that case be rounded up or down to the next integer.
Default
0
round
Property
round
Data type
boolean
Description
Set round = 1 to enable rounding.
Default
0
Examples
lib.number = TEXT
lib.number {
    value = 3.14159
    stdWrap.round = 1
    stdWrap.round.roundType = round
    stdWrap.round.decimals = 2
}

This returns 3.14.

select

This object generates an SQL-select statement to select records from the database.

Some records are hidden or timed by start- and end-times. This is automatically added to the SQL-select by looking for "enablefields" in the $GLOBALS['TCA'].

Warning

Do not use GET or POST data like GPvar directly with this object! Avoid SQL injections! Don't trust any external data! Secure any unknown data, for example with intval.

Comprehensive example

See PHP source code for \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer, ContentObjectRenderer::getQuery(), ContentObjectRenderer::getWhere().

Condensed form:

10 = CONTENT
10 {
   table =
   select {
      uidInList =
      pidInList =
      recursive =
      orderBy =
      groupBy =
      max =
      begin =
      where =
      languageField =
      includeRecordsWithoutDefaultTranslation =
      selectFields =
      join =
      leftjoin =
      rightjoin =
   }
}
uidInList
Property
uidInList
Data type
list of record_ids / stdWrap
Description

Comma-separated list of record uids from the according database table. For example when the select function works on the table tt_content, then this will be uids of tt_content records.

Note: this is a special keyword and replaced with the id of the current record.

Example
select.uidInList = 1,2,3
select.uidInList = this
pidInList
Property
pidInList
Data type
list of page_ids / stdWrap
Description

Comma-separated list of pids of the record. This will be page uids (pids). For example when the select function works on the table tt_content, then this will be pids of tt_content records, the parent pages of these records.

Pages in the list, which are not visible for the website user, are automatically removed from the list. Thereby no records from hidden, timed or access-protected pages will be selected! Nor will be records from recyclers. Exception: The hidden pages will be listed in preview mode.

Special keyword: this
Is replaced with the id of the current page.
Special keyword: root
Allows to select records from the root-page level (records with pid=0, e.g. useful for the table "sys_category" and others).
Special value: -1
Allows to select versioned records in workspaces directly.
Default
this
Example

Fetch related sys_category records stored in the MM intermediate table:

10 = CONTENT
10 {
   table = sys_category
   select {
      pidInList = root,-1
      selectFields = sys_category.*
      join = sys_category_record_mm ON sys_category_record_mm.uid_local = sys_category.uid
      where.data = field:_ORIG_uid // field:uid
      where.intval = 1
      where.wrap = sys_category_record_mm.uid_foreign=|
      orderBy = sys_category_record_mm.sorting_foreign
      languageField = 0 # disable translation handling of sys_category
   }
}
recursive
Property
recursive
Data type
integer / stdWrap
Description
Number of recursive levels for the pidInList.
Default
0
orderBy
Property
orderBy
Data type
SQL-orderBy / stdWrap
Description
ORDER BY clause without the words "ORDER BY".
Example
orderBy = sorting, title
groupBy
Property
groupBy
Data type
SQL-groupBy / stdWrap
Description
GROUP BY clause without the words "GROUP BY".
Example
groupBy = CType
max
Property
max
Data type
integer + Calc +"total" / stdWrap
Description

Max records

Special keyword: "total" is substituted with count(*).

begin
Property
begin
Data type
integer + Calc +"total" / stdWrap
Description

Begin with record number value.

Special keyword: total
Is substituted with count(*).
where
Property
where
Data type
SQL-where / stdWrap
Description
WHERE clause without the word "WHERE".
Example
where = (title LIKE '%SOMETHING%' AND NOT doktype)
languageField
Property
languageField
Data type
string / stdWrap
Description

By default all records that have language-relevant information in the TCA "ctrl"-section are translated on translated pages.

This can be disabled by setting languageField = 0.

includeRecordsWithoutDefaultTranslation
Property
includeRecordsWithoutDefaultTranslation
Data type
boolean / stdWrap
Description
If content language overlay is activated and the option languageField is not disabled, includeRecordsWithoutDefaultTranslation allows to additionally fetch records, which do not have a parent in the default language.
Default
0
selectFields
Property
selectFields
Data type
string / stdWrap
Description

List of fields to select, or count(*).

If the records need to be localized, please include the relevant localization-fields (uid, pid, languageField and transOrigPointerField). Otherwise the TYPO3 internal localization will not succeed.

Default
*
join, leftjoin, rightjoin
Property
join, leftjoin, rightjoin
Data type
string / stdWrap
Description
Enter the table name for JOIN, LEFT OUTER JOIN and RIGHT OUTER JOIN respectively.
markers
Property
markers
Data type
(array of markers)
Description

The markers defined in this section can be used, wrapped in the usual ###markername### way, in any other property of select. Each value is properly escaped and quoted to prevent SQL injection problems. This provides a way to safely use external data (e.g. database fields, GET/POST parameters) in a query.

Available sub-properties:

<markername>.value (value)
Sets the value directly.
<markername>.commaSeparatedList (boolean)
If set, the value is interpreted as a comma-separated list of values. Each value in the list is individually escaped and quoted.
(stdWrap properties ...)
All stdWrap properties can be used for each markername.

Example

page.60 = CONTENT
page.60 {
      table = tt_content
      select {
         pidInList = 73
         where = header != ###whatever###
         orderBy = ###sortfield###
         markers {
            whatever.data = GP:first
            sortfield.value = sor
            sortfield.wrap = |ting
         }
      }
}

This example selects all records from table tt_content, which are on page 73 and which don't have the header set to the value provided by the Get/Post variable "first", ordered by the content of the column "sorting".

split

This object is used to split the input by a character and then parse the result onto some functions.

For each iteration the split index starting with 0 (zero) is stored in the register key SPLIT_COUNT.

token
Property
token
Data type
string / stdWrap
Description
String or character (token) used to split the value.
max
Property
max
Data type
integer / stdWrap
Description
Maximum number of splits.
min
Property
min
Data type
integer / stdWrap
Description
Minimum number of splits.
returnKey
Property
returnKey
Data type
integer / stdWrap
Description
Instead of parsing the split result, just return the element of the index with this number immediately and stop processing of the split function.
returnCount
Property
returnCount
Data type
boolean / stdWrap
Description
Counts all elements resulting from the split, returns their number and stops processing of the split function.

Example

# returns 9
1 = TEXT
1 {
      value = x,y,z,1,2,3,a,b,c
      split.token = ,
      split.returnCount = 1
}
cObjNum
Property
cObjNum
Data type
cObjNum + optionSplit / stdWrap
Description
This is a pointer the array of this object ("1,2,3,4"), that should treat the items, resulting from the split.
1,2,3,4
Property
1,2,3,4
Data type
carray / stdWrap
Description

The object that should treat the value.

Note: The "current"-value is set to the value of current item, when the objects are called. See stdWrap / current.

Example for stdWrap

1.current = 1
1.wrap = <b> | </b>

Example for CARRAY

1 {
      10 = TEXT
      10.stdWrap.current = 1
      10.stdWrap.wrap = <b> | </b>
}
wrap
Property
wrap
Data type
wrap + optionSplit / stdWrap
Description
Defines a wrap for each item.
Example

This is an example of TypoScript code that imports the content of field "bodytext" from the $cObj->data-array (ln 2). The content is split by the line break character (ln 4). The items should all be treated with a stdWrap (ln 5) which imports the value of the item (ln 6). This value is wrapped in a table row where the first column is a bullet-gif (ln 7). Finally the whole thing is wrapped in the proper table-tags (ln 9). :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
20 = TEXT
20.stdWrap {
    field = bodytext
    split {
        token.char = 10
        cObjNum = 1
        1.current = 1
        1.wrap = <tr><td><img src="dot.gif"></td><td> | </td></tr>
    }
    stdWrap.wrap = <table style="width: 368px;"> | </table><br>
}

stdWrap

This function is often added as a property to values in TypoScript.

Example with the property "value" of the content object "TEXT":

10 = TEXT
10.value = some text
10.stdWrap.case = upper

Here the content of the object "10" is uppercased before it is returned.

stdWrap properties are executed in the order they appear in the table below. If you want to study this further please refer to typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php, where you will find the function stdWrap() and the array $stdWrapOrder, which represents the exact order of execution.

Note that the stdWrap property "orderedStdWrap" allows you to execute multiple stdWrap functions in a freely selectable order.

Content-supplying properties of stdWrap

The properties in this table are parsed in the listed order. The properties data, field, current, cObject (in that order!) are special as they are used to import content from variables or arrays. The above example could be rewritten to this:

10 = TEXT
10.value = some text
10.stdWrap.case = upper
10.stdWrap.field = header

Now the line 10.value = some text is obsolete, because the whole value is "imported" from the field called "header" from the $cObj->data-array.

Getting data
setContentToCurrent
Property
setContentToCurrent
Data type
boolean / stdWrap
Description
Sets the current value to the incoming content of the function.
addPageCacheTags
Property
addPageCacheTags
Data type
string / stdWrap
Description
Comma-separated list of cache tags, which should be added to the page cache.

Example

addPageCacheTags = pagetag1,pagetag2,pagetag3

This will add the tags "pagetag1", "pagetag2" and "pagetag3" to the according cached pages in cache_pages.

Pages, which have been cached with a tag, can be deleted from cache again with the TSconfig option TCEMAIN.clearCacheCmd.

Note

If you instead want to store rendered content into the caching framework, see the stdWrap feature cache.

setCurrent
Property
setCurrent
Data type
string / stdWrap
Description
Sets the "current"-value. This is normally set from some outside routine, so be careful with this. But it might be handy to do this
lang
Property
lang
Data type
Array of language keys / stdWrap
Description

This is used to define optional language specific values.

If the global language key set by the ->config property .language is found in this array, then this value is used instead of the default input value to stdWrap.

Example
config.language = de
page.10 = TEXT
page.10.value = I am a Berliner!
page.10.stdWrap.lang.de = Ich bin ein Berliner!

Output will be "Ich bin..." instead of "I am..."

data
Property
data
Data type
getText / stdWrap
field
Property
field
Data type
Field name / stdWrap
Description

Sets the content to the value of the according field (which comes from $cObj->data[*field*]).

Note: $cObj->data changes depending on the context. See the description for the data type "getText"/field!

Example

.field = title

This sets the content to the value of the field "title".

You can also check multiple field names, if you divide them by "//".

Example

.field = nav_title // title

Here the content from the field nav_title will be returned unless it is a blank string. If a blank string, the value of the title field is returned.

current
Property
current
Data type
boolean / stdWrap
Description
Sets the content to the "current"-value (see ->split)
cObject
Property
cObject
Data type
cObject
Description
Loads content from a content object.
numRows
Property
numRows
Data type
->numRows / stdWrap
Description
Returns the number of rows resulting from the supplied SELECT query.
preUserFunc
Property
preUserFunc
Data type
function name
Description

Calls the provided PHP function. If you specify the name with a '->' in it, then it is interpreted as a call to a method in a class.

Two parameters are sent to the PHP function: As first parameter a content variable, which contains the current content. This is the value to be processed. As second parameter any sub-properties of preUserFunc are provided to the function.

See postUserFunc.

Override and conditions
override
Property
override
Data type
string / stdWrap
Description
if "override" returns something else than "" or zero (trimmed), the content is loaded with this!
preIfEmptyListNum
Property
preIfEmptyListNum
Data type
(as "listNum" below)
Description
(as "listNum" below)
ifNull
Property
ifNull
Data type
string / stdWrap
Description
If the content is null (NULL type in PHP), the content is overridden with the value defined here.

Example

page.10 = COA_INT
page.10 {
   10 = TEXT
   10 {
      stdWrap.field = description
      stdWrap.ifNull = No description defined.
   }
}

This example shows the content of the field description or, if that field contains the value NULL, the text "No description defined.".

ifEmpty
Property
ifEmpty
Data type
string / stdWrap
Description
If the trimmed content is empty at this point, the content is loaded with ifEmpty. Zeros are treated as empty values!
ifBlank
Property
ifBlank
Data type
string / stdWrap
Description
Same as ifEmpty but the check is done against ''. Zeros are not treated as blank values!
listNum
Property
listNum
Data type
integer +calc +"last" +"rand" / stdWrap
Description

Explodes the content with "," (comma) and the content is set to the item[value].

Special keyword: last
Is set to the last element of the array!
Special keyword: rand
Returns a random item out of a list.

.splitChar (string):

Defines the string used to explode the value. If splitChar is an integer, the character with that number is used (e.g. "10" to split lines...).

Default: "," (comma)

.stdWrap (stdWrap properties):

stdWrap properties of the listNum...

Examples

We have a value of "item 1, item 2, item 3, item 4":

This would return "item 3":

.listNum = last – 1

That way the subtitle field to be displayed is chosen randomly upon every reload:

page.5 = COA_INT
page.5 {
   10 = TEXT
   10 {
      stdWrap.field = subtitle
      stdWrap.listNum = rand
   }
}
trim
Property
trim
Data type
boolean / stdWrap
Description
If set, the PHP-function trim() will be used to remove whitespaces around the value.
strPad
Property
strPad
Data type
strPad
Description
Pads the current content to a certain length. You can define the padding characters and the side(s), on which the padding should be added.
stdWrap
Property
stdWrap
Data type
stdWrap
Description
Recursive call to the stdWrap function.
required
Property
required
Data type
boolean / stdWrap
Description

This flag requires the content to be set to some value after any content-import and treatment that might have happened until now (data, field, current, listNum, trim). Zero is not regarded as empty! Use "if" instead!

If the content is empty, "" is returned immediately.

if
Property
if
Data type
if
Description
If the if-object returns false, stdWrap returns "" immediately.
fieldRequired
Property
fieldRequired
Data type
Field name / stdWrap
Description
The value in this field must be set.
Parsing data
csConv
Property
csConv
Data type
string / stdWrap
Description
Convert the charset of the string from the charset given as value to the current rendering charset of the frontend (UTF-8).
parseFunc
Property
parseFunc
Data type
object path reference / parseFunc / stdWrap
Description

Processing instructions for the content.

Note: If you enter a string as value, this will be taken as a reference to an object path globally in the TypoScript object tree. This will be the basis configuration for parseFunc merged with any properties you add here. It works exactly like references does for content elements.

Example

parseFunc = < lib.parseFunc_RTE
parseFunc.tags.myTag = TEXT
parseFunc.tags.myTag.value = This will be inserted when &lt;myTag&gt; is found!
HTMLparser
Property
HTMLparser
Data type
boolean / HTMLparser / stdWrap
Description

This object allows you to parse the HTML-content and perform all kinds of advanced filtering on the content.

Value must be set and properties are those of HTMLparser.

(See Rich Text Editors (RTE) for more information about RTE transformations)

split
Property
split
Data type
split / stdWrap
replacement
Property
replacement
Data type
replacement / stdWrap
Description
Performs an ordered search/replace on the current content with the possibility of using PCRE regular expressions. An array with numeric indices defines the order of actions and thus allows multiple replacements at once.
prioriCalc
Property
prioriCalc
Data type
boolean / stdWrap
Description

Calculation of the value using operators -+*/%^ plus respects priority to + and - operators and parenthesis levels ().

. (period) is decimal delimiter.

Returns a doublevalue.

If prioriCalc is set to "intval" an integer is returned.

There is no error checking and division by zero or other invalid values may generate strange results. Also you should use a proper syntax because future modifications to the function used may allow for more operators and features.

Examples

100%7 = 2
-5*-4 = 20
+6^2 = 36
6 ^(1+1) = 36
-5*-4+6^2-100%7 = 54
-5 * (-4+6) ^ 2 - 100%7 = 98
-5 * ((-4+6) ^ 2) - 100%7 = -22
char
Property
char
Data type
integer / stdWrap
Description

Content is set to chr(*value*). This returns a one-character string containing the character specified by ascii code. Reliable results will be obtained only for character codes in the integer range 0 - 127. See the PHP manual:

$content = chr((int)$conf['char']);
intval
Property
intval
Data type
boolean / stdWrap
Description

PHP function intval() returns an integer:

$content = intval($content);
hash
Property
hash
Data type
string / stdWrap
Description
Returns a hashed value of the current content. Set to one of the algorithms which are available in PHP. For a list of supported algorithms see http://www.php.net/manual/en/function.hash-algos.php .

Example

page.10 = TEXT
page.10 {
   value = test@example.com
   stdWrap.hash = md5
   stdWrap.wrap = <img src="http://www.gravatar.com/avatar/|" />
}
round
Property
round
Data type
round / stdWrap
Description
Round the value with the selected method to the given number of decimals.
numberFormat
Property
numberFormat
Data type
numberFormat
Description
Format a float value to any number format you need (e.g. useful for prices).
date
Property
date
Data type
date-conf / stdWrap
Description

The content should be data-type "UNIX-time". Returns the content formatted as a date:

$content = date($conf['date'], $content);

Properties:

.GMT: If set, the PHP function gmdate() will be used instead of date().

Example

Render in human readable form:

page.10 = TEXT
page.10.value {
   # format like 2017-05-31 09:08
   field = tstamp
   date = Y-m-d H:i
}
strftime
Property
strftime
Data type
strftime-conf / stdWrap
Description

Exactly like "date" above. See the PHP manual (strftime) for the codes, or data type "strftime-conf".

This formatting is useful if the locale is set in advance in the CONFIG object. See there.

Properties:

.charset
Can be set to the charset of the output string if you need to convert it to UTF-8. Default is to take the intelligently guessed charset from TYPO3\CMS\Core\Charset\CharsetConverter.
.GMT
If set, the PHP function gmstrftime() will be used instead of strftime().
strtotime
Property
strtotime
Data type
string
Description

Allows conversion of formatted dates to timestamp, e.g. to perform date calculations.

Possible values are 1 or any time string valid as first argument of the PHP strtotime() function.

Example
date_as_timestamp = TEXT
date_as_timestamp {
   value = 2015-04-15
   strtotime = 1
}

Example

next_weekday = TEXT
next_weekday {
   data = GP:selected_date
   strtotime = + 2 weekdays
   strftime = %Y-%m-%d
}
age
Property
age
Data type
boolean or string / stdWrap
Description

If enabled with a "1" (number, integer) the content is seen as a date (UNIX-time) and the difference from present time and the content-time is returned as one of these eight variations:

"xx min" or "xx hrs" or "xx days" or "xx yrs" or "xx min" or "xx hour" or "xx day" or "year"

The limits between which layout is used are 60 minutes, 24 hours and 365 days.

If you set this property with a non-integer, it is used to format the eight units. The first four values are the plural values and the last four are singular. This is the default string:

" min| hrs| days| yrs| min| hour| day| year"

Set another string if you want to change the units. You may include the "-signs. They are removed anyway, but they make sure that a space which you might want between the number and the unit stays.

Example

lib.ageFormat = TEXT
lib.ageFormat.stdWrap.data = page:tstamp
lib.ageFormat.stdWrap.age = " Minuten | Stunden | Tage | Jahre | Minute | Stunde | Tag | Jahr"
case
Property
case
Data type
case / stdWrap
Description

Converts case

Uses "UTF-8" for the operation.

bytes
Property
bytes
Data type
boolean / stdWrap
Default
iec, 1024
Description

This is for number values. When the 'bytes' property is added and set to 'true' then a number will be formatted in 'bytes' style with two decimals like '1.53 KiB' or '1.00 MiB'. Learn about common notations at Wikipedia "Kibibyte". IEC naming with base 1024 is the default. Use sub-properties for customisation.

.labels = iec
This is the default. IEC labels and base 1024 are used. Built in IEC labels are " | Ki| Mi| Gi| Ti| Pi| Ei| Zi| Yi". You need to append a final string like 'B' or '-Bytes' yourself.
.labels = si
In this case SI labels and base 1000 are used. Built in IEC labels are " | k| M| G| T| P| E| Z| Y". You need to append a final string like 'B' yourself.
.labels = "..."
Custom values can be defined as well like with .labels = " Byte| Kilobyte| Megabyte| Gigabyte". Use a vertical bar to separate the labels. Enclose the whole string in double quotes.
.base = 1000
Only with custom labels you can choose to set a base of1000. All other values, including the default, mean base 1024.

Attention

If the value isn't a number the internal PHP function may issue a warning which - depending on you error handling settings - can interrupt execution. Example:

value = abc
bytes = 1

will show 0 but may raise a warning or an exception.

Examples Output value 1000 without special formatting. Shows 1000:

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
}

Format value 1000 in IEC style with base=1024. Shows 0.98 Ki:

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
}

Format value 1000 in IEC style with base=1024 and 'B' supplied by us. Shows 0.98 KiB:

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   noTrimWrap = ||B|
}

Format value 1000 in SI style with base=1000. Shows 1.00 k:

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = si
}

Format value 1000 in SI style with base=1000 and 'b' supplied by us. Shows 1.00 kb:

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = si
   noTrimWrap = ||b|
}

Format value 1000 with custom label and base=1000. Shows 1.00 x 1000 Bytes:

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = " x 1 Byte| x 1000 Bytes"
   bytes.base = 1000
}

Format value 1000 with custom label and base=1000. Shows 1.00 kilobyte (kB):

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = " byte (B)| kilobyte (kB)| megabyte (MB)| gigabyte (GB)| terabyte (TB)| petabyte (PB)| exabyte (EB)| zettabyte (ZB)| yottabyte YB"
   bytes.base = 1000
}

Format value 1000 with custom label and base=1024. Shows 0.98 kibibyte (KiB):

page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = " byte (B)| kibibyte (KiB)| mebibyte (MiB)| gibibyte (GiB)| tebibyte (TiB)| pepibyte (PiB)| exbibyte (EiB)| zebibyte (ZiB)| yobibyte YiB"
   bytes.base = 1024
}
substring
Property
substring
Data type
[p1], [p2] / stdWrap
Description

Returns the substring with [p1] and [p2] sent as the 2nd and 3rd parameter to the PHP mb_substr function.

Uses "UTF-8" for the operation.

cropHTML
Property
cropHTML
Data type
string / stdWrap
Description

Crops the content to a certain length. In contrast to stdWrap.crop it respects HTML tags. It does not crop inside tags and closes open tags. Entities (like ">") are counted as one char. See stdWrap.crop below for a syntax description and examples.

Note that stdWrap.crop should not be used if stdWrap.cropHTML is already used.

stripHtml
Property
stripHtml
Data type
boolean / stdWrap
Description
Strips all HTML tags.
crop
Property
crop
Data type
string / stdWrap
Description

Crops the content to a certain length.

You can define up to three parameters, of which the third one is optional. The syntax is: [numbers of characters to keep] | [ellipsis] | [keep whole words]

numbers of characters to keep (integer): Define the number of characters you want to keep. For positive numbers, the first characters from the beginning of the string will be kept, for negative numbers the last characters from the end will be kept.

ellipsis (string): The signs to be added instead of the part, which was cropped of. If the number of characters was positive, the string will be prepended with the ellipsis, if it was negative, the string will be appended with the ellipsis.

keep whole words (boolean): If set to 0 (default), the string is always cropped directly after the defined number of characters. If set to 1, only complete words are kept. Then a word, which would normally be cut in the middle, is removed completely.

Examples

20 | ... => max 20 characters. If more, the value will be truncated to the first 20 characters and prepended with "..."

-20 | ... => max 20 characters. If more, the value will be truncated to the last 20 characters and appended with "..."

20 | ... | 1 => max 20 characters. If more, the value will be truncated to the first 20 characters and prepended with "...". If the division is in the middle of a word, the remains of that word is removed.

Uses "UTF-8" for the operation.

rawUrlEncode
Property
rawUrlEncode
Data type
boolean / stdWrap
Description
Passes the content through the PHP function rawurlencode().
htmlSpecialChars
Property
htmlSpecialChars
Data type
boolean / stdWrap
Description

Passes the content through the PHP function htmlspecialchars().

Additional property preserveEntities will preserve entities so only non-entity characters are affected.

encodeForJavaScriptValue
Property
encodeForJavaScriptValue
Data type
boolean / stdWrap
Description

Encodes content to be used safely inside strings in JavaScript. Characters, which can cause problems inside JavaScript strings, are replaced with their encoded equivalents. The resulting string is not enclosed in quotes. If needed, quotes can be added using TypoScript.

Passes the content through the core function \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue.

Example

10 = TEXT
10 {
      stdWrap.data = GP:sWord
      stdWrap.encodeForJavaScriptValue = 1
      stdWrap.wrap = setSearchWord(|);
}
doubleBrTag
Property
doubleBrTag
Data type
string / stdWrap
Description
All double-line-breaks are substituted with this value.
br
Property
br
Data type
boolean / stdWrap
Description
Pass the value through the PHP function nl2br(). This converts each line break to a <br /> or a <br> tag depending on doctype.
brTag
Property
brTag
Data type
string / stdWrap
Description
All ASCII codes of "10" (line feed, LF) are substituted with the value, which has been provided in this property.
encapsLines
Property
encapsLines
Data type
encapsLines / stdWrap
Description
Lets you split the content by chr(10) and process each line independently. Used to format content made with the RTE.
keywords
Property
keywords
Data type
boolean / stdWrap
Description
Splits the content by characters "," ";" and php:chr(10) (return), trims each value and returns a comma-separated list of the values.
innerWrap
Property
innerWrap
Data type
wrap / stdWrap
Description
Wraps the content.
innerWrap2
Property
innerWrap2
Data type
wrap / stdWrap
Description
Same as innerWrap (but watch the order in which they are executed).
addParams
Property
addParams
Data type
addParams / stdWrap
Description
Lets you add tag parameters to the content if the content is a tag!
preCObject
Property
preCObject
Data type
cObject
Description
cObject prepended the content.
postCObject
Property
postCObject
Data type
cObject
Description
cObject appended the content.
wrapAlign
Property
wrapAlign
Data type
align / stdWrap
Description
Wraps content with <div style=text-align:[*value*];"> | </div> if align is set.
wrap
Property
wrap
Data type
wrap /+.splitChar / stdWrap
Description
splitChar defines an alternative splitting character (default is "|" - the vertical line)
noTrimWrap
Property
noTrimWrap
Data type
"special" wrap /+.splitChar / stdWrap
Description

This wraps the content without trimming the values. That means that surrounding whitespaces stay included! Note that this kind of wrap does not only need a special character in the middle, but that it also needs the same special character to begin and end the wrap (default for all three is "|").

Additional property:

splitChar

Can be set to define an alternative special character. stdWrap is available. Default is "|" - the vertical line. This sub-property is useful in cases when the default special character would be recognized by optionSplit (which takes precedence over noTrimWrap).

Example

noTrimWrap = | val1 | val2 |

In this example the content with the values val1 and val2 will be wrapped; including the whitespaces.

Example

noTrimWrap = ^ val1 ^ val2 ^ || ^ val3 ^ val4 ^
noTrimWrap.splitChar = ^

optionSplit will use the "||" to have two subparts in the first part. In each subpart noTrimWrap will then use the "^" as special character.

wrap2
Property
wrap2
Data type
wrap /+.splitChar / stdWrap
Description
same as wrap (but watch the order in which they are executed)
dataWrap
Property
dataWrap
Data type
mixed / stdWrap
Description
The content is parsed for pairs of curly braces. The content of the curly braces is of the type getText and is substituted with the result of getText.

Example

<div id="{tsfe : id}"> | </div>

This will produce a <div> tag around the content with an id attribute that contains the number of the current page.

prepend
Property
prepend
Data type
cObject
Description
cObject prepended to content (before)
append
Property
append
Data type
cObject
Description
cObject appended to content (after)
wrap3
Property
wrap3
Data type
wrap /+.splitChar / stdWrap
Description
same as wrap (but watch the order in which they are executed)
orderedStdWrap
Property
orderedStdWrap
Data type
Array of numeric keys with / stdWrap each
Description
Execute multiple stdWrap statements in a freely selectable order. The order is determined by the numeric order of the keys. This allows to use multiple stdWrap statements without having to remember the rather complex sorting order in which the stdWrap functions are executed.

Example

10 = TEXT
10.value = a
10.stdWrap.orderedStdWrap {
   30.wrap = |.

   10.wrap = is | working
   10.innerWrap = &nbsp;|&nbsp;

   20.wrap = This|solution
   20.stdWrap.wrap = &nbsp;|&nbsp;
}

In this example orderedStdWrap is executed on the value "a". 10.innerWrap is executed first, followed by 10.wrap. Then the next key is processed which is 20. Afterwards 30.wrap is executed on what already was created.

This results in "This is a working solution."

outerWrap
Property
outerWrap
Data type
wrap / stdWrap
Description
Wraps the complete content
insertData
Property
insertData
Data type
boolean / stdWrap
Description
If set, then the content string is parsed like dataWrap above.

Example

Displays the page title:

10 = TEXT
10.value = This is the page title: {page:title}
10.stdWrap.insertData = 1
postUserFunc
Property
postUserFunc
Data type
function name
Description

Calls the provided PHP function. If you specify the name with a '->' in it, then it is interpreted as a call to a method in a class.

Two parameters are sent to the PHP function: As first parameter a content variable, which contains the current content. This is the value to be processed. As second parameter any sub-properties of postUserFunc are provided to the function.

The description of the cObject USER contains some more in-depth information.

Example

You can paste this example directly into a new template record:

page = PAGE
page.typeNum = 0

page.10 = TEXT
page.10 {
   value = Hello World!
   stdWrap.postUserFunc = Your\NameSpace\YourClass->reverseString
   stdWrap.postUserFunc.uppercase = 1
}

page.20 = TEXT
page.20 {
   value = Hello World!
   stdWrap.postUserFunc = Your\NameSpace\YourClass->reverseString
   stdWrap.postUserFunc.uppercase = 1
   stdWrap.postUserFunc.typolink = 11
}

Your methods will get the parameters $content and $conf (in that order) and need to return a string.

namespace Your\NameSpace;
/**
   * Example of a method in a PHP class to be called from TypoScript
   *
   */
class YourClass
{
   /**
   * Reference to the parent (calling) cObject set from TypoScript
   */
   public $cObj;

   /**
   * Custom method for data processing. Also demonstrates how this gives us the ability to use methods in the parent object.
   *
   * @param       string          When custom methods are used for data processing (like in stdWrap functions), the $content variable will hold the value to be processed. When methods are meant to just return some generated content (like in USER and USER_INT objects), this variable is empty.
   * @param       array           TypoScript properties passed to this method.
   * @return      string  The input string reversed. If the TypoScript property "uppercase" was set, it will also be in uppercase. May also be linked.
   */
   public function reverseString($content, $conf)
   {
      $content = strrev($content);
      if (isset($conf['uppercase']) && $conf['uppercase'] === '1') {
      // Use the method caseshift() from ContentObjectRenderer.php.
      $content = $this->cObj->caseshift($content, 'upper');
      }
      if (isset($conf['typolink'])) {
      // Use the method getTypoLink() from ContentObjectRenderer.php.
      $content = $this->cObj->getTypoLink($content, $conf['typolink']);
      }
      return $content;
   }
}

For page.10 the content, which is present when postUserFunc is executed, will be given to the PHP function reverseString(). The result will be "!DLROW OLLEH".

The content of page.20 will be processed by the function reverseString() from the class YourClass. This also returns the text "!DLROW OLLEH", but wrapped into a link to the page with the ID 11. The result will be <a href="index.php?id=11">!DLROW OLLEH</a>.

Note how in the second example $cObj, the reference to the calling cObject, is utilised to use functions from ContentObjectRenderer.php!

postUserFuncInt
Property
postUserFuncInt
Data type
function name
Description

Calls the provided PHP function. If you specify the name with a '->' in it, then it is interpreted as a call to a method in a class.

Two parameters are sent to the PHP function: As first parameter a content variable, which contains the current content. This is the value to be processed. As second parameter any sub-properties of postUserFuncInt are provided to the function.

The result will be rendered non-cached, outside the main page-rendering. Please see the description of the cObject USER_INT.

Supplied by Jens Ellerbrock

prefixComment
Property
prefixComment
Data type
string / stdWrap
Description

Prefixes content with an HTML comment with the second part of input string (divided by "|") where first part is an integer telling how many trailing tabs to put before the comment on a new line.

The content is parsed through insertData.

Example

prefixComment = 2 | CONTENT ELEMENT, uid:{field:uid}/{field:CType}

Will indent the comment with 1 tab (and the next line with 2+1 tabs)

editIcons
Property
editIcons
Data type
string / stdWrap
Description

If not empty, then insert an icon linking to typo3/sysext/backend/Classes/Controller/EditDocumentController.php with some parameters to build and backend user edit form for certain fields.

The value of this property is a list of fields from a table to edit. It's assumed that the current record of the cObject is the record to be edited.

Syntax: optional table name : comma list of field names [list of pallette-field names separated by | ]

.beforeLastTag:
Possible values are 1, 0 and -1. If set (1), the icon will be inserted before the last HTML tag in the content. If -1, the icon will be prepended to the content. If zero (0), the icon is appended in the end of the content.
.styleAttribute: String.
Adds a style-attribute to the icon image with this value. For instance you can set "position:absolute" if you want a non-destructive insertion of the icon. Notice: For general styling all edit icons has the class "frontEndEditIcons" which can be addressed from the stylesheet of the site.
.iconTitle: String.
The title attribute of the image tag.
.iconImg: HTML.
Alternative HTML code instead of the default icon shown. Can be used to set another icon for editing (for instance a red dot or otherwise... :-)

Example

This will insert an edit icon which links to a form where the header and bodytext fields are displayed and made available for editing (provided the user has access!).

editIcons = tt_content : header, bodytext

Or this line that puts the header_align and date field into a "palette" which means they are displayed on a single line below the header field. This saves some space.

editIcons = header[header_align|date], bodytext
editPanel
Property
editPanel
Data type
boolean / EDITPANEL
Description
See cObject EDITPANEL.
cache
Property
cache
Data type
cache
Description
Caches rendered content in the caching framework.
debug
Property
debug
Data type
boolean / stdWrap
Description

Prints content with HTMLSpecialChars() and <pre></pre>: Useful for debugging which value stdWrap actually ends up with, if you are constructing a website with TypoScript.

Should be used under construction only.

debugFunc
Property
debugFunc
Data type
boolean / stdWrap
Description

Prints the content directly to browser with the debug() function.

Should be used under construction only.

Set to value "2" the content will be printed in a table - looks nicer.

debugData
Property
debugData
Data type
boolean / stdWrap
Description

Prints the current data-array, $cObj->data, directly to browser. This is where field gets data from.

Should be used under construction only.

strPad

This property returns the input value padded to a certain length. The padding is added on the left side, the right side or on both sides. strPad uses the PHP function str_pad() for the operation.

length
Property
length
Data type
integer / stdWrap
Description
The length of the output string. If the value is negative, less than, or equal to the length of the input value, no padding takes place.
Default
0
padWith
Property
padWith
Data type
string / stdWrap
Description
The character(s) to pad with. The value of padWith may be truncated, if the required number of padding characters cannot be evenly divided by the length of the value of padWith. Note that leading and trailing spaces of padWith are stripped! If you want to pad with spaces, omit this option.
Default
(space character)
type
Property
type
Data type
(list of keywords) / stdWrap
Description
The side(s) of the input value, on which the padding should be added. Possible keywords are "left", "right" or "both".
Default
right
Examples
10 = TEXT
# The input value is 34 signs long.
10.value = TYPO3 - inspiring people to share.
10.value.strPad {
     length = 37
     padWith = =
     type = both
}

This results in "=TYPO3 - inspiring people to share.==".

tags

Used to create custom tags and define how they should be parsed. This is used in conjunction with parseFunc.

The best known is the "link" tag, which is used to create links.

(array of strings)
Property
(array of strings)
Data type
cObject
Description

Every entry in the array of strings corresponds to a tag, that will be parsed. The elements must be in lowercase.

Every entry must be set to a content object.

current is set to the content of the tag, eg <TAG>content</TAG>: here current is set to content. It can be used with stdWrap.current = 1.

Parameters:

Parameters of the tag are set in $cObj->parameters (key is lowercased):

<TAG COLOR="red">content</TAG>

This sets $cObj->parameters['color'] = 'red'.

$cObj->parameters['allParams'] is automatically set to the whole parameter-string of the tag. Here it is color="red"

Special properties for each content object:

[cObject].stripNL: boolean option, which tells parseFunc that newlines before and after the content of the tag should be stripped.

[cObject].breakoutTypoTagContent: boolean option, which tells parseFunc that this block of content is breaking up the nonTypoTag content and that the content after this must be re-wrapped.

Examples

tags.bold = TEXT
tags.bold {
      stdWrap.current = 1
      stdWrap.wrap = <p style="font-weight: bold;"> | </p>
}
tags.bold.stdWrap.stripNL = 1

This example would e.g. transform <BOLD>Important!</BOLD> to <p style="font-weight: bold;">Important!</p>.

Example

This example creates 4 custom tags. The <LINK>-, <TYPOLIST>-, <GRAFIX>- and <PIC>-tags:

<LINK> is made into a typolink and provides an easy way of creating links in text.

<TYPOLIST> is used to create bullet-lists.

<GRAFIX> will create an image file with 90x10 pixels where the text is the content of the tag.

<PIC> lets us place an image in the text. The content of the tag should be the image-reference in fileadmin/images/.

tags {
    link = TEXT
    link {
        stdWrap.current = 1
        stdWrap.typolink.extTarget = _blank
        stdWrap.typolink.target = {$cLinkTagTarget}
        stdWrap.typolink.wrap = <p style="color: red;">|</p>
        stdWrap.typolink.parameter.data = parameters : allParams
    }

    typolist < tt_content.bullets.default.20
    typolist.trim = 1
    typolist.field >
    typolist.current = 1

    grafix = IMAGE
    grafix {
        file = GIFBUILDER
        file {
            XY = 90,10
            100 = TEXT
            100.text.current = 1
            100.offset = 5,10
        }
    }
    # Transforms <pic>file.png</pic> to <img src="fileadmin/images/file.png" >
    pic = IMAGE
    pic.file.import = fileadmin/images/
    pic.file.import.current = 1
}

Setup

Top-level objects

Top-level object Data Type stdWrap Default
((abc ...?)) PAGE    
((bcd ...?)) (whatever)    
config config    
constants constants    
Other reserved TLO's: (whatever)    
resources readonly    
sitetitle readonly    
types readonly    
((abc ...?))

Property

...

Data type

PAGE

Description

Start a new page.

Example:

page = PAGE
page.typeNum = 1

Guidelines:

Good, general PAGE object names to use are such as:

page for the main page with content

json for a json stream with content

xml for a XML stream with content

These are just recommendations. However, especially the name page for the content bearing page is very common and most documentation will imply that your main page object is called page.

((bcd ...?))

Property

...

Data type

(whatever)

Description

If a top-level object is not a PAGE object it could be used as a temporary repository for setup. In this case you should use the temp or styles objects.

tt_... is normally used to define the setup of content-records. E.g. tt_content would be used for the tt_content-table as default. See CONTENT.

config

Property

config

Data type

config

Description

Global configuration.

These values are stored with cached pages which means they are also accessible when retrieving a cached page.

constants

Property

constants

Data type

constants

Description

Site-specific constants, e.g. a general email address. These constants may be substituted in the text throughout the pages. The substitution is done by parseFunc (with constants = 1 set).

Other reserved TLO's:

Property

Other reserved TLO's:

plugin

tt_*

temp

styles

lib

_GIFBUILDER

Data type

(whatever)

Description

These top-level object names are reserved. That means you can risk static_templates to use them:

plugin is used for rendering of special content like boards, e-commerce solutions, guestbooks and so on. Normally set from static_templates.

tt_, e.g. tt_content (from "content (default)") is used to render content from tables.

temp and styles are used for code-libraries you can copy during parse-time, but they are not saved with the template in cache. temp and styles are unset before the template is cached! Therefore use these names to store temporary data.

lib can be used for a "library" of code, you can reference in TypoScript (unlike styles which is unset).

resources

Property

resources

Data type

readonly

Description

Resources in list (internal)

sitetitle

Property

sitetitle

Data type

readonly

Description

SiteTitle (internal)

types

Property

types

Data type

readonly

Description

Types (internal)

type=99 reserved for plaintext display

plugin

This is used for extensions in TYPO3 set up as frontend plugins. Typically you can set configuration properties of the plugin here. Say you have an extension with the key "myext" and it has a frontend plugin named "tx_myext_pi1" then you would find the TypoScript configuration at the position plugin.tx_myext_pi1 in the object tree!

Most plugins are USER and USER_INT objects which means that they have at least 1 or 2 reserved properties. Furthermore this table outlines some other default properties. Generally system properties are prefixed with an underscore:

Properties
userFunc

Property

userFunc

Data type

(array of keys)

Description

Property setting up the USER and USER_INT object of the plugin.

_CSS_DEFAULT_STYLE

Property

_CSS_DEFAULT_STYLE

Data type

string / stdWrap

Description

Use this to have some default CSS styles inserted in the header section of the document. _CSS_DEFAULT_STYLE outputs a set of default styles, just because an extension is installed. Most likely this will provide an acceptable default display from the plugin, but should ideally be cleared and moved to an external stylesheet.

This value is for all plugins read by the PageGenerator script when making the header of the document.

This is e.g. used by css_styled_content and indexed_search. Their default styles can be removed with:

plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE >
plugin.tx_indexedsearch._CSS_DEFAULT_STYLE >

However, you will then have to define according styles yourself.

_CSS_PAGE_STYLE

Property

_CSS_PAGE_STYLE

Data type

string

Description

Use this to have some page-specific CSS styles inserted in the header section of the document. _CSS_PAGE_STYLE can be used to render certain styles not just because an extension is installed, but only in a special situation, e.g. some styles will be output, when css_styled_content is installed and a textpic element with an image positioned alongside the text is present on the current page. Most likely this will provide an acceptable display from the plugin especially for this page, but should ideally be cleared and moved to an external stylesheet.

This value is for all plugins read by the PageGenerator script when making the header of the document.

_DEFAULT_PI_VARS.[piVar-key]

Property

_DEFAULT_PI_VARS.[piVar-key]

Data type

string / stdWrap

Description

Allows you to set default values of the piVars array which most plugins are using (and should use) for data exchange with themselves.

This works only if the plugin calls $this->pi_setPiVarDefaults().

The values have stdWrap, which also works recursively for multilevel keys.

Example

plugin.tt_news._DEFAULT_PI_VARS {
    year.stdWrap.data = date:Y
}

This sets the key "year" to the current year.

_LOCAL_LANG.[lang-key].[label-key]

Property

_LOCAL_LANG.[lang-key].[label-key]

Data type

string

Description

Can be used to override the default locallang labels for the plugin.

Example

plugin.tx_myext_pi1._LOCAL_LANG.de.list_mode_1 = Der erste Modus

All variables, which are used inside an extension with $this->pi_getLL('list_mode_1', 'Text, if no entry in locallang.xlf', true); can that way be overwritten with TypoScript. The locallang.xlf file in the plugin folder in the file system can be used to get an overview of the entries the extension uses.

config

In typo3/sysext/frontend/Classes/ this is known as $GLOBALS['TSFE']->config['config'], thus the property debug below is accessible as $GLOBALS['TSFE']->config['config']['debug'].

Properties
Property Data Type Default
absRefPrefix string  
additionalHeaders array with numeric indices  
admPanel boolean  
ATagParams <A>-params  
baseURL string  
cache array  
cache_clearAtMidnight boolean false
cache_period integer 86400 (= 24 hours)
compressCss boolean  
compressJs boolean  
concatenateCss boolean  
concatenateJs boolean  
concatenateJsAndCss boolean 0
content_from_pid_allowOutsideDomain boolean  
contentObjectExceptionHandler array  
debug boolean  
defaultGetVars array  
disableAllHeaderCode boolean false
disableBodyTag boolean 0
disableCharsetHeader boolean  
disableImgBorderAttr boolean  
disablePageExternalUrl boolean  
disablePrefixComment boolean  
disablePreviewNotification boolean 0
disableLanguageHeader boolean 0
doctype string  
doctypeSwitch boolean / string  
enableContentLengthHeader boolean 1
extTarget target _top
fileTarget target  
forceTypeValue integer  
formMailCharset string  
ftu boolean false
headerComment string  
htmlTag_dir string  
htmlTag_langKey string en
htmlTag_setParams string  
htmlTag_stdWrap stdWrap  
index_descrLgd integer 200
index_enable boolean  
index_externals boolean  
index_metatags boolean true
inlineStyle2TempFile boolean  
intTarget target  
language string  
language_alt string  
linkVars list  
locale_all string  
message_page_is_being_generated string  
message_preview string  
message_preview_workspace string  
metaCharset string utf-8
moveJsFromHeaderToFooter boolean  
MP_defaults string  
MP_disableTypolinkClosestMPvalue boolean  
MP_mapRootPoints list of PIDs / string  
namespaces (array of strings)  
no_cache boolean 0
noPageTitle integer 0
pageRendererTemplateFile string  
pageTitle stdWrap  
pageTitleFirst boolean 0
pageTitleSeparator string / stdWrap ": " (colon with following space)
removeDefaultCss boolean  
removeDefaultJS boolean / string  
removePageCss boolean  
sendCacheHeaders boolean  
sendCacheHeaders_onlyWhenLoginDeniedInBranch boolean  
spamProtectEmailAddresses "ascii" /  
spamProtectEmailAddresses_atSubst string (at)
spamProtectEmailAddresses_lastDotSubst string . (just a simple dot)
sword_noMixedCase boolean  
sword_standAlone boolean  
sys_language_isocode string  
sys_language_isocode_default string  
sys_language_mode string  
sys_language_overlay boolean / keyword  
sys_language_uid integer  
titleTagFunction function name  
tx_[extension key with no underscores]_[*] array  
typolinkCheckRootline boolean  
typolinkEnableLinksAcrossDomains boolean 0
typolinkLinkAccessRestrictedPages integer (page id) / keyword "NONE"  
typolinkLinkAccessRestrictedPages_addParams string  
USERNAME_substToken string <!--###USERNAME###-->
USERUID_substToken string  
xhtmlDoctype string  
xmlprologue string  
absRefPrefix

Property

absRefPrefix

Data type

string

Description

If this value is set, then all relative links in TypoScript are prepended with this string.

Special keyword: "auto" lets TYPO3 autodetect the site root based on path prefixes (and not based on host name variables from the server, making this value safe for multi-domain environments).

Note: Using an URI in absRefPrefix will require additional conditions if you use different domains for your deployment stages in CI environments.

Note: If you're working on a server where you have different domain names or different path segments leading to the same page (e.g. for internal and external access), you might do yourself a favor and set absRefPrefix to the URL and path of your site, e.g. https://typo3.org/. If you do not, you risk to render pages to cache from the internal network and thereby prefix image-references and links with a wrong path or a path not accessible from outside.

Examples

  1. Prefixing all links with a "/" results in absolute link paths:

    config.absRefPrefix = /
    
  2. Prefixing all links with the path to a subdirectory:

    config.absRefPrefix = /some-subsite/
    
  3. Prefixing all links with a URI scheme:

    config.absRefPrefix = http://example.com/
    
additionalHeaders

Property

additionalHeaders

Data type

array with numeric indices

Description

This property can be used to define additional HTTP headers.

For each numeric index, there are the following sub-properties:

header: The header string (has stdWrap properties)

replace: Optional. If set, previous headers with the same name are replaced with the current one. Default is "1". (has stdWrap properties)

httpResponseCode: Optional. HTTP status code as an integer. (has stdWrap properties)

By default TYPO3 sends a "Content-Type" header with the defined encoding, unless this is disabled using disableCharsetHeader. It then sends cache headers, if configured via sendCacheHeaders. Then additional headers are send, plus finally a "Content-Length" header, if enabled via enableContentLengthHeader.

Example

config.additionalHeaders {
    10 {
        # The header string
        header = foo:
        header.dataWrap = |{page:uid}

        # Do not replace previous headers with the same name.
        replace = 0

        # Force a 401 HTTP response code
        httpResponseCode = 401
    }
    # Always set cache headers to private, overwriting the default TYPO3 Cache-control header
    20.header = Cache-control: Private
}
admPanel

Property

admPanel

Data type

boolean

Description

If set, the admin panel appears in the bottom of pages.

Note: In addition the panel must be enabled for the user as well, using the TSconfig for the user! See the TSconfig reference about additional admin panel properties.

ATagParams

Property

ATagParams

Data type

<A>-params

Description

Additional parameters to all links in TYPO3 (excluding menu-links).

baseURL

Property

baseURL

Data type

string

Description

This writes the <base> tag in the header of the document. Set this to the value that is expected to be the URL and append a "/" to the end of the string.

Example

config.baseURL = http://typo3.org/sub_dir/
cache

Property

cache

Data type

array

Description

Determine the maximum cache lifetime of a page.

The maximum cache lifetime of a page can not only be determined by the start and stop times of content elements on the page itself, but also by arbitrary records on any other page. However, the page has to be configured so that TYPO3 knows the start and stop times of which records to include. Otherwise, the cache entry will be used although a start/stop date already passed by.

To include records of type <table name> on page <pid> into the cache lifetime calculation of page <page-id>, add the following TypoScript:

config.cache.<page-id> = <table name>:<pid>

Multiple record sources can be added as comma-separated list, see the examples.

You can use the keyword "all" instead of a <page-id> to consider records for the cache lifetime of all pages.

Examples

config.cache.10 = fe_users:2

This includes the fe_users records on page 2 in the cache lifetime calculation for page 10:

config.cache.10 = fe_users:2,tt_news:11

This includes records from multiple sources, namely the fe_users records on page 2 and the tt_news records on page 11:

config.cache.all = fe_users:2

Consider the fe_user records on page 2 for the cache lifetime of all pages.

cache_clearAtMidnight

Property

cache_clearAtMidnight

Data type

boolean

Default

false

Description

With this setting the cache always expires at midnight of the day, the page is scheduled to expire.

cache_period

Property

cache_period

Data type

integer

Default

86400 (= 24 hours)

Description

The number of second a page may remain in cache.

This value is overridden by the value set in the page-record (field="cache_timeout") if this value is greater than zero.

compressCss

Property

compressCss

Data type

boolean

Default

0

Description

If set, CSS files referenced in page.includeCSS and the like will be minified and compressed. Does not work on files, which are referenced in page.headerData.

Minification will remove all excess space. The more significant compression step (using gzip compression) requires $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] to be enabled in the Install Tool. For this to work you also need to activate the gzip- related compressionLevel options in .htaccess, as otherwise the compressed files will not be readable by the user agent.

TYPO3 comes with a built-in compression handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'].

$GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'] =
   \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/CssCompressHandler.php:Vendor\MyExt\CssCompressHandler->compressCss';

Example

config.compressCss = 1
compressJs

Property

compressJs

Data type

boolean

Default

0

Description

Enabling this option together with $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] in the Install Tool delivers Frontend JavaScript files referenced in page.includeJS and the like using GZIP compression. Does not work on files, which are referenced in page.headerData.

This can significantly reduce file sizes of linked JavaScript files and thus decrease loading times.

Please note that this requires .htaccess to be adjusted, as otherwise the files will not be readable by the user agent. Please see the description of $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] in the Install Tool.

TYPO3 comes with a built-in compression handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'].

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'] =
   \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/JsCompressHandler.php:Vendor\MyExt\JsCompressHandler->compressJs';

Example

config.compressJs = 1
concatenateCss

Property

concatenateCss

Data type

boolean

Default

0

Description

Setting config.concatenateCss merges Stylesheet files referenced in the Frontend in page.includeCSS and the like together. Files are merged only, if their media attribute has the same value, e.g. if it is "all" for several files. Does not work on files, which are referenced in page.headerData.

TYPO3 comes with a built-in concatenation handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['cssConcatenateHandler'].

$GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'] =
   \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/CssCompressHandler.php:Vendor\MyExt\CssCompressHandler->compressCss';

Example

config.concatenateCss = 1
concatenateJs

Property

concatenateJs

Data type

boolean

Default

0

Description

Setting config.concatenateJs merges JavaScript files referenced in the Frontend in page.includeJS and the like together. Does not work on files, which are referenced in page.headerData.

If all files to be concatenated are marked with the async flag, the async attribute is assigned to the script tag.

TYPO3 comes with a built-in concatenation handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['jsConcatenateHandler'].

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsConcatenateHandler'] =
   \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/JsConcatenateHandler.php:Vendor\MyExt\JsConcatenateHandler->concatenateJs';

Example

config.concatenateJs = 1

page = PAGE
page.includeJSFooter {
    test = fileadmin/user_upload/test.js
    test.async = 1

    test2 = fileadmin/user_upload/test2.js
    test2.async = 1
}
concatenateJsAndCss

Property

concatenateJsAndCss

Data type

boolean

Default

0

Description

Note: This property was deprecated and is planned to be removed! Use config.concatenateJs and config.concatenateCss instead.

Setting config.concatenateJsAndCss bundles JS and CSS files in the FE.

TYPO3 comes with a built-in concatenation handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['concatenateHandler'].

$GLOBALS['TYPO3_CONF_VARS']['FE']['concatenateHandler'] =
   \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/ConcatenateHandler.php:Vendor\MyExt\ConcatenateHandler->concatenateFiles';

Example

config.concatenateJsAndCss = 1
content_from_pid_allowOutsideDomain

Property

content_from_pid_allowOutsideDomain

Data type

boolean

Description

Using the "Show content from this page instead" feature allows you to insert content from the current domain only. Setting this option will allow content included from anywhere in the page tree!

Another use case is mount points: By means of the page type "Mount Point" you can virtually insert a whole subtree from somewhere else by just pointing to it. However, usually this only works within the page tree of the given domain. Setting config.content_from_pid_allowOutsideDomain = 1 removes that restriction.

contentObjectExceptionHandler

Property

contentObjectExceptionHandler

Data type

array

Description

Exceptions which occur during rendering of content objects (typically plugins) will now be caught by default in production context and an error message is shown along with the rendered output.

If this is done, the page will remain available while the section of the page that produces an error (i.e. throws an exception) will show a configurable error message. By default this error message contains a random code which references the exception and is also logged by the logging framework for developer reference.

Important

Instead of breaking the whole page when an exception occurs, an error message is shown for the part of the page that is broken. Be aware that unlike before, it is now possible that a page with error message gets cached.

To get rid of the error message not only the actual error needs to be fixed, but the cache must be cleared for this page.

Examples

# Use 1 for the default exception handler (enabled by default in production context)
config.contentObjectExceptionHandler = 1

# Use a class name for individual exception handlers
config.contentObjectExceptionHandler = TYPO3\CMS\Frontend\ContentObject\Exception\ProductionExceptionHandler

# Customize the error message. A randomly generated code is replaced within the message if needed.
config.contentObjectExceptionHandler.errorMessage = Oops an error occurred. Code: %s

# Configure exception codes which will not be handled, but bubble up again (useful for temporary fatal errors)
tt_content.login.20.exceptionHandler.ignoreCodes.10 = 1414512813

# Disable the exception handling for an individual plugin/ content object
tt_content.login.20.exceptionHandler = 0

# ignoreCodes and errorMessage can be both configured globally …
config.contentObjectExceptionHandler.errorMessage = Oops an error occurred. Code: %s
config.contentObjectExceptionHandler.ignoreCodes.10 = 1414512813

# … or locally for individual content objects
tt_content.login.20.exceptionHandler.errorMessage = Oops an error occurred. Code: %s
tt_content.login.20.exceptionHandler.ignoreCodes.10 = 1414512813
debug

Property

debug

Data type

boolean

Description

If set then debug information in the TypoScript code is sent. This applies e.g. to menu objects and the parsetime output. The parsetime will be sent as HTTP response header X-TYPO3-Parsetime.

defaultGetVars

Property

defaultGetVars

Data type

array

Description

Allows to set default values for GET parameters. Default value is taken only if the GET parameter isn't defined. Array notation is done with dots, e.g.:

test['var1'] will be written as test.var1

Example

config.defaultGetVars {
    test.var1.var2.p3 = 15
}
disableAllHeaderCode

Property

disableAllHeaderCode

Data type

boolean

Default

false

Description

If this is set, none of the features of the PAGE object is processed and the content of the page will be the result of the cObject array (1,2,3,4...) of the PAGE object. This means that the result of the cObject should include everything from the <HTML> .... to the </HTML> tag!

Use this feature in templates supplying other content-types than HTML. That could be an image or a WAP-page!

disableBodyTag

Property

disableBodyTag

Data type

boolean

Default

0 (false)

Description

If this option is set the TYPO3 core will not generate the opening <body ...> part of the body tag. The closing </body> is not affected and will still be issued.

disableBodyTag takes precedence over the PAGE properties bodyTagCObject, bodyTag and bodyTagAdd. With config.disableBodyTag = 1 the others are ignored and don't have any effect.

disableCharsetHeader

Property

disableCharsetHeader

Data type

boolean

Description

By default a HTTP header content-type:text/html; charset... is sent. This option will disable that.

disableImgBorderAttr

Property

disableImgBorderAttr

Data type

boolean

Description

Returns the border attribute for an <img> tag only if the doctype is not xhtml_strict or xhtml_11 or if the config parameter disableImgBorderAttr is not set

disablePageExternalUrl

Property

disablePageExternalUrl

Data type

boolean

Description

If set, pages with doktype "External Url" will not trigger jumpUrl in TSFE.

disablePrefixComment

Property

disablePrefixComment

Data type

boolean

Description

If set, the stdWrap property prefixComment will be disabled, thus preventing any revealing and space-consuming comments in the HTML source code.

disablePreviewNotification

Property

disablePreviewNotification

Data type

boolean

Default

0

Description

Disables the "preview" notification box completely.

disableLanguageHeader

Property

disableLanguageHeader

Data type

boolean

Default

0

Description

TYPO3 by default sends a Content-language: XX HTTP header, where "XX" is the ISO code of the according language.

For the default language (sys_language_uid = 0), this header is based on the value of config.sys_language_isocode_default. If this is unset, config.language is used. If that is unset as well, it finally falls back to "en".

For other languages, it uses the value from language_isocode from sys_language. That value may be overwritten by config.sys_language_isocode.

If config.disableLanguageHeader is set, this header will not be sent.

doctype

Property

doctype

Data type

string

Description

If set, then a document type declaration (and an XML prologue) will be generated. The value can either be a complete doctype or one of the following keywords:

xhtml_trans for the XHTML 1.0 Transitional doctype.

xhtml_strict for the XHTML 1.0 Strict doctype.

xhtml_basic for the XHTML basic doctype.

xhtml_11 for the XHTML 1.1 doctype.

xhtml+rdfa_10 for the XHTML+RDFa 1.0 doctype.

html5 for the HTML5 doctype.

none for no doctype at all.

Note

Keywords also change the way TYPO3 generates some of the XHTML tags to ensure valid XML. If you set doctype to a string, then you must also set config.xhtmlDoctype (see below).

See config.htmlTag_setParams and config.htmlTag_langKey for more details on the effect on the HTML tag.

Default is the HTML 5 doctype:

<!DOCTYPE html>
doctypeSwitch

Property

doctypeSwitch

Data type

boolean / string

Description

If set, the order of <?xml...> and <!DOCTYPE...> will be reversed. This is needed for MSIE to be standards compliant with XHTML.

Background:

By default TYPO3 outputs the XML/DOCTYPE in compliance with the standards of XHTML. However a browser like MSIE will still run in "quirks-mode" unless the <?xml> and <DOCTYPE> tags are ordered opposite. But this breaks CSS validation...

With this option designers can decide for themselves what they want then.

If you want to check the compatibility-mode of your webbrowser you can do so with a simple JavaScript that can be inserted on a TYPO3 page like this:

page.headerData.1 = TEXT
page.headerData.1.value = <script>alert(document.compatMode);</script>

If your browser has detected the DOCTYPE correctly it will report "CSS1Compat"

If you are not running in compliance mode you will get some other message. MSIE will report "BackCompat" for instance - this means it runs in quirks-mode, supporting all the old "browser-bugs".

enableContentLengthHeader

Property

enableContentLengthHeader

Data type

boolean

Default

1

Description

If set, a header "content-length: [bytes of content]" is sent.

If the Backend user is logged in, this is disabled. The reason is that the content length header cannot include the length of these objects and the content-length will cut off the length of the document in some browsers.

extTarget

Property

extTarget

Data type

target

Default

_top

Description

Default external target. Used by typolink if no extTarget is set

fileTarget

Property

fileTarget

Data type

target

Description

Default file link target. Used by typolink if no fileTarget is set.

forceTypeValue

Property

forceTypeValue

Data type

integer

Description

Force the &type value of all TYPO3 generated links to a specific value (except if overruled by local forceTypeValue values).

Useful if you run a template with special content at - say &type=95 - but still wants to keep your targets neutral. Then you set your targets to blank and this value to the type value you wish.

formMailCharset

Property

formMailCharset

Data type

string

Default

"" (unset)

Description

Character set of mails sent through TYPO3 mail forms. If it is unset, the character set defined in metaCharset is used.

ftu

Property

ftu

Data type

boolean

Default

false

Description

If set, the "&ftu=...." GET-fallback identification is inserted.

"&ftu=[hash]" is always inserted in the links on the first page a user hits. If it turns out in the next hit that the user has cookies enabled, this variable is not set anymore as the cookies does the job. If no cookies is accepted the "ftu" remains set for all links on the site and thereby we can still track the user.

You should not set this feature if grabber-spiders like Teleport are going to grab your site!

You should not set this feature if you want search-engines to index your site.

You can also ignore this feature if you're certain, website users will use cookies.

"ftu" means fe_typo_user ("fe" is "frontend").

headerComment

Property

headerComment

Data type

string

Description

The content is added before the "TYPO3 Content Management Framework" comment in the <head> section of the page. Use this to insert a note like that "Programmed by My-Agency".

htmlTag_dir

Property

htmlTag_dir

Data type

string

Description

Sets text direction for whole document (useful for display of Arabic, Hebrew pages).

Basically the value becomes the attribute value of "dir" for the <html> tag.

Values:

rtl = Right-To-Left (for Arabic / Hebrew)

ltr = Left-To-Right (Default for other languages)

Example

config.htmlTag_dir = rtl
htmlTag_langKey

Property

htmlTag_langKey

Data type

string

Default

en

Description

Allows you to set the language value for the attributes xml:lang and lang in the <html> tag (when using config.doctype = xhtml*).

The values must follow the format specified in IETF RFC 3066

Example

config.htmlTag_langKey = en-US
htmlTag_setParams

Property

htmlTag_setParams

Data type

string

Description

Sets the attributes for the <html> tag on the page. If you set doctype to a keyword enabling XHTML then some attributes are already set. This property allows you to override any preset attributes with your own content if needed.

Special: If you set it to "none" then no attributes will be set at any event.

Example

config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
htmlTag_stdWrap

Property

htmlTag_stdWrap

Data type

stdWrap

Description

Modify the whole <html> tag with stdWrap functionality. This can be used to extend or override this tag.

index_descrLgd

Property

index_descrLgd

Data type

integer

Default

200

Description

This indicates how many chars to preserve as description for an indexed page. This may be used in the search result display.

index_enable

Property

index_enable

Data type

boolean

Description

Enables cached pages to be indexed.

Automatically enabled when EXT:indexed_search is enabled.

index_externals

Property

index_externals

Data type

boolean

Description

If set, external media linked to on the pages is indexed as well.

Automatically enabled when EXT:indexed_search is enabled.

index_metatags

Property

index_metatags

Data type

boolean

Default

true

Description

This allows to turn on or off the indexing of metatags. It is turned on by default.

inlineStyle2TempFile

Property

inlineStyle2TempFile

Data type

boolean

Default

1

Description

If set, the inline styles TYPO3 controls in the core are written to a file, typo3temp/assets/css/stylesheet_[hashstring].css, and the header will only contain the link to the stylesheet.

The file hash is based solely on the content of the styles.

Example

config.inlineStyle2TempFile = 0
intTarget

Property

intTarget

Data type

target

Description

Default internal target. Used by typolink if no target is set

language

Property

language

Data type

string

Description

Language key. See lang for more information.

Select between:

English (default) = [empty]

Danish = dk

German = de

Norwegian = no

Italian = it

etc...

The value must correspond to the key used for the backend system language if there is one. See inside typo3/sysext/core/Classes/Localization/Locales.php or look at the translation page on typo3.org for the official 2-byte key for a given language. Notice that selecting the official key is important if you want to get labels in the correct language from "locallang" files.

If the language you need is not yet a system language in TYPO3 you can use an artificial string of your choice and provide values for it via the TypoScript template where the property _LOCAL_LANG for most plugins will provide a way to override/add values for labels. The keys to use must be looked up in the locallang-file used by the plugin of course.

language_alt

Property

language_alt

Data type

string

Description

If language is used, this can be set to another language key which will be used for labels if a label was not found for the main language. For instance a brazil portuguese website might specify "pt" as alternative language which means the portuguese label will be shown if none was available in the main language, brazil portuguese. This feature makes sense if one language is incompletely translated and close to another language.

linkVars

Property

linkVars

Data type

list

Description

HTTP_GET_VARS, which should be passed on with links in TYPO3. This is compiled into a string stored in $GLOBALS['TSFE']->linkVars

The values are rawurlencoded in PHP.

You can specify a range of valid values by appending a () after each value. If this range does not match, the variable won't be appended to links. This is very important to prevent that the cache system gets flooded with forged values.

The range may contain one of these values:

  • [a]-[b] -A range of allowed integer values
  • int -Only integer values are allowed
  • [a]|[b]|[c] -A list of allowed strings (whitespaces will be removed)
  • /[regex]/ -Match against a regular expression (PCRE style)

You can use the pipe character (|) to access nested properties.

Note

Do not include the type parameter in the linkVars list, as this can result in unexpected behavior.

Examples

config.linkVars = print

This will add &print=[print-value] to all links in TYPO3.

config.linkVars = tracking|green(0-5)

With the above configuration the following example GET parameters will be kept: &tracking[green]=3. But a get parameter like tracking[blue] will not be kept.

locale_all

Property

locale_all

Data type

string

Description

setlocale("LC_ALL", [value]);

value-examples: deutsch, de_DE, danish, portuguese, spanish, french, norwegian, italian. See www.php.net for other value. Also on linux, look at /usr/share/locale/

$GLOBALS['TSFE']->localeCharset is intelligently set to the assumed charset of the locale strings. This is used in strftime to convert locale strings to the UTF-8 of the frontend.

It is possible to supply a comma-separated list of locales as a fallback chain

Example

This will render dates in danish made with stdWrap/strftime:

locale_all = danish
locale_all = da_DK
message_page_is_being_generated

Property

message_page_is_being_generated

Data type

string

Description

Alternative HTML message that appears if a page is being generated.

Normally when a page is being generated a temporary copy is stored in the cache-table with an expire-time of 30 seconds.

It is possible to use some keywords that are replaced with the corresponding values. Possible keywords are: ###TITLE###, ###REQUEST_URI###

message_preview

Property

message_preview

Data type

string

Description

Alternative message in HTML that appears when the preview function is active!

message_preview_workspace

Property

message_preview_workspace

Data type

string

Description

Alternative message in HTML that appears when the preview function is active in a draft workspace. You can use sprintf() placeholders for Workspace title (first) and number (second).

Examples

config.message_preview_workspace = <div class="previewbox">Displaying workspace named "%s" (number %s)!</div>
config.message_preview_workspace = <div class="previewbox">Displaying workspace number %2$s named "%1$s"!</div>
metaCharset

Property

metaCharset

Data type

string

Default

utf-8

Description

Charset used for the output document. For example in the meta tag:

<meta charset=... />

It is used for a) HTML meta tag, b) HTTP header (unless disabled with disableCharsetHeader) and c) xhtml prologues (if available).

If metaCharset is not UTF-8, the output content is automatically converted to metaCharset before output and likewise are values posted back to the page converted from metaCharset to UTF-8 for internal processing. This conversion takes time of course so there is another good reason to use the same charset for both.

If an unknown charset is provided a \RuntimeException will be thrown.

moveJsFromHeaderToFooter

Property

moveJsFromHeaderToFooter

Data type

boolean

Description

If set, all JavaScript (includes and inline) will be moved to the bottom of the HTML document, which is after the content and before the closing body tag.

MP_defaults

Property

MP_defaults

Data type

string

Description

Allows you to set a list of page id numbers which will always have a certain "&MP=..." parameter added.

Syntax:

[id],[id],... : [MP-var] | [id],[id],... : [MP-var] | ...

Example

config.MP_defaults = 36,37,48 : 2-207

This will by default add &MP=2-207 to all links pointing to pages 36,37 and 48.

MP_disableTypolinkClosestMPvalue

Property

MP_disableTypolinkClosestMPvalue

Data type

boolean

Description

If set, the typolink function will not try to find the closest MP value for the id.

MP_mapRootPoints

Property

MP_mapRootPoints

Data type

list of PIDs / string

Description

Defines a list of ID numbers from which the MP-vars are automatically calculated for the branch.

The result is used just like MP_defaults are used to find MP-vars if none has been specified prior to the call to TYPO3\CMS\Core\TypoScript\TemplateService::linkData().

You can specify root as a special keyword in the list of IDs and that will create a map-tree for the whole site (but this may be VERY processing intensive if there are many pages!).

The order of IDs specified may have a significance; Any ID in a branch which is processed already (by a previous ID root point) will not be processed again.

The configured IDs have to be the uids of Mount Point pages itself, not the targets.

Tip

To mount content from parts of the page tree that don't belong to the current domain set content_from_pid_allowOutsideDomain to true.

namespaces

Property

namespaces

Data type

(array of strings)

Description

This property enables you to add xml namespaces (xmlns) to the <html> tag. This is especially useful if you want to add RDFa or microformats to your HTML.

Example

config.namespaces.dc = http://purl.org/dc/elements/1.1/
config.namespaces.foaf = http://xmlns.com/foaf/0.1/

This configuration will result in an <html> tag like:

<html xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:foaf="http://xmlns.com/foaf/0.1/">
no_cache

Property

no_cache

Data type

boolean

Default

-

Description

If this is set to true, the page will not be cached. If set to false, it's ignored. Other parameters may have set it to true of other reasons.

noPageTitle

Property

noPageTitle

Data type

integer

Default

0

Description

If you only want to have the site name (from the template record) in your <title> tag, set this to 1. If the value is 2 then the <title> tag is not printed at all.

Please take note that this tag is required for (X)HTML compliant output, so you should only disable this tag if you generate it manually already.

pageRendererTemplateFile

Property

pageRendererTemplateFile

Data type

string

Default

EXT:core/Resources/Private/Templates/PageRenderer.html

Description

Sets the template for page renderer class TYPO3\CMS\Core\Page\PageRenderer.

Example

pageRendererTemplateFile = fileadmin/test_pagerender.html
pageTitle

Property

pageTitle

Data type

stdWrap

Description

stdWrap for the page title. This option will be executed after all other processing options like titleTagFunction and pageTitleFirst.

pageTitleFirst

Property

pageTitleFirst

Data type

boolean

Default

0

Description

TYPO3 by default prints a title tag in the format "website: page title".

If pageTitleFirst is set (and if the page title is printed), then the page title will be printed IN FRONT OF the template title. So it will look like "page title: website".

pageTitleSeparator

Property

pageTitleSeparator

Data type

string / stdWrap

Default

: (colon with following space)

Description

The signs which should be printed in the title tag between the website name and the page title. If pageTitleSeparator is set, but no sub-properties are defined, then a space will be added to the end of the separator. stdWrap is useful to adjust whitespaces at the beginning and the end of the separator.

Examples

config.pageTitleSeparator = .

This produces a title tag with the content "website. page title":

config.pageTitleSeparator = -
config.pageTitleSeparator.noTrimWrap = | | |

This produces a title tag with the content "website - page title":

config.pageTitleSeparator = *
config.pageTitleSeparator.noTrimWrap = |||

This produces a title tag with the content "website*page title".

removeDefaultCss

Property

removeDefaultCss

Data type

boolean

Description

Remove CSS generated by _CSS_DEFAULT_STYLE configuration of extensions. (_CSS_DEFAULT_STYLE outputs a set of default styles, just because an extension is installed.)

removeDefaultJS

Property

removeDefaultJS

Data type

boolean / string

Default

external

Description

If set, the default JavaScript in the header will be removed.

The default JavaScript is the decryption function for email addresses.

Special case: If the value is "external", then the default JavaScript is written to a temporary file and included from that file. See inlineStyle2TempFile.

Examples

config.removeDefaultJS = external
config.removeDefaultJS = 1
removePageCss

Property

removePageCss

Data type

boolean

Description

Remove CSS generated by _CSS_PAGE_STYLE configuration of extensions. (_CSS_PAGE_STYLE renders certain styles not just because an extension is installed, but only in a special situation. E.g. some styles will be output, when a textpic element with an image positioned alongside the text is present on the current page.)

sendCacheHeaders

Property

sendCacheHeaders

Data type

boolean

Description

If set, TYPO3 will output cache-control headers to the client based mainly on whether the page was cached internally. This feature allows client browsers and/or reverse proxies to take load off TYPO3 websites.

The conditions for allowing client caching are:

  • page was cached
  • No *_INT or *_EXT objects were on the page (e.g. USER and USER_INT)
  • No frontend user is logged in
  • No backend user is logged in

If these conditions are met, the headers sent are:

  • Last-Modified [SYS_LASTCHANGED of page id]
  • Expires [expire time of page cache]
  • ETag [md5 of content]
  • Cache-Control: max-age: [seconds til expiretime]
  • Pragma: public

In case caching is not allowed, these headers are sent to avoid client caching:

  • Cache-Control: private, no-store

Notice that enabling the browser caches means you have to consider how log files are written. Because when a page is cached on the client it will not invoke a request to the webserver, thus not writing the request to the log. There should be ways to circumvent these problems but they are outside the domain of TYPO3 in any case.

Tip: Enabling cache-control headers might confuse editors seeing old content served from the browser cache. "Shift-Reload" will bypass both browser- and reverse-proxy caches and even make TYPO3 regenerate the page. Teach them that trick!

Thanks to Ole Tange, www.forbrug.dk for co-authoring this feature.

sendCacheHeaders_onlyWhenLoginDeniedInBranch

Property

sendCacheHeaders_onlyWhenLoginDeniedInBranch

Data type

boolean

Description

If this is set, then cache-control headers allowing client caching is sent only if user-logins are disabled for the branch. This feature makes it easier to manage client caching on sites where you have a mixture of static pages and dynamic sections with user logins.

The background problem is this: In TYPO3 the same URL can show different content depending on whether a user is logged in or not. If a user is logged in, cache-headers will never allow client caching. But if the same URL was visited without a login prior to the login (allowing caching) the user will still see the page from cache when logged in (and so thinks he is not logged in anyway)! The only general way to prevent this is to have a different URL for pages when users are logged in.

Another way to solve the problem is using this option in combination with disabling and enabling logins in various sections of the site. In the page records ("Advanced" page types) you can disable frontend user logins for branches of the page tree. Since many sites only need the login in a certain branch of the page tree, disabling it in all other branches makes it much easier to use cache-headers in combination with logins; Cache-headers should simply be sent when logins are not allowed and never be send when logins are allowed! Then there will never be problems with logins and same-URLs.

spamProtectEmailAddresses

Property

spamProtectEmailAddresses

Data type

"ascii" / -10 to 10

Description

If set, then all email addresses in typolinks will be encrypted so spam bots cannot detect them.

If you set this value to a number, then the encryption is simply an offset of character values. If you set this value to "-2" then all characters will have their ASCII value offset by "-2". To make this possible, a little JavaScript code is added to every generated web page!

(It is recommended to set the value in the range from -5 to 1 since setting it to >= 2 means a "z" is converted to "|" which is a special character in TYPO3 tables syntax – and that might confuse columns in tables. Now hardcoded range)

Alternatively you can set this value to the keyword "ascii". This way every character of the "mailto:" address will be translated to a Unicode HTML notation. Have a look at the example to see how this works.

Example

mailto:a@b.c will be converted to mailto:&#97;&#64;&#98;&#46;&#99;

The big advantage of this method is that it does not need any JavaScript!

spamProtectEmailAddresses_atSubst

Property

spamProtectEmailAddresses_atSubst

Data type

string

Default

(at)

Description

Substitute label for the at-sign (@).

spamProtectEmailAddresses_lastDotSubst

Property

spamProtectEmailAddresses_lastDotSubst

Data type

string

Default

. (just a simple dot)

Description

Substitute label for the last dot in the email address.

Example

(dot)

sword_noMixedCase

Property

sword_noMixedCase

Data type

boolean

Description

Used by the parseFunc-substitution of search Words (sword):

If set, the words MUST be the exact same case as the search word was.

sword_standAlone

Property

sword_standAlone

Data type

boolean

Description

Used by the parseFunc-substitution of search Words (sword):

If set, the words MUST be surrounded by whitespace in order to be marked up.

sys_language_isocode

Property

sys_language_isocode

Data type

string

Description

ISO 639-1 language code for the according language. By default this is being set by TSFE:sys_language_isocode. The value is derived from the ISO code that is stored within the sys_language record. You can override the value, which was retrieved that way, with this setting.

The ISO code is also used for the language attribute of the HTML tag. Therefore the setting htmlTag_langKey is not needed anymore, if it is the same as the ISO code.

See the example at sys_language_isocode_default!

sys_language_isocode_default

Property

sys_language_isocode_default

Data type

string

Default

en

Description

ISO 639-1 language code for the default language (that is sys_language_uid = 0).

Example

# Danish by default
config.sys_language_uid = 0
config.sys_language_isocode_default = da

[siteLanguage = locale = de_CH.UTF-8]
    config.sys_language_isocode = ch
[GLOBAL]
sys_language_mode

Property

sys_language_mode

Data type

string

Description

Configures what the system should do when a page is not translated to the requested language. It is only evaluated when sys_language_uid is greater than 0 and the requested page translation is NOT available. Internally this setting corresponds to LanguageAspect->contentId.

The syntax is "[keyword] ; [value]".

Possible keywords are:

[empty] (not set)
If not set and the page is not translated, the system will behave as if the default language was requested. In that case both LanguageAspect->contentId and LanguageAspect->id will be set to 0.
content_fallback

Recommended. The system will always operate with the selected language even if the page is not translated and has no page overlay record. This will keep menus etc. translated. However, the content on the page can still fall back to another language, defined by the value of this keyword, e.g. content_fallback;1,3,0, to fall back to the content of sys_language_uid 1, after that to the content of sys_language_uid 3 and if that is not present either, to default (0).

Note that the fallback affects all content of the page. This means that once a translated page record is found in the fallback chain, the system will try to use this language for the rendering even if there is no properly translated content.

strict
If the requested translation does not exist the system will report a Page Not Found (404) error. Basically this means that all pages with gray background in the Web > Info / Localization overview module will fail (they would otherwise fall back to default language in one way or another).
ignore
The system will stay with the selected language even if the page is not translated and there is no content available for this language, so you can handle that situation on your own then. The system will render the page and the content as if the translation would exist. Internally LanguageAspect->contentId is set to the value of LanguageAspect->id.

Refer to the Frontend Localization Guide for an in-depth discussion.

sys_language_overlay

Property

sys_language_overlay

Data type

boolean / keyword

Description

Defines whether TYPO3 should use the content overlay technique when fetching translated content. Content overlay means fetching records from the default language first and then replacing specific fields with the translation if that is found.

It is only evaluated when LanguageAspect->contentId > 0. Internally it sets the property LanguageAspect->overlayType at a request. Further calls via $TSFE->sys_page->getRecordOverlay receive this value to see if overlaying should take place.

The requirements for this is that the table is configured with languageField and transOrigPointerField in the ['ctrl'] section of $GLOBALS['TCA']. Also, exclusion of certain fields can be done with the "l10n_mode" directive in the field-configuration of $GLOBALS['TCA'].

For backend administration this requires that you configure the "Web > Page" module to display content elements accordingly; That each default element is shown and next to it any translation found. This configuration can be done with Page TSconfig for a section of the website using the object path mod.web_layout.defLangBinding = 1.

Possible values:

0

Just fetch records from the selected language as given by LanguageAspect->contentId. No overlay will happen, no fetching of the records from the default language. This boils down to "free mode" language handling. This is the only mode which shows records without a default language parent.

An exception to this rule can be made with the TypoScript CONTENT object if you manually set select.includeRecordsWithoutDefaultTranslation = 1.

1
Fetch records from the default language and overlay them with translations. If a record is not translated the default language will be used.
hideNonTranslated
Fetch records from the default language and overlay them with translations. If some record is not translated it will not be shown.
sys_language_uid

Property

sys_language_uid

Data type

integer

Description

This property holds the value of the field "uid" of a record of table "sys_language". Various parts of the frontend rendering code will select records which are assigned to this language. See ->SELECT

Internally this value is used to initialize the TypoScriptFrontendController LanguageAspect->id property. The LanguageAspect->contentId property is set based on the value of the sys_language_uid and other settings like sys_language_mode.

It is usually resolved internally by a middleware during bootstrap, taking site configuration setting into account. No manual interference necessary.

titleTagFunction

Property

titleTagFunction

Data type

function name

Description

Passes the default <title> tag content to this function. No TypoScript parameters are passed though.

tx_[extension key with no underscores]_[*]

Property

tx_[extension key with no underscores]_[*]

Data type

array

Description

Configuration space for extensions. This can be used – for example – by plugins that need some TypoScript configuration, but that don't actually display anything in the frontend (i.e. don't receive their configuration as an argument from the frontend rendering process).

Example

config.tx_realurl_enable = 1
config.tx_myextension.width  = 10
config.tx_myextension.length = 20
typolinkCheckRootline

Property

typolinkCheckRootline

Data type

boolean

Description

For every link created with "typolink" a check will be done to verify that the target page is within the current rootline of the site.

This option is always enabled since TYPO3 9. Setting it nevertheless will trigger a deprecation warning.

typolinkEnableLinksAcrossDomains

Property

typolinkEnableLinksAcrossDomains

Data type

boolean

Default

0

Description

This option enables to create links across domains using current domain's linking scheme.

If this option is not set, then all cross-domain links will be generated as

http://domain.tld/index.php?id=12345 (where 12345 is page id). Setting this option requires that domains, where pages are linked, have the same configuration for:

  • linking scheme (i.e. all use RealURL or CoolURI but not any mixture)
  • all domains have identical localization settings (sys_language_XXX directives)
  • all domains have the same set of languages defined

Disclaimer: it must be understood that while link is generated to another domain, it is still generated in the context of current domain. No side effects are known at the time of writing of this documentation but they may exist. If any side effects are found, this documentation will be updated to include them.

typolinkLinkAccessRestrictedPages

Property

typolinkLinkAccessRestrictedPages

Data type

integer (page id) / keyword "NONE"

Description

If set, typolinks pointing to access restricted pages will still link to the page even though the page cannot be accessed. If the value of this setting is an integer it will be interpreted as a page id to which the link will be directed.

If the value is NONE the original link to the page will be kept although it will generate a page-not-found situation (which can of course be picked up properly by the page-not-found handler and present a nice login form).

See showAccessRestrictedPages for menu objects as well (similar feature for menus)

Example

config.typolinkLinkAccessRestrictedPages = 29
config.typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID###

Will create a link to page with id 29 and add GET parameters where the return URL and original page id is a part of it.

typolinkLinkAccessRestrictedPages_addParams

Property

typolinkLinkAccessRestrictedPages_addParams

Data type

string

Description

See typolinkLinkAccessRestrictedPages above.

USERNAME_substToken

Property

USERNAME_substToken

Data type

string

Default

<!--###USERNAME###-->

Description

The is the token used on the page, which should be substituted with the current username if a front-end user is logged in! If no login, the substitution will not happen.

USERUID_substToken

Property

USERUID_substToken

Data type

string

Description

The is the token used on the page, which should be substituted with the current users UID if a front-end user is logged in! If no login, the substitution will not happen.

This value has no default value and only if you specify a value for this token will a substitution process take place.

xhtmlDoctype

Property

xhtmlDoctype

Data type

string

Default

(same as config.doctype if set to a keyword)

Description

Sets the document type for the XHTML version of the generated page.

If doctype is set to a string then xhtmlDoctype must be set to one of these keywords:

xhtml_trans for XHTML 1.0 Transitional doctype.

xhtml_strict for XHTML 1.0 Strict doctype.

xhtml_basic for XHTML basic doctype.

xhtml_11 for XHTML 1.1 doctype.

Example

This is an example to use MathML 2.0 in an XHTML 1.1 document:

config.doctype (
  <!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
      "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
)
config.xhtmlDoctype = xhtml_11
xmlprologue

Property

xmlprologue

Data type

string

Description

If empty (not set) then the default XML 1.0 prologue is set, when the doctype is set to a known keyword (e.g. xhtml_11):

<?xml version="1.0" encoding="utf-8">

If set to one of the following keywords then a standard prologue will be set:

xml_10: XML 1.0 prologue (see above)

xml_11: XML 1.1 prologue

none: The default XML prologue is not set.

Any other string is used as the XML prologue itself.

constants

This object can be used to define constants for replacement inside a parseFunc. If parseFunc somewhere is configured with .constants = 1, then all occurrences of the constant in the text will be substituted with the actual value. This is useful, if you need one and the same value at many places in your website. With constants, you can maintain it easily.

Note

The constants defined here are not the ones, which can be defined in the constants section of your template and which then in the setup section can be used as {$myconstant}.

Properties
Property Data Type stdWrap Default
(array of keys) string    
(array of keys)

Property

(array of keys)

Data type

string

Description

Constants in the form constants.key = value.

The key is the constant name, which you write in your texts. The value is the actual output, which you want to get in your website.

Examples:

constants.EMAIL = email@email.com

If now parseFunc somewhere is configured with .constants = 1, then all occurrences of the string ###EMAIL### in the text will be substituted with the actual address.

PAGE

Pages are referenced by two main values. The "id" and "type".

The "id" points to the uid of the page (or the alias). Thus the page is found.

The "type" is used to define how the page should be rendered. This is primarily used with different representations of the same content. Your default page will most likely have type 0 while a JSON stream with the same content could go with type 1.

A good habit is to use page as the top-level object name for the content-page on a website.

Most of this code is executed in the PHP script typo3/sysext/frontend/Classes/Page/PageGenerator.php.

Properties
Property Data Type stdWrap Default
1,2,3,4... cObject    
bodyTag <tag>   <body>
bodyTagAdd string    
bodyTagCObject cObject    
config ->CONFIG    
CSS_inlineStyle string    
cssInline ->CARRAY    
footerData ->CARRAY    
headerData ->CARRAY    
headTag <tag> / stdWrap   <head>
includeCSS.[array] resource    
includeCSSLibs.[array] resource    
includeJS.[array] resource    
includeJSFooter.[array] resource    
includeJSFooterlibs.[array] resource    
includeJSLibs.[array] resource    
inlineLanguageLabelFiles (array of strings)    
inlineSettings (array of strings)    
jsFooterInline ->CARRAY    
jsInline ->CARRAY    
meta ->META    
shortcutIcon resource    
stdWrap stdWrap    
typeNum integer   0
wrap wrap    
1,2,3,4...

Property

1,2,3,4...

Data type

cObject

Description

These properties can be used to define any number of objects, just like you can do with a COA content object.

bodyTag

Property

bodyTag

Data type

<tag>

Default

<body>

Description

Body tag on the page

Example

<body bgcolor="{$bgCol}">
bodyTagAdd

Property

bodyTagAdd

Data type

string

Description

This content is added inside of the opening <body> tag right before the > character. This is mostly useful for adding attributes to the <body> tag.

Example

# This will lead to <body class="example">
page.bodyTagAdd = class="example"
bodyTagCObject

Property

bodyTagCObject

Data type

cObject

Description

This is the default body tag. It is overridden by bodyTag, if that is set.

Note: Additionally to the body tag properties noted here, there also is the property disableBodyTag, which, if set, disables body tag generation independently from what might be set here.

config

Property

config

Data type

->CONFIG

Description

Configuration for the page. Any entries made here override the same entries in the top-level object config.

CSS_inlineStyle

Property

CSS_inlineStyle

Data type

string

Description

This value is just passed on as CSS.

Note: To make TYPO3 actually output these styles as inline CSS (in-document CSS encapsulated in <style> tags), config.inlineStyle2TempFile must be set to 0.

cssInline

Property

cssInline

Data type

->CARRAY

Description

Use cObjects for creating inline CSS

Example

cssInline {
    10 = TEXT
    10.value = h1 {margin:15px;}

    20 = TEXT
    20.value = h1 span {color: blue;}

    30 = FILE
    30.file = EXT:mysite/Resources/Public/StyleSheets/styles.css
}
footerData

Property

footerData

Data type

->CARRAY

Description

Same as headerData above, except that this block gets included at the bottom of the page (just before the closing </body> tag).

headerData

Property

headerData

Data type

->CARRAY

Description

Inserts content in the head section of the website. Could e.g. be Meta tags.

While you can also use this to include stylesheet references or JavaScript, you should better use page.includeCSS and page.includeJS for such files. Features like file concatenation and file compression will not work on files, which are included using headerData.

By default, gets inserted after all the style definitions.

headTag

Property

headTag

Data type

<tag> / stdWrap

Default

<head>

Description

Head-tag if alternatives are wanted

includeCSS.[array]

Property

includeCSS.[array]

Data type

resource

Description

Inserts a stylesheet (just like the stylesheet property), but allows setting up more than a single stylesheet, because you can enter files in an array.

The file definition must be a valid resource data type, otherwise nothing is inserted.

Each file has optional properties:

allWrap: Wraps the complete tag, useful for conditional comments.

allWrap.splitChar: Defines an alternative splitting character (default is "|" - the vertical line).

alternate: If set (boolean) then the rel-attribute will be "alternate stylesheet".

disableCompression: If config.compressCss is enabled, this disables the compression of this file.

excludeFromConcatenation: If config.concatenateCss is enabled, this prevents the file from being concatenated.

external: If set, there is no file existence check. Useful for inclusion of external files.

forceOnTop: Boolean flag. If set, this file will be added on top of all other files.

if: Allows to define conditions, which must evaluate to TRUE for the file to be included. If they do not evaluate to TRUE, the file will not be included. Extensive usage might cause huge numbers of temporary files to be created. See ->if for details.

import: If set (boolean) then the @import way of including a stylesheet is used instead of <link>

inline: If set, the content of the CSS file is inlined using <style> tags. Note that external files are not inlined.

media: Setting the media attribute of the <style> tag.

title: Setting the title of the <style> tag.

Example

includeCSS {
    file1 = fileadmin/mystylesheet1.css
    file2 = stylesheet_uploaded_to_template*.css
    file2.title = High contrast
    file2.media = print
    ie6Style = fileadmin/css/style3.css
    ie6Style.allWrap = <!--[if lte IE 7]>|<![endif]-->
    cooliris = http://www.cooliris.com/shared/resources/css/global.css
    cooliris.external = 1
}
includeCSSLibs.[array]

Property

includeCSSLibs.[array]

Data type

resource

Description

Adds CSS library files to head of page.

The file definition must be a valid resource data type, otherwise nothing is inserted. This means that remote files cannot be referenced (i.e. using https://...), except by using the .external property.

Each file has optional properties:

allWrap: Wraps the complete tag, useful for conditional comments.

allWrap.splitChar: Defines an alternative splitting character (default is "|" - the vertical line).

alternate: If set (boolean) then the rel-attribute will be "alternate stylesheet".

disableCompression: If config.compressCss is enabled, this disables the compression of this file.

excludeFromConcatenation: If config.concatenateCss is enabled, this prevents the file from being concatenated.

external: If set, there is no file existence check. Useful for inclusion of external files.

forceOnTop: Boolean flag. If set, this file will be added on top of all other files.

if: Allows to define conditions, which must evaluate to TRUE for the file to be included. If they do not evaluate to TRUE, the file will not be included. Extensive usage might cause huge numbers of temporary files to be created. See ->if for details.

import: If set (boolean) then the @import way of including a stylesheet is used instead of <link>

media: Setting the media attribute of the <style> tag.

title: Setting the title of the <style> tag.

Example

includeCSSLibs.twitter = https://twitter.com/styles/blogger.css
includeCSSLibs.twitter.external = 1
includeJS.[array]

Property

includeJS.[array]

Data type

resource

Description

Inserts one or more (Java)Scripts in <script> tags. With moveJsFromHeaderToFooter set to TRUE all files will be moved to the footer. The file definition must be a valid resource data type, otherwise nothing is inserted. This means that remote files cannot be referenced (i.e. using https://...), except by using the .external property.

Each file has optional properties:

allWrap: Wraps the complete tag, useful for conditional comments.

allWrap.splitChar: Defines an alternative splitting character (default is "|" - the vertical line).

async: Allows the file to be loaded asynchronously.

crossorigin: Allows to set the crossorigin attribute in script tags. Is automatically set to anonymous for external JavaScript files if an .integrity is set.

defer Allows to set the HTML5 attribute defer.

disableCompression: If config.compressJs is enabled, this disables the compression of this file.

excludeFromConcatenation: If config.concatenateJs is enabled, this prevents the file from being concatenated.

external: If set, there is no file existence check. Useful for inclusion of external files.

forceOnTop: Boolean flag. If set, this file will be added on top of all other files.

if: Allows to define conditions, which must evaluate to TRUE for the file to be included. If they do not evaluate to TRUE, the file will not be included. Extensive usage might cause huge numbers of temporary files to be created. See ->if for details.

type: Setting the MIME type of the script (default: text/javascript).

integrity: Adds the integrity attribute to the script element to let browsers ensure subresource integrity. Useful in hosting scenarios with resources externalized to CDN's. See SRI for more details. Integrity hashes may be generated using https://srihash.org/.

Example

includeJS {
    file1 = fileadmin/helloworld.js
    file1.type = application/x-javascript
    # Include a second file, but only if myConstant is set
    # in the TS constants field.
    file2 = javascript_uploaded_to_template*.js
    file2.if.isTrue = {$myConstant}
}
includeJSFooter.[array]

Property

includeJSFooter.[array]

Data type

resource

Description

Same as includeJS above, except that this block gets included at the bottom of the page (just before the closing </body> tag).

includeJSFooterlibs.[array]

Property

includeJSFooterlibs.[array]

Data type

resource

Description

Same as includeJSLibs, except that this block gets included at the bottom of the page (just before the closing </body> tag).

includeJSLibs.[array]

Property

includeJSLibs.[array]

Data type

resource

Description

Adds JS library files to head of page.

The file definition must be a valid resource data type, otherwise nothing is inserted. This means that remote files cannot be referenced (i.e. using https://...), except by using the .external property.

Each file has optional properties:

allWrap: Wraps the complete tag, useful for conditional comments.

allWrap.splitChar: Defines an alternative splitting character (default is "|" - the vertical line).

async: Allows the file to be loaded asynchronously.

crossorigin: Allows to set the crossorigin attribute in script tags. Is automatically set to anonymous for external JavaScript files if an .integrity is set.

defer Allows to set the HTML5 attribute defer.

disableCompression: If config.compressJs is enabled, this disables the compression of this file.

excludeFromConcatenation: If config.concatenateJs is enabled, this prevents the file from being concatenated.

.external: If set, there is no file existence check. Useful for inclusion of external files.

.forceOnTop: Boolean flag. If set, this file will be added on top of all other files.

.if: Allows to define conditions, which must evaluate to TRUE for the file to be included. If they do not evaluate to TRUE, the file will not be included. Extensive usage might cause huge numbers of temporary files to be created. See ->if for details.

.integrity: Adds the integrity attribute to the script element to let browsers ensure subresource integrity. Useful in hosting scenarios with resources externalized to CDN's. See SRI for more details. Integrity hashes may be generated using https://srihash.org/.

Example:

includeJSLibs.twitter = http://twitter.com/javascripts/blogger.js
includeJSLibs.twitter.external = 1
includeJSLibs.twitter.integrity = sha256-C6CB9UYIS9UJeqinPHWTHVqh/E1uhG5Twh+Y5qFQmYg=
inlineLanguageLabelFiles

Property

inlineLanguageLabelFiles

Data type

(array of strings)

Description

Adds language labels to the page. All labels will be then be available in the Javascript object TYPO3.lang.

Available sub-properties:

selectionPrefix: Only label keys that start with this prefix will be included. Default: ''.

stripFromSelectionName: A string that will be removed from any included label key. Default: ''.

errorMode: Error mode if the file could not be found: 0 - syslog entry, 1 - do nothing, 2 - throw an exception. Default: 0

Example

inlineLanguageLabelFiles {
    someLabels = EXT:myExt/Resources/Private/Language/locallang.xlf
    someLabels.selectionPrefix = idPrefix
    someLabels.stripFromSelectionName = strip_me
    someLabels.errorMode = 2
}
inlineSettings

Property

inlineSettings

Data type

(array of strings)

Description

ExtJS specific, adds settings to the page.

Example

page.inlineSettings {
    setting1 = Hello
    setting2 = GoOnTop
}

Will produce following source

TYPO3.settings = {"TS":{"setting1":"Hello","setting2":"GoOnTop"}};
jsFooterInline

Property

jsFooterInline

Data type

->CARRAY

Description

Same jsInline above, except that the JavaScript gets inserted at the bottom of the page (just before the closing </body tag).

jsInline

Property

jsInline

Data type

->CARRAY

Description

Use cObjects for creating inline JavaScript

Note:

With config.removeDefaultJS = external, the inline JavaScript is moved to an external file.

Example

page.jsInline {
    10 = TEXT
    10.stdWrap.dataWrap = var pageId = {TSFE:id};
}
meta

Property

meta

Data type

->META

Description

./.

shortcutIcon

Property

shortcutIcon

Data type

resource

Description

Favicon of the page. Create a reference to an icon here!

Browsers that support favicons display them in the address bar of the browser, next to the name of the site in lists of bookmarks and next to the title of the page in the tab.

Note: The file must be a valid .ico file (icon file).

Note: The reference to this file will only be included in the output of your website, if the file actually exists! Should the file be missing, the tag will not be rendered.

stdWrap

Property

stdWrap

Data type

stdWrap

Description

Wraps the content of the cObject array with stdWrap options.

typeNum

Property

typeNum

Data type

integer

Default

0

Description

This determines the typeId of the page. The &type= parameter in the URL determines, which page object will be rendered. The value defaults to 0 for the first found PAGE object, but it must be set and be unique as soon as you use more than one such object (watch this if you use frames on your page)!

wrap

Property

wrap

Data type

wrap

Description

Wraps the content of the cObject array.

meta

Properties
Property Data Type stdWrap Default
array of key names string /stdWrap    
array of key names
Property:
array of key names
Data type:
string /stdWrap
Description:

To define meta tags.

Use the scheme meta.key = value.

value is the content of the meta tag. If the value is empty (after trimming), the meta tag is not generated.

The key can be the name of any meta tag, for example description or keywords. If the key is refresh (case insensitive), then the http-equiv attribute is used in the meta tag instead of the name attribute.

For each key the following sub-properties are available:

httpEquivalent
If set to 1, the http-equiv attribute is used in the meta tag instead of the name attribute. Default: 0.
replace
If set to 1, the tag will replace the one set earlier by a plugin. If set to 0 (default), the meta tag generated by the plugin will be used. If there is none yet, the one from TypoScript is set.
Examples:

Simple definition:

meta.description = This is the description of the content in this document.
meta.keywords = These are the keywords.

Fetch data from the keywords field of the current or any parent page:

meta.keywords.data = levelfield:-1, keywords, slide

Make a meta.refresh entry:

meta.refresh = [seconds]; [URL, leave blank for same page]

Usage of httpEquivalent:

meta.X-UA-Compatible = IE=edge
meta.X-UA-Compatible.httpEquivalent = 1

Result:

<meta http-equiv="X-UA-Compatible" content="IE=edge">.

Meta tags with a different attribute name are supported like the Open Graph meta tags:

page {
   meta {
      X-UA-Compatible = IE=edge
      X-UA-Compatible.attribute = http-equiv
      keywords = TYPO3
      og:site_name = TYPO3
      og:site_name.attribute = property
      description = Inspiring people to share Normal
      dc.description = Inspiring people to share [DC tags]
      og:description = Inspiring people to share [OpenGraph]
      og:description.attribute = property
      og:locale = en_GB
      og:locale.attribute = property
      og:locale:alternate {
         attribute = property
         value {
            1 = fr_FR
            2 = de_DE
         }
      }
      refresh = 5; url=http://example.com/
      refresh.attribute = http-equiv
   }
}

They can be used like property used for OG tags in the example.

You may also supply multiple values for one name, which results in multiple meta tags with the same name to be rendered.

Result for og:description:

<meta property="og:description"
      content="Inspiring people to share [OpenGraph]" />

See http://ogp.me/ for more information about the Open Graph protocol and its properties.

carray

Properties
Property Data Type stdWrap Default
(stdWrap properties...) ->stdWrap    
(TDParams) <TD>-params    
1,2,3,4... cObject    
Property details
(stdWrap properties...)

Property

(stdWrap properties...)

Data type

->stdWrap

Description

Note: This applies ONLY if "CARRAY /stdWrap" is set to be data type.

If you specify any non-integer properties to a CARRAY, stdWrap will be invoked with all properties of the CARRAY.

Example:

10 = TEXT
10.value = testing

5 = TEXT
5.value = This will be rendered before "10"

wrap = <b>|</b>

This will return '<b>This will be rendered before "10"testing</b>'.

(TDParams)

Property

(TDParams)

Data type

<TD>-params

Description

Note: This applies ONLY if "CARRAY +TDParams" is set to be data type.

This property is used only in some cases where CARRAY is used. Please look out for a note about that in the various cases.

1,2,3,4...

Property

1,2,3,4...

Data type

cObject

Description

This is a numerical "array" of content objects (cObjects). The order in which you specify the objects is not important as the array will be sorted numerically before it's parsed!

Content Objects

General information

PHP information

The content objects (cObjects) are primarily controlled by the PHP- script "typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php". The PHP-class is named "ContentObjectRenderer" and often this is also the variable-name of the objects ($cObj).

The $cObj in PHP has an array, $this->data, which holds records of various kind. See data type "getText".

This record is normally "loaded" with the record from a table depending on the situation. Say if you are creating a menu it's often loaded with the page-record of the actual menu item or if it's about content-rendering it will be the content-record.

REUSING cOBJECTS

When dealing with "cObjects", you're allowed to use a special syntax in order to reuse cObjects without actually creating a copy. This has the advantage of minimizing the size of the cached template. But on the other hand it does not give you the flexibility of overriding values.

This example will show you how it works:

#
# Temporary objects are defined:
#
lib.stdheader = COA
lib.stdheader {
  stdWrap.wrapAlign.field = header_position
  stdWrap.typolink.parameter.field = header_link
  stdWrap.fieldRequired = header

  1 = TEXT
  1.stdWrap.current = 1

  stdWrap.space = {$content.headerSpace}
}


#
# CType: header
#
tt_content.header = COA
tt_content.header {
  10 < lib.stdheader
  10.stdWrap.space >

  20 = TEXT
  20.stdWrap.field = subheader
}


#
# CType: bullet
#
tt_content.bullets = COA
tt_content.bullets {
  10 = < lib.stdheader
  20 < styles.content.bulletlist_gr
}

First lib.stdheader is defined. This is (and must be) a cObject! (In this case it is COA.)

Now lib.stdheader is copied to tt_content.header.10 with the "<" operator. This means that an actual copy of lib.stdheader is created at parsetime.

But this is not the case with tt_content.bullets.10. Here lib.stdheader is just pointed to and lib.stdheader will be used as the cObject at runtime.

The reason why lib.stdheader was copied in the first case is the fact that it's needed to unset ".stdWrap.space" inside the cObject ("10.stdWrap.space >"). This could not be done in the second case where only a pointer is created.

Note:

If lib.stdheader was temp.stdheader instead, the pointer would not work! This is due to the fact that the runtime-reference would find nothing in "temp." as this is unset before the template is stored in cache!

This goes for "temp." and "styles." (see the top-level object definition elsewhere).

Overriding values anyway:

Although you cannot override values TypoScript-style (using the operators and all) the properties of the object which has the reference will be merged with the configuration of the reference.

Example:
page.10 = TEXT
page.10.value = kasper
page.10.stdWrap.case = upper

page.20 = < page.10
page.20.stdWrap.case = lower
page.20.value >
page.20.stdWrap.field = pages

The result is this configuration:

Resulting configuration.

Notice that .value was not cleared, because it's simply two arrays which are joined:

The arrays, which are merged.

So hence the line page.20.value > in the above example is useless.

CASE

This is a very flexible object whose rendering can vary depending on a given key. The principle is similar to that of the "switch" construct in PHP.

The value of the "key" property determines, which of the provided cObjects will finally be rendered.

The "key" property is expected to match one of the values found in the "array of cObjects". Any string can be used as value in this array, except for those that match another property. So the forbidden values are: "if", "setCurrent", "key", and "stdWrap". "default" also cannot be used as it has a special meaning: If the value of the "key" property is not found in the array of cObjects, then the cObject from the "default" property will be used.

Property

if

Data type

->if

Description

If "if" returns false, nothing is returned.

Property

setCurrent

Data type

string /stdWrap

Description

Sets the "current"-value.

Property

key

Data type

string /stdWrap

Description

The key, which determines, which cObject will be rendered. Its value is expected to match the name of one of the cObjects from the array of cObjects; this cObject is then rendered. If no name of a cObject is matched, the cObject from the property "default" is rendered.

This defines the source of the value that will be matched against the values of the "array of cObjects". It will generally not be a simple string, but use its stdWrap properties to retrieve a dynamic value from some specific source, typically a field of the current record. See the example below.

Default

default

Property

(array of cObjects)

Data type

cObject

Description

Array of cObjects. Use this to define cObjects for the different values of "key". If "key" has a certain value, the according cObject will be rendered. The cObjects can have any name, but not the names of the other properties of the cObject CASE.

Property

default

Data type

cObject

Description

Use this to define the rendering for those values of "key" that do not match any of the values of the "array of cObjects". If no default cObject is defined, an empty string will be returned for the default case.

Property

stdWrap

Data type

->stdWrap

Description

stdWrap around any object that was rendered no matter what the "key" value is.

[tsref:(cObject).CASE]

Example:

If in this example the field "header" turns out not to be set ("false"), an empty string is returned. Otherwise TYPO3 chooses between two different renderings of some content depending on whether the field "layout" is "1" or not ("default"). The result is in either case wrapped with "|<br>".

stuff = CASE
stuff.if.isTrue.field = header
# This value determines, which of the following cObjects will be rendered.
stuff.key.field = layout

# cObject for the case that field layout is "1".
stuff.1 = TEXT
stuff.1 {
  ....
}
# cObject for all other cases.
stuff.default = TEXT
stuff.default {
  ....
}

stuff.stdWrap.wrap = |<br>

COA, COA_INT

COA stands for "content object array" and is a cObject, in which you can place several other cObjects using numbers to enumerate them.

You can also create this object as a COA_INT in which case it works exactly like the USER_INT object does: It's rendered non-cached! That way you cannot only render non-cached USER_INT objects, but COA_INT allows you to render every cObject non-cached.

Property

if

Data type

->if

Description

If "if" returns false, the COA is not rendered.

Property

1,2,3,4...

Data type

cObject

Description

Numbered properties to define the different cObjects, which should be rendered.

Property

wrap

Data type

wrap /stdWrap

Property

stdWrap

Data type

->stdWrap

[tsref:(cObject).COA/(cObject).COA_INT]

Examples:
lib.menutable = COA
lib.menutable {
  10 = TEXT
  10.value = <table border="0" style="border-spacing: 0px;">

  20 = HMENU
  20.entryLevel = 0
  20.1 = GMENU
  20.1.NO {
    wrap = <tr><td> | </td></tr>
    XY = {$menuXY}
    backColor = {$bgCol}
    20 = TEXT
    20 {
      text.field = title
      fontFile = fileadmin/fonts/hatten.ttf
      fontSize = 23
      fontColor = {$menuCol}
      offset = |*| 5,18 || 25,18
    }
  }

  30 = TEXT
  30.value = </table>
}

The previous example will print a table with a graphical menu in it.

lib.currentDate = COA_INT
lib.currentDate {
  10 = TEXT
  10.stdWrap.data = date:U
  10.stdWrap.strftime = %H:%M:%S
}

This example will not be cached and so will display the current time on each page hit.

CONTENT

This object is designed to generate content by allowing to finely select records and have them rendered.

What records are visible is controlled by start and end fields and more standard fields automatically. The internal value SYS_LASTCHANGED is raised to the maximum timestamp value of the respective records.

See also

The cObject RECORDS in contrast is for displaying lists of records from a variety of tables without fine graining.

Comprehensive example

See PHP class \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\ContentContentObject for details on code level.

Preamble:

# Note: TypoScript (TS) is just another way to define an array of settings which
#       is later on INTERPRETED by TYPO3. TypoScript can be written in ANY order
#       as long as it leads to the same array. Actual execution order is TOTALLY
#       INDEPENDENT of TypoScript code order.
#
#       The order of TS in this example however tries to reflect execution order.
#       The denoted steps are taking place in that order at execution time.

Condensed form:

1 = CONTENT
1 {
   if {
   }
   table = tt_content
   select {
      pidInList = this
      orderBy = sorting
   }
   renderObj = < tt_content
   slide = 0
   slide {
      collect = 0
      collectReverse = 0
      collectFuzzy = 0
   }
   wrap =
   stdWrap =
}

Expanded form:

1 = CONTENT

// STEP 1: do nothing if 'if' evaluates to false

1.if {
   # ifclause =
}
// STEP 2: define parameters

1.table = tt_content           # default='' #stdWrap

1.select {
   pidInList = this
   orderBy = sorting
}

# renderObj = <TABLEVALUE      # default!
1.renderObj =

# slide = 0                    # default! #stdWrap
1.slide = -1

# slideCollect = 0             # default! #stdWrap
1.slide.collect =

# slideCollectReverse = false  # default! #stdWrap
1.slide.collectReverse =

# slideCollectFuzzy = false    # default! #stdWrap
1.slide.collectFuzzy =
// STEP 3: find all records

// STEP 4: apply the renderObj to each record and collect
//         the results as string 'totalResult'

// STEP 5: Apply wrap to the 'totalResult'
1.wrap = |                     # default!

// STEP 6: Apply stdWrap to the 'totalResult'
1.stdWrap =                    # default! #stdWrap

// STEP 6: Return 'totalResult'

See also: if, select, wrap, stdWrap, cObject

select

Property

select

Data type

select

Description

The SQL-statement, a SELECT query, is set here, including automatic visibility control.

table

Property

table

Data type

table name /stdWrap

Description

The table, the content should come from. Any table can be used; a check for a table prefix is not done.

In standard configuration this will be tt_content.

renderObj

Property

renderObj

Data type

cObject

Default

< [table name]

Description

The cObject used for rendering the records resulting from the query in .select.

If renderObj is not set explicitly, then < [table name] is used. So in this case the configuration of the according table is being copied. See the notes on the example below.

slide

Property

slide

Data type

integer /stdWrap

Description

If set and no content element is found by the select command, the rootLine will be traversed back until some content is found.

Possible values are -1 (slide back up to the siteroot), 1 (only the current level) and 2 (up from one level back).

Use -1 in combination with collect.

slide.collect
(integer /stdWrap) If set, all content elements found on the current and parent pages will be collected. Otherwise, the sliding would stop after the first hit. Set this value to the amount of levels to collect on, or use -1 to collect up to the siteroot.
slide.collectFuzzy
(boolean /stdWrap) Only useful in collect mode. If no content elements have been found for the specified depth in collect mode, traverse further until at least one match has occurred.
slide.collectReverse
(boolean /stdWrap) Reverse order of elements in collect mode. If set, elements of the current page will be at the bottom.

Note: The sliding will stop when reaching a folder. See $cObj->checkPid_badDoktypeList.

wrap

Property

wrap

Data type

wrap /stdWrap

Description

Wrap the whole content.

stdWrap

Property

stdWrap

Data type

stdWrap

Description

Apply stdWrap functionality.

CONTENT object example 1

Here is an example of the CONTENT object:

1 = CONTENT
1.table = tt_content
1.select {
   pidInList = this
   orderBy = sorting
}

Since in the above example .renderObj is not set explicitly, TYPO3 will automatically set 1.renderObj < tt_content, so that renderObj will reference the TypoScript configuration of tt_content. The according TypoScript configuration will be copied to renderObj.

CONTENT object example 2

Here is an example of record-rendering objects:

// Configuration for records with the "field" type value
// (often "CType") set to "header"
tt_content.header.default {
   10 = TEXT
   10.stdWrap.field = header
   # ...
}

// Configuration for records with the "field" type value
// (often "CType") set to "bullets"
// If field "layout" is set to "1" or "2", a special configuration is used,
// else defaults are being used.
tt_content.bullets.subTypeField = layout
tt_content.bullets.default {
   # ...
}
tt_content.bullets.1 {
   # ...
}
tt_content.bullets.2 {
   # ...
}

// This is what happens if the "field" type value does not match any of the above
tt_content.default.default {
   # ...
}

EDITPANEL

This content object is inserted only if a backend user is logged in and if a FE-editing extension is installed and loaded. What gets displayed exactly may depend on which FE-editing extension is used. The reference below is related to the "feedit" system extension. In such a case the EDITPANEL also requires that the