TypoScript Reference

Previous Key:doc_core_tsref
Version:latest (8-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:2017-07-20 12:06

The content of this document is related to TYPO3,

a GNU/GPL CMS/Framework available from www.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 TYPO3 TypoScript templates (and not in TSconfig).

For explanations about the syntax of TypoScript itself, please refer to the "TypoScript Syntax and In-Depth Study" manual.

This version is updated for TYPO3 CMS version 7 LTS.

What's new

During the development of TYPO3 7, a lot of properties have been added, changed, deprecated or removed.

Additionally various descriptions were improved and many smaller mistakes were fixed.

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

For more details about changes in the various TYPO3 versions please refer to the links below.

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

For general questions about the documentation get in touch by writing to documentation@typo3.org .

If you find a bug in this manual, please be so kind as to check the online version on https://docs.typo3.org/typo3cms/TyposcriptReference/. 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: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/issues.

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 documentation mailing list/forum (https://forum.typo3.org/index.php/f/44/).

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 TSref 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.

Data types

The values you assign to properties in TypoScript are often of a specific format. The following table describes these formats.

For example, if a value is defined as the type "<tag>", you're supposed to supply HTML code. 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 you should supply an HTML color code or comma-separated RGB-values.

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!

date-conf

Data type

date-conf

Examples

d-m-y (dd-mm-yy format)

Comment

See PHP function Date()!

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"

degree

Data type

degree

Examples

45

Comment

-90 to 90, integers

dir

Data type

dir

Examples

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

Comment

[path relative to the web root of the site] | [list of valid extensions] | [sorting: name, size, ext, date] | [reverse: "r"] | [return full path: boolean]

Files matching are returned in a comma-separated string.

Note:

The value of config-option "lockFilePath" must equal the first part of the path. Thereby the path is locked to that folder.

function name

Data type

function name

Examples

Function:

user_reverseString

Method in class:

user_stringReversing->reverseString

Method in class, namespaced and preferred version:

Your\NameSpace\YourClass->reverseString

Comment

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 $TYPO3_CONF_VARS config though. The function / method is normally called with 2 parameters, $conf (TS configuration) and $content (some content to be processed and returned).

Also if you call a method in a class, 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!

getText

Data type

getText

Examples

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 up the page tree, from the database, etc.

The general syntax is as follows:

key:code

where key indicates the source we are trying to retrieve the value from and code is some form of path or pointer to the value, which depends on the key used. The various keys (e.g. field, parameter, register...) 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 gp and tsfe.

Example:

foo = TSFE:fe_user|user|username

Spaces around the colon (:) are irrelevant. The key is case-insensitive.

Getting alternative values

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

Example:

foo = field:header // field:title // field:uid

This gets 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".

field:

Syntax

field: [field name from the current $cObj->data array in the cObject, multi-dimensional.]

  • As default the $cObj->data array is $GLOBALS['TSFE']->page (record of the current page!)
  • In TMENU $cObj->data is set to the page-record for each menu item.
  • 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

foo = field : header

gets content from $cObj->data['header']

foo = field : fieldname|level1|level2

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

parameters:

Syntax

parameters: [field name from the current $cObj->parameters array in the cObject.]

See parseFunc.

Example:

foo = parameters: color

gets content from $cObj->parameters['color']

register:

Syntax

register: [field name from the $GLOBALS['TSFE']->register]

See LOAD_REGISTER.

Example:

foo = register: color

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

leveltitle, leveluid, levelmedia:

Syntax

leveltitle, leveluid, levelmedia: [levelTitle, uid or media in rootLine, 0- , negative = from behind, " , slide" parameter forces a walk to the bottom of the rootline until there's a "true" value to return. Useful with levelmedia.]

Returns values from up or down the page tree.

Examples

foo = leveltitle : 1

gets the title of the page on the first level of the rootline

foo = leveltitle : -2 , slide

gets 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 rootline until there's a title

foo = leveluid : 0

gets the id of the root-page of the website (level zero)

levelfield:

Syntax

levelfield: Like "leveltitle" et al. but where the second parameter is the rootLine field you want to fetch. Syntax: [pointer, integer], [field name], ["slide"]

Example:

foo = levelfield : -1 , user_myExtField , slide

gets the value of the user defined field user_myExtField in the root line (requires additional configuration in :php:`$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']` to include field!)

date:

Syntax

date: [date-conf]. Can also be used without colon and date configuration. Then the date will be formatted as "d/m Y".

Example:

foo = date : d-m-y

gets the current time formatted dd-mm-yy

page:

Syntax

page: [field in the current page record]

Example:

foo = page : title

gets the current page title

pagelayout:

Syntax

pagelayout

Example:

foo = pagelayout

gets the current backend layout

current:

Syntax

current (gets the "current" value)

Example:

foo = current

gets the current value

level:

Syntax

level (gets the rootline level of the current page)

Example:

foo = level

gets the rootline level of the current page

GP:

Syntax

GP: Value from GET or POST method.

Note

"GPvar" also exists, but is deprecated.

Examples

foo = GP : stuff

gets input value from query string &stuff=...

foo = GP : stuff | bar

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

getenv:

Syntax

getenv: Value from environment variables

Example:

foo = getenv : HTTP_REFERER

gets the env var HTTP_REFERER

getIndpEnv:

getIndpEnv 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()

Syntax:

getIndpEnv : <name>

Example:

# get and output the client IP
page = PAGE
page.10 = TEXT
page.10.stdWrap.data = getIndpEnv : REMOTE_ADDR
page.10.stdWrap.htmlSpecialChars = 1

These names can be used with getIndpEnv:

Name Definition Example or result
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)  
1 Return an array with all values for debugging purposes  
TSFE:

Syntax

TSFE: [value from the $GLOBALS['TSFE'] array, multi-dimensional]

Example:

foo = TSFE:fe_user|user|username

gets the "username" field of the current FE user

DB:

Syntax

DB: Value from database, syntax is [table name] : [uid] : [field]. Any record from a table in TCA can be selected here. Records marked as deleted will not return any value.

Example:

foo = DB : tt_content:234:header

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

file:

Syntax

file: syntax is [uid] : [property]. Retrieves a property from a file object (FAL) by identifying it through its sys_file UID. Note that during execution of the FILES cObject, you can also 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:

foo = file : 17 : size

gets the file size of the file with the sys_file UID 17.

fullRootLine:

Syntax

fullRootLine: syntax is [pointer, integer], [field name], ["slide"]

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" propertydescribed above, it is possible to goup 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 above.

Example:

foo = fullRootLine : -1, title

gets the title of the page right before the start of the current website

LLL:

Syntax

LLL: Reference to a locallang (xlf, xml or php) label. Reference consists of [fileref]:[labelkey]

Example:

foo = LLL:EXT:felogin/pi1/locallang.xlf:logout

gets localized label for logout button

path:

Syntax

path: path to a file, possibly placed in an extension, returns empty if the file does not exist.

Example:

foo = path:EXT:rsaauth/resources/rsaauth.js

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

cObj:

Syntax

cObj: parentRecordNumber

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:

foo = cObj : parentRecordNumber

gets the number of the current cObject record

session:

Syntax

session: key

The key refers to the session key used to store the value. Subelements may be accessed by using the | symbol to access nested values of arrays or objects in the session

Example:

foo = session: shop_cart|itemCount

get the number of items of a stored shopping cart array/object

debug:

Syntax

debug: Returns HTML-formatted content of the PHP variable defined by the keyword. Available keywords are "rootLine", "fullRootLine", "data", "register" and "page".

Example:

foo = debug : rootLine

outputs the current root-line visually in HTML

global:

Syntax

global: [GLOBAL variable, split with | if you want to get from an array! Deprecated, use GP, TSFE or getenv!]

flexform:

Syntax

flexform: [field containing flexform data].[property of this flexform]

Example:

foo = flexform: pi_flexform:settings.categories
  • returns the flexform value of given name

GraphicColor

Data type

GraphicColor

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)

Comment

The color can be given as HTML-color or as a comma-separated list of RGB-values (integers).

You can add an extra parameter that will modify the color mathematically:

Syntax:

[colordef] : [modifier]

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

HTML code

Data type

HTML code

Examples

<b>Some text in bold</b>

Comment

pure HTML code

HTML-color

Data type

HTML-color

Examples

red

#ffeecc

Comment

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

imageExtension

Data type

imageExtension

Examples

jpg

web (gif or jpg ..)

Comment

Image extensions can be anything among the allowed types defined in the global variable $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!

imgResource

Data type

imgResource

Examples

Here "file" is an imgResource:

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

GIFBUILDER:

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

Comment

  1. A "resource" (see above) plus imgResource properties (see the example and the object reference for imgResource below).

    Filetypes can be anything among the allowed types defined in the configuration variable $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.

integer

Data type

integer / int

Examples

42, -8, -9, 0

Comment

integer

(This data type is sometimes used generally though another type would have been more appropriate, like "pixels".)

linkWrap

Data type

linkWrap

Examples

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

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

Comment

<.. {x}.> | </...>

{x}; x is an integer (0-9) and points to a key in the PHP array rootLine. 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.

list

Data type

list

Examples

item,item2,item3

Comment

list of values

margins

Data type

margins

Examples

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

10,0,0,5

Comment

l,t,r,b

left, top, right, bottom

Data types: Object types

These are some "data types" that might be mentioned and valid values are shown here below:

cObject

"cObjects" are also called "Content Objects". See the section "Content Objects" later in this manual.

Examples:

TEXT / IMAGE / TEMPLATE ....
frameObj

FRAMESET / FRAME

Gifbuilder Object

See section GIFBUILDER in this manual.

Examples:

TEXT / SHADOW / OUTLINE / EMBOSS / BOX / IMAGE / EFFECT

page_id

Data type

page_id

Examples

this

34

Comment

A page id (integer) or "this" (=current page id).

path

Data type

path

Examples

fileadmin/stuff/

Comment

Path relative to the root directory from which we operate.

pixels

Data type

pixels

Examples

345

Comment

pixel-distance

positive integer

Data type

positive integer / posint / int+

Examples

42, 8, 9

Comment

Positive integer

resource

Data type

resource

Examples

Reference to a file in the file system:*

fileadmin/picture.gif

Comment

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.

rotation

Data type

rotation

Examples

180

Comment

integer, degrees from 0 - 360

space

Data type

space

Examples

5 | 5

Comment

"space before | space after"

Used for content and sets the according number of pixels space "before | after".

strftime-conf

Data type

strftime-conf

Examples

Date "DD-MM-YY" =

%e:%m:%y

Time "HH:MM:SS" =

%H:%M:%S

or just

%T

Comment

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

string

Data type

string / str / value

Examples

The quick brown fox jumps over the lazy dog.

Comment

string.

(sometimes used generally though another type would have been more appropriate, like "align")

<tag>

Data type

<tag>

Examples

<body lang="de">

Comment

An HTML tag.

< tag >-data

Data type

< tag >-data

Examples

<frameset>-data: row

could be '150,*'

Comment

< tag >-params

Data type

< tag >-params

Examples

<frameset>-params

could be 'border="0" framespacing="0"'

Comment

Parameters for a tag.

target

Data type

target

Examples

_top

_blank

content

Comment

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

Examples

Seconds to May 09th 2016 12:34:

1462790096

Comment

Seconds since January 1st 1970.

VHalign

Data type

VHalign

Examples

Horizontal alignment = right and Vertical alignment = center:

r , c

Comment

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

wrap

Data type

wrap

Examples

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

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

Comment

<...> | </...>

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.

x,y,w,h

Data type

x,y,w,h

Examples

10,10,5,5

Comment

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

w,h is the width and height

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 splitConfArray which is part of the Core TypoScript TemplateService class: TYPO3 \ CMS \ Core \ TypoScript \ TemplateService :: splitConfArray().

Terminology

It's useful to aggree 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 |*| occurrs 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 - implictely - 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 according chapter in "TypoScript Syntax and In-depth Study".

Topics:

About The Syntax Of Conditions

See also

For full explanations about conditions, especially about condition syntax, please refer to the according chapter in "TypoScript Syntax and In-depth Study".

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 [GLOBAL] condition 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]

Condition reference

language
Syntax:
[language = lang1, lang2, ...]
Comparison:

Comparison with the website visitor's preferred languages.

The values must be a straight match with the value of getenv('HTTP_ACCEPT_LANGUAGE') from PHP. Alternatively, if the value is wrapped in "*" (e.g. "*en-us*") then it will split all languages found in the HTTP_ACCEPT_LANGUAGE string and try to match the value with any of those parts of the string. Such a string normally looks like "de,en-us;q=0.7,en;q=0.3" and "*en-us*" would match with this string.

IP
Syntax:
[IP = ipaddress1, ipaddress2, ...]
Comparison:

Comparison with the IP address, which the website visitor uses.

The values are compared with getenv('REMOTE_ADDR') from PHP.

You may include "*" instead of one of the parts in values. You may also list the first one, two or three parts and only they will be tested.

The IP condition also supports the special keyword "devIP". If - instead of using an actual IP address or range - you use this keyword, the IP address, which the visitor uses, will be compared to $TYPO3_CONF_VARS['SYS']['devIPmask'] as set in the Install Tool.

Examples:

These examples will match any IP address starting with "123":

[IP = 123.*.*.*]

or

[IP = 123]

These examples will match any IP address ending with "123" or being "192.168.1.34":

[IP = *.*.*.123][IP = 192.168.1.34]

This example will match the IP address or range defined in $TYPO3_CONF_VARS['SYS']['devIPmask']:

[IP = devIP]
hostname
Syntax:
[hostname = hostname1, hostname2, ...]
Comparison:

Comparison with the hostname, which the website visitor uses.

The values are compared to the fully qualified hostname, which is retrieved by PHP based on getenv('REMOTE_HOST').

Value is comma-list of domain names to match with. *-wildcard allowed but cannot be part of a string, so it must match the full host name (e.g. myhost.*.com => correct, myhost.*domain.com => wrong)

applicationContext
Syntax:
[applicationContext = context1, context2, ...]
Comparison:

Comparison with the application context, in which TYPO3 is running.

The values are compared to applicationContext, which is set at the very beginning of the bootstrap sequence based on getenv('TYPO3_CONTEXT').

Value is comma-list of application contexts to match with. Wildcards + and * are allowed, as well as regular expressions delimited with /PREG_PATTERN/.

Examples:

Matches exactly the applicationContexts "Development/Debugging" or "Development/Profiling":

[applicationContext = Development/Debugging, Development/Profiling]

Matches any applicationContext with a rootContext of "Production", for example "Production/Live" or "Production/Staging":

[applicationContext = Production*]

Matches any applicationContext starting with "Production/Staging/Server" and ending with one digit, for example "Production/Staging/Server3":

[applicationContext = /^Production\/Staging\/Server\d+$/]
hour
Syntax:
[hour = hour1, > hour2, < hour3, ...]

Note: The first "=" sign directly after the word "hour" is always needed and is no operator. After that follow the operator and then the hour.

Comparison:

Possible values are 0 to 23 (24-hours-format). The values in floating point are compared with the current hour of the server time.

As you see in the section "Syntax" above, you can separate multiple conditions in one with a comma. The comma will then connect them with a logical disjunction (OR), that means the whole condition will be true, when one or more of its operands are true.

Operator: Function:
[none] Requires an exact match with the value. Comparison with a list of values is possible as well. The condition then returns true, if the value is in the list. Values must then be separated by "|".
> The hour must be greater than the value.
< The hour must be less than the value.
<= The hour must be less than or equal to the value.
=> The hour must be greater than or equal to the value.
!= The hour must be not equal to the value. Comparison with a list of values is possible as well. The condition then returns true, if the value is not in the list. Values must then be separated by "|".
Examples:

This will match, if it is between 9 and 10 o'clock (according to the server time):

[hour = 9]

This will match, if it is not between 8 and 11 o'clock:

[hour = != 8|9|10]

This will match, if it is before 7 o'clock:

[hour = < 7]

This will match, if it is before 15 o'clock:

[hour = <= 14]

The following examples will demonstrate the usage of the comma inside the condition:

This will match, if it is between 8 and 9 o'clock (the hour equals 8) or after 16 o'clock (the hour is bigger than or equal to 16):

[hour = 8, >= 16]

This will match between 16 and 8 o'clock (remember that the comma acts as an OR):

[hour = > 15, < 8]

In contrast a condition matching for 8 until 16 o'clock would be:

[hour = > 7] && [hour = < 16]
minute

See "Hour" above. Uses the same syntax!

Syntax:
[minute = ...]
Comparison:

Minute of hour, possible values are 0-59.

Apart from that this condition uses the same way of comparison as hour.

month

See "Hour" above. Uses the same syntax!

Syntax:
[month = ...]
Comparison:

Month, from January being 1 until December being 12.

Apart from that this condition uses the same way of comparison as hour.

year

See "Hour" above. Uses the same syntax!For further information look at the date() function in the PHP manual, format string Y.

Syntax:
[year = ...]
Comparison:

Year, as a 4-digit number.

Apart from that this condition uses the same way of comparison as hour.

dayofweek

See "Hour" above. Uses the same syntax!

Syntax:
[dayofweek = ...]
Comparison:

Day of week, starting with Sunday being 0 until Saturday being 6.

Apart from that this condition uses the same way of comparison as hour.

dayofmonth

See "Hour" above. Uses the same syntax!

Syntax:
[dayofmonth = ...]
Comparison:

Day of month, possible values are 1-31.

Apart from that this condition uses the same way of comparison as hour.

dayofyear

See "Hour" above. Uses the same syntax!For further information look at the date() function in the PHP manual, format string z.

Syntax:
[dayofyear = ...]
Comparison:

Day of year, 0-364 (or 365 in leap years). That this condition begins with 0 for the first day of the year means that e.g. [dayofyear = 5] will be true on the 6 th of January.

Apart from that this condition uses the same way of comparison as hour.

usergroup
Syntax:
[usergroup = group1-uid, group2-uid, ...]
Comparison:

This matches on the uid of a usergroup of a logged in frontend user.

The comparison can only return true if the grouplist is not empty (global var "gr_list").

The values must either exist in the grouplist OR the value must be a "*".

Example:

This matches all FE logins:

[usergroup = *]

This matches logins of frontend users, which are members of frontend user groups with uid's 1 and/or 2:

[usergroup = 1,2]
loginUser
Syntax:
[loginUser = fe_users-uid, fe_users-uid, ...]
Comparison:

Matches on the uid of a logged in frontend user. Works like 'usergroup' above including the * wildcard to select ANY user.

Example:

This matches any FE login (use this instead of "[usergroup = *]" to match when a FE user is logged in!):

[loginUser = *]

Additionally it is possible to check if no FE user is logged in.

Example:

This matches when no FE user is logged in:

[loginUser = ]
page
Syntax:
[page|field = value]
Comparison:

This condition checks values of the current page record. While you can achieve the same with TSFE:[field] conditions in the frontend, this condition is usable in both frontend and backend.

Example:

This condition matches, if the layout field is set to 1:

[page|layout = 1]
treeLevel
Syntax:
[treeLevel = levelnumber, levelnumber, ...]
Comparison:

This checks if the last element of the rootLine is at a level corresponding to one of the figures in "treeLevel". Level = 0 is the "root" of a website. Level = 1 is the first menu level.

Example:

This condition matches, if the page viewed is on either level 0 (root) or on level 2

[treeLevel = 0,2]
PIDinRootline
Syntax:
[PIDinRootline = pages-uid, pages-uid, ...]
Comparison:

This checks if one of the figures in "treeLevel" is a PID (pages-uid) in the rootline.

Example:

This condition matches, if the page viewed is or is a subpage to page 34 or page 36

[PIDinRootline = 34,36]
PIDupinRootline
Syntax:
[PIDupinRootline = pages-uid, pages-uid, ...]
Comparison:

Does the same as PIDinRootline, except the current page-uid is excluded from check.

compatVersion
Syntax:
[compatVersion = x.y.z]
Comparison:

Comparison with the compatibility version of the TYPO3 installation.

Require a minimum compatibility version; the condition will match, if the set compatibility version is higher than or equal to x.y.z. The compatibility version is not necessarily equal to the TYPO3 version, which is used. Instead, it is a configurable value that can be changed in the Upgrade Wizard of the Install Tool.

"compatVersion" is especially useful if you want to provide new default settings but keep the backwards compatibility for old versions of TYPO3.

globalVar
Syntax:
[globalVar = var1 = value1, var2 > value2, var3 < value3, var4 <= value4, ...]
Comparison:

The values in floating point are compared to the global variables "var1", "var2" ... from above.

You can use multiple conditions in one by separating them with a comma. The comma then acts as a logical disjunction, that means the whole condition evaluates to true, whenever one or more of its operands are true.

Operator: Function:
= Requires an exact match with the value. Comparison with a list of values is possible as well. The condition then returns true, if the value is in the list. Values must then be separated by "|".
> The var must be greater than the value.
< The var must be less than the value.
<= The var must be less than or equal to the value.
>= The var mast be greater than or equal to the value.
!= The var must be not equal to the value. Comparison with a list of values is possible as well. The condition then returns true, if the value is not in the list. Values must then be separated by "|".
Examples:

This will match, if the page-id is equal to either 10, 12 or 15:

[globalVar = TSFE:id = 10|12|15]

This will match, if the page-id is not equal to 10, 12 and 15:

[globalVar = TSFE:id != 10|12|15]

This will match, if the page-id is higher than or equal to 10:

[globalVar = TSFE:id >= 10]

This will match, if the page-id is not equal to 316:

[globalVar = TSFE:id != 316]

This will match with the pages having the layout field set to "Layout 1":

[globalVar = TSFE:page|layout = 1]

This will match with a URL like "...&print=1":

[globalVar = GP:print > 0]

This will match the non-existing GET/POST variable "style":

[globalVar = GP:style = ]

This will match, if the GET/POST variable "L" equals 8 or the GET/POST variable "M" equals 2 or both:

[globalVar = GP:L = 8, GP:M = 2]

Similar to GP, but with array parts of tx_demo from GET and POST merged before matching:

[globalVar = GPmerged:tx_demo|foo = 1]

This will only check POST parameters:

[globalVar = _POST|tx_myext_pi1|showUid > 0]

This will only check GET parameters:

[globalVar = _GET|tx_myext_pi1|showUid > 0]

If the constant {$constant_to_turnSomethingOn} is "1" then this matches:

[globalVar = LIT:1 = {$constant_to_turnSomethingOn}]

Find out if there currently is a valid backend login:

[globalVar = TSFE:beUserLogin = 1]

This will match only with the backend user with UID 13:

[globalVar = BE_USER|user|uid = 13]
globalString
Syntax:
[globalString = var1=value, var2= *value2, var3= *value3*, ...]
Comparison:

This is a direct match on global strings.

You have the options of putting a "*" as a wildcard or using a PCRE style regular expression (must be wrapped in "/") to the value.

Examples:

If the HTTP_HOST is "www.typo3.org" this will match with:

[globalString = IENV:HTTP_HOST = www.typo3.org]

This will also match with it:

[globalString = IENV:HTTP_HOST = *typo3.org]

... but this will also match with an HTTP_HOST like this: "demo.typo3.org"

If HTTP_REFERER is set to an empty value, this will match with it:

[globalString = IENV:HTTP_REFERER = /^$/]

In contrast this will match with a non-empty value:

[globalString = IENV:HTTP_REFERER = /.+/]
Important note on globalVar and globalString

You can use values from global arrays and objects by dividing the variable name with a "|" (vertical line).

Examples:

The global variable $HTTP_POST_VARS['key']['levels'] would be retrieved by "HTTP_POST_VARS|key|levels".

Also note that it's recommended to program your scripts in compliance with the php.ini-optimized settings. Please see that file (from your distribution) for details.

Caring about this means that you would get values like HTTP_HOST by getenv() and you would retrieve GET/POST values with TYPO3CMSCoreUtilityGeneralUtility::_GP(). Finally a lot of values from the TSFE object are useful. In order to get those values for comparison with "globalVar" and "globalString" conditions, you prefix that variable's name with either "IENV:"/"ENV:", "GP:", "TSFE:" or "LIT:" respectively. Still the "|" divider may be used to separate keys in arrays and/or objects. "LIT" means "literal" and the string after ":" is trimmed and returned as the value (without being divided by "|" or anything)

Note: Using the "IENV:" prefix is highly recommended to get server/environment variables which are system-independent. Basically this will get the value using TYPO3CMSCoreUtilityGeneralUtility::getIndpEnv(). With "ENV:" you get the raw output from getenv() which is not always the same on all systems!

Examples:

This will match with a remote address beginning with "192.168."

[globalString = IENV:REMOTE_ADDR = 192.168.*]

This will match with the frontend user whose username is "test":

[globalString = TSFE:fe_user|user|username = test]
Custom Conditions

You can add own TypoScript conditions via a separate API.

Instead of using the "userFunc" condition, it is encouraged to use this new API for your own TypoScript conditions.

Syntax:
[YourVendor\YourPackage\YourCondition = var1 = value1, var2 != value2, ...]
Comparison:

An extension / package can ship an implementation of the abstract class AbstractCondition. Via the existing TypoScript condition syntax the class is called by the simple full namespaced class name.

The main function matchCondition of this class can then evaluate any parameters given after the class name. The parameters will be given in form of a numeric array, each entry containing the strings that are split by the commas, e.g. array('= var1 = value1', 'var2 != value2').

Examples:

This example shows how to write own TypoScript conditions and how to evaluate their parameters in PHP. With the PHP code following below, these three conditions will match:

[Documentation\Examples\TypoScript\ExampleCondition]
    Your TypoScript code here
[global]

[Documentation\Examples\TypoScript\ExampleCondition TYPO3]
    Your TypoScript code here
[global]

[Documentation\Examples\TypoScript\ExampleCondition = 42]
    Your TypoScript code here
[global]
<?php
namespace Documentation\Examples\TypoScript;

/**
 * Example condition
 */
class ExampleCondition extends \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractCondition {

        /**
         * Evaluate condition
         *
         * @param array $conditionParameters
         * @return bool
         */
        public function matchCondition(array $conditionParameters) {
                $result = FALSE;
                if (empty($conditionParameters)) {
                        $result = TRUE;
                }
                if (!empty($conditionParameters) && $conditionParameters[0] === 'TYPO3') {
                        $result = TRUE;
                }
                if (!empty($conditionParameters) && substr($conditionParameters[0], 0, 1) === '=') {
                        $conditionParameters[0] = trim(substr($conditionParameters[0], 1));
                        if ($conditionParameters[0] == '42') {
                                $result = TRUE;
                        }
                }

                return $result;
        }
}
userFunc
Syntax:
[userFunc = user_function(argument1, argument2, ...)]
Comparison:

This calls a user-defined function (above called "user_function") and passes the provided parameters to that function (e.g. the two parameters "argument1" and "argument2"). Parameters can be enclosed with quotes so that leading and trailing spaces and commas inside a parameter can be used. Quotes can be escaped using the "" character. You write the function; you decide what it checks. The function should return true or false. Otherwise the result is evaluated to true or false.

Examples:

Put the following condition in your TypoScript.

[userFunc = user_match(checkLocalIP, 192.168)]

It will call the function "user_match" with "checkLocalIP" as first argument and "192.168" as second argument. Whether the condition returns true or false depends on what that function returns.

Put this function in your AdditionalConfiguration.php file:

function user_match($command, $subnet) {
        switch($command) {
                case 'checkLocalIP':
                        if (strstr(getenv('REMOTE_ADDR'), $subnet)) {
                                return TRUE;
                        }
                break;
                case 'checkSomethingElse':
                        // ....
                break;
        }
        return FALSE;
}

If the remote address contains "192.168", the condition will return true, otherwise it will return false.

The function in the following condition shows how quotes can be used. It has three arguments:

[userFunc = user_testFunctionWithThreeArgumentsSpaces(1, 2, " 3, 4, 5, 6")]

The function in the next condition also has three arguments and it shows how quotes can be escaped:

[userFunc = user_testFunctionWithThreeArgumentsEscapedQuotes(1, 2, "3, \"4, 5\", 6")]

Functions

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]).

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.

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

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.

filelist

Property

filelist

Data type

dir /stdWrap

Description

Reads a directory and returns a list of file names.

The value is exploded by "|" into parameters:

  1. The path
  2. comma-separated list of allowed extensions (no spaces between); if empty, all extensions are allowed.
  3. sorting: name, size, ext, date, mdate (modification date).
  4. reverse: Set to "r" if you want a reversed sorting.
  5. fullpath_flag: If set, the filelist is returned with complete paths, and not just the filename.

Also see lockFilePath on how to restrict file search.

Example

Find just the names of image files in fileadmin/images, sorted ascending by name:

10 = TEXT
10.filelist = fileadmin/images/ | gif,jpg,jpeg,png | name | 0 | 0

You maybe want to add your own postprocessing to it for further selection:

10.stdWrap.postUserFunc = My\NameSpace\MyClass->findImageForNow

Possible logic in PHP:

class My\NameSpace\MyClass
{

   public function findImageForNow($content, $conf)
   {
      $files = explode(',', $content);
      // $result = ...
      return $result
   }
}
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 using strlen().

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 t3coreapi: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 where a timestamp is imported:

.value.field = tstamp
.value.date =
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 TYPO3CMSCoreCharsetCharsetConverter.

.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

integer /stdWrap

Description

Will format the input (an integer) as bytes: bytes, kb, mb

Available sub-properties:

labels: If you add a value for the property "labels" you can alter the default suffixes. Labels for bytes, kilo, mega and giga are separated by vertical bar (|) and possibly encapsulated in "". E.g.: " | K| M| G" (which is the default value).

base: The base to use for the calculation. Useful values are 1000 or 1024. There are 2 presets defined:

  • iec: uses the Ki, Mi, etc prefixes and binary base (power of two, 1024)
  • si: uses the k, M, etc prefixes and decimal base (power of ten, 1000)

The default formatting is set to "iec" base size calculations. The fractional part, when present, will be two numbers.

Thus:

bytes.labels = " | K| M| G"
bytes.base = 1000
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.
removeBadHTML

Property

removeBadHTML

Data type

boolean /stdWrap

Description

Removes "bad" HTML code based on a pattern that filters away HTML that is considered dangerous for XSS bugs.

Note: The removal, which removeBadHTML does, is not 100% complete. You cannot rely on the processing to remove all potentially bad tags.

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 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.

TCAselectItem

Property

TCAselectItem

Data type

Array of properties /stdWrap

Description

Resolves a comma-separated list of values into the TCA item representation.

.table: String. The Table to look up.

.field: String. The field to resolve.

.delimiter: String. Delimiter for concatenating multiple elements.

Note: Currently this works only with TCA fields of type "select" which are not database relations.

spaceBefore

Property

spaceBefore

Data type

integer /stdWrap

Description

Pixels space before. Done with a clear-gif; <img ...><br>.

spaceAfter

Property

spaceAfter

Data type

integer /stdWrap

Description

Pixels space after. Done with a clear-gif; <img ...><br>.

space

Property

space

Data type

space /stdWrap

Description

[spaceBefore] | [spaceAfter]

Additional property:

.useDiv = 1

If set, a clear gif is not used but rather a <div> tag with a style- attribute setting the height. (Affects spaceBefore and spaceAfter as well).

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 "|").

Example:

noTrimWrap = | val1 | val2 |

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

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 ^ || ^ 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.

[tsref:->stdWrap]

imgResource

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

Property

ext

Data type

imageExtension /stdWrap

Description

Target file extension for the processed image. The option "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 (defined in $TYPO3_CONF_VARS['GFX']['imagefile_ext'] in the Install Tool).

Default

web

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/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.

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

Property

height

Data type

pixels /stdWrap

Description

see ".width"

Property

params

Data type

string /stdWrap

Description

GraphicsMagick/ImageMagick command-line:

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

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

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 resizedly, 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.

Example:

// test.jpg could e.g. have 1600 x 1200 pixels
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" />

Default

0

Property

crop

Data type

string /stdWrap

Description

It is possible to define a area that should be taken (cropped) from the image. When not defined in typoscript the value wil be taken from the file_reference when possible. With this setting you can override this behavior.

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

Default

not-set (when file/image is a file_reference the crop value of the file reference is used)

Property

alternativeTempPath

Data type

string

Description

Enter an alternative path to use for temporary images.

Property

frame

Data type

integer /stdWrap

Description

Chooses the frame in a PDF or GIF file.

"" = first frame (zero)

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

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, e.g. with import.data = levelmedia:....

Default

0

Property

maxW

Data type

pixels /stdWrap

Description

Maximum width

Property

maxH

Data type

pixels /stdWrap

Description

Maximum height

Property

minW

Data type

pixels /stdWrap

Description

Minimum width (overrules maxW/maxH)

Property

minH

Data type

pixels /stdWrap

Description

Minimum height (overrules maxW/maxH)

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.

Example:

10 = IMAGE
10.file = fileadmin/images/image1.jpg
10.file.stripProfile = 1

Default

0

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.

[tsref:->imgResource]

Example:

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

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

imageLinkWrap

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  
Property details
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 ( = 1) then a unique hash value is used as target value for each image. This garantees 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 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 is script 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 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" rel="fancybox{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"
   }
}

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.

Property

table

Data type

Table name

Description

Name of the database table to query.

Property

select

Data type

->select

Description

Select query for the operation.

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

[tsref:->numRows]

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.

Examples

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_ids. 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.

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.

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
   }
}

Default

this

recursive

Property

recursive

Data type

integer /stdWrap

Description

Number of recursivity 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.

Property

token

Data type

string /stdWrap

Description

String or character (token) used to split the value.

Property

max

Data type

integer /stdWrap

Description

Maximum number of splits.

Property

min

Data type

integer /stdWrap

Description

Minimum number of splits.

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.

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
}

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.

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>
}

Property

wrap

Data type

wrap +optionSplit /stdWrap

Description

Defines a wrap for each item.

[tsref:->split]

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

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.

Property

search

Data type

string /stdWrap

Description

Defines the string that shall be replaced.

Property

replace

Data type

string /stdWrap

Description

Defines the string to be used for the replacement.

Property

useRegExp

Data type

boolean /stdWrap

Description

Defines that the search and replace strings are considered as PCRE regular expressions.

Example:

10 {
  search = #(a )CAT#i
  replace = \1cat
  useRegExp = 1
}

Default

0

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

[tsref:->replacement]

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!"

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.

Also check the explanations and the examples further below!

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.

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.

Property

isTrue

Data type

string /stdWrap

Description

If the content is "true".... (not empty string and not zero)

Property

isFalse

Data type

string /stdWrap

Description

If the content is "false"... (empty or zero)

Property

isPositive

Data type

integer /stdWrap + calc

Description

Returns false, if the content is not positive.

Property

isGreaterThan

Data type

value /stdWrap

Description

Returns false, if the content is not greater than ".value".

Property

isLessThan

Data type

value /stdWrap

Description

Returns false, if the content is not less than ".value".

Property

equals

Data type

value /stdWrap

Description

Returns false, if the content does not equal ".value".

Property

isInList

Data type

value /stdWrap

Description

Returns false, if the content is not 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.

Property

value

Data type

value /stdWrap

Description

The value to check. This is the comparison value mentioned above.

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

[tsref:->if]

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 cObjects 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
}

In the next example the querystring parameter is used as a condition: A typolink or the link of a menu item links back to the default language (&L=0), if the currently active language ID is greater than 2. This is useful for example if only languages 0 to 2 are available in the target page.

additionalParams = &L=0
additionalParams.if.value = 2
additionalParams.if.isGreaterThan.data = GP:L

encapsLines

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>

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.)

Property

addAttributes.[tagname]

Data type

(array of strings)

Description

Attributes to set in the encapsulation tag.

Example:

addAttributes.P {
  style=padding-bottom: 0px; margin-top: 1px; margin-bottom: 1px;
  align=center
}

([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 is to always override/set the value of the attributes.

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>

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>

Property

innerStdWrap_all

Data type

->stdWrap

Description

Wraps the content inside all lines, whether they are encapsulated or not.

Property

encapsLinesStdWrap.[tagname]

Data type

->stdWrap

Description

Wraps the content inside all encapsulated lines.

([tagname] is in uppercase.)

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

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.

[tsref:->encapsLines]

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.

addParams

Adds parameters to an HTML tag.

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

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.

[tsref:->addParams]

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.

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.

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

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)

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

[tsref:->strPad]

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.==".

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.

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

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

[tsref:->round]

Examples:
lib.number = TEXT
lib.number {
  value = 3.14159
  stdWrap.round.roundType = round
  stdWrap.round.decimals = 2
}

This returns 3.14.

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.

Property

decimals

Data type

integer /stdWrap

Description

Number of decimals the formatted number will have. Defaults to 0, so that your input will in that case be rounded up or down to the next integer.

Default

0

Property

dec_point

Data type

string /stdWrap

Description

Character that divides the decimals from the rest of the number. Defaults to ".".

Default

.

Property

thousands_sep

Data type

string /stdWrap

Description

Character that divides the thousands of the number. Defaults to ","; set an empty value to have no thousands separator.

Default

,

[tsref:->numberFormat]

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".

parseFunc

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

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;"
  }
}

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.

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>
}

Property

plainTextStdWrap

Data type

->stdWrap

Description

This is stdWrap properties for all non-tag content.

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_"

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).

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).

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>

Property

makelinks

Data type

boolean / ->makelinks

Description

Convert web addresses prefixed with "http://" and mail addresses prefixed with "mailto:" to links.

Property

tags

Data type

->tags

Description

Here you can define custom tags that will parse the content to something.

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!

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 = *

Property

if

Data type

->if

Description

if "if" returns false, the input value is not parsed, but returned directly.

[tsref:->parseFunc]

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
    }
  }
}

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.

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>.

[tsref:->tags]

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
}

HTMLparser

Property

allowTags

Data type

list of tags

Description

Default allowed tags

Property

stripEmptyTags

Data type

boolean

Description

Passes the content to PHPs strip_tags().

Property

stripEmptyTags.keepTags

Data type

string

Description

Comma separated list of tags to keep when applying strip_tags().

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.

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

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"

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

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.

Property

removeTags

Data type

(ibid)

Description

List of tags (among the already set tags), which will be configured so they are surely removed.

Property

keepNonMatchedTags

Data type

boolean / "protect"

Description

If set (true=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!

Property

htmlSpecialChars

Data type

-1 / 0 / 1 / 2

Description

This regards all content which is not tags:

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.

-1: Does the opposite of "1". It converts &lt; to <, &gt; to >, &quot; to " etc.

[page:->HTMLparser; tsref:->HTMLparser]

HTMLparser_tags

Property

overrideAttribs

Data type

string

Description

If set, this string is preset as the attributes of the tag.

Property

allowedAttribs

Data type

mixed

Description

Defines the allowed attributes.

Possible values:

0 (zero): No attributes allowed.

(comma-separated list of attributes): Only attributes in this list are allowed.

(blank/not set): All attributes are allowed.

Property

fixAttrib.[attribute].set

Data type

string

Description

Force the attribute value to this value.

Property

fixAttrib.[attribute].unset

Data type

boolean

Description

If set, the attribute is unset.

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)

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.

Property

fixAttrib.[attribute].range

Data type

[low],[high]

Description

Setting integer range.

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.

Property

fixAttrib.[attribute].removeIfFalse

Data type

boolean/"blank" string

Description

If set, then the attribute is removed if it is "false". If this value is set to "blank" then the value must be a blank string (that means a "zero" value will not be removed)

Property

fixAttrib.[attribute].removeIfEquals

Data type

string

Description

If the attribute value matches the value set here, then it is removed.

Property

fixAttrib.[attribute].casesensitiveComp

Data type

boolean

Description

If set, the comparison in .removeIfEquals and .list will be case- sensitive. At this point, it's insensitive.

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.

If the value is "1" you will get the absolute path (TYPO3CMSCoreUtilityGeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')).

If the value is "2" you will get the relative path (stripping of TYPO3CMSCoreUtilityGeneralUtility::getIndpEnv('TYPO3_SITE_URL')).

Example:

...fixAttrib.href.prefixLocalAnchors = 1

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/

Property

fixAttrib.[attribute].userFunc

Data type

function reference

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 = tx_realurl->test_urlProc

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:

  • attributeValue: The original value of the processed attribute
  • myCustomParm: myCustomValue

Property

protect

Data type

boolean

Description

If set, the tag <> is converted to &lt; and &gt;

Property

remap

Data type

string

Description

If set, the tagname is remapped to this tagname

Property

rmTagIfNoAttrib

Data type

boolean

Description

If set, then the tag is removed if no attributes happened to be there.

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>'

[page:->HTMLparser_tags; tsref:->HTMLparser_tags]

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.

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.

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

Property

tags

Data type

string /stdWrap

Description

Can hold a comma-separated list of tags. These tags will be attached to the cached content into the cache_hash storage (not into cache_pages) and can be used to purge the cached content.

[tsref:->cache]

Examples:
5 = TEXT
5 {
  stdWrap.cache.key = mycurrenttimestamp
  stdWrap.cache.tags = tag_a,tag_b,tag_c
  stdWrap.cache.lifetime = 3600
  stdWrap.data = date : U
  stdWrap.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}
  stdWrap.cache.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.

Setup

Top-level objects

Properties
Property Data Type stdWrap Default
((abc ...?)) ->PAGE    
((bcd ...?)) (whatever)    
config ->CONFIG    
constants ->CONSTANTS    
FEData ->FE_DATA    
Other reserved TLO's: (whatever)    
resources readonly    
sitetitle readonly    
types readonly    
Property details
((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 the "CONTENT" cObject.

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).

FEData

Property

FEData

Data type

->FE_DATA

Description

Here you can configure how data submitted from the front-end should be processed, which script and so on.

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 or 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
Property Data Type stdWrap Default
userFunc (array of keys)    
_CSS_DEFAULT_STYLE string /stdWrap    
_CSS_PAGE_STYLE string    
_DEFAULT_PI_VARS.[piVar-key] string /stdWrap    
_LOCAL_LANG.[lang-key].[label-key] string    
Property details
userFunc

Property

userFunc

Data type

(array of keys)

Description

Property setting up the USER / 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  
beLoginLinkIPList [IP-number]  
beLoginLinkIPList_login HTML code  
beLoginLinkIPList_logout HTML code  
cache array  
cache_clearAtMidnight boolean false
cache_period integer 86400 (= 24 hours)
compensateFieldWidth double  
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  
lockFilePath string fileadmin/
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
pageGenScript resource typo3/sysext/frontend/Classes/Page/PageGenerator.php
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  
setJS_mouseOver boolean  
setJS_openPic 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_softExclude string  
`sys\_language\_softMergeIfNotBlank`_ string  
sys_language_uid integer  
titleTagFunction function name  
tx_[extension key with no underscores]_[*] -  
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  
Property details
absRefPrefix

Property

absRefPrefix

Data type

string

Description

If this value is set, then all relative links in TypoScript are prepended with this string.

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/
    

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.

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.

replace: Optional. If set, previous headers with the same name are replaced with the current one. Default is "1".

httpResponseCode: Optional. HTTP status code as an integer.

Example:

config.additionalHeaders {
   10 {
      # The header string
      header = WWW-Authenticate: Negotiate

      # 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
}

By default TYPO3 sends a "Content-Type" header with the defined encoding, unless this is disabled using config.disableCharsetHeader (see above). It then sends cache headers, if configured (see above). Then come the additional headers, plus finally a "Content-Length" header, if enabled (see below).

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/
beLoginLinkIPList

Property

beLoginLinkIPList

Data type

[IP-number]

Description

If set and REMOTE_ADDR matches one of the listed IP-numbers (Wild- card, *, allowed) then a link to the typo3/ login script with redirect pointing back to the page is shown.

Note: beLoginLinkIPList_login and/or beLoginLinkIPList_logout (see below) must be defined if the link should show up!

beLoginLinkIPList_login

Property

beLoginLinkIPList_login

Data type

HTML

Description

HTML code wrapped with the login link, see 'beLoginLinkIPList'

Example:

<hr /><b>LOGIN</b>
beLoginLinkIPList_logout

Property

beLoginLinkIPList_logout

Data type

HTML

Description

HTML code wrapped with the logout link, see above

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.

compensateFieldWidth

Property

compensateFieldWidth

Data type

double

Description

This floating point value will be used by the FORMS cObject to compensate the length of the form fields text and input.

This option may be overridden by the property of the same name in the FORMS cObject.

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 $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.

Example:

config.compressCss = 1

Note: TYPO3 comes with a built-in compression handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'].

Example:

$GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'] =
   TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/class.tx_myext_cssCompressHandler.php:tx_myext_cssCompressHandler->compressCss';
compressJs

Property

compressJs

Data type

boolean

Default

0

Description

Enabling this option together with $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 $TYPO3_CONF_VARS['FE']['compressionLevel'] in the Install Tool.

Example:

config.compressJs = 1

Note: TYPO3 comes with a built-in compression handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'].

Example:

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'] =
   TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/class.tx_myext_jsCompressHandler.php:tx_myext_jsCompressHandler->compressJs';
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.

Example:

config.concatenateCss = 1

Note: TYPO3 comes with a built-in concatenation handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['cssConcatenateHandler'].

Example:

$GLOBALS['TYPO3_CONF_VARS']['FE']['cssConcatenateHandler'] =
   TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/class.tx_myext_cssConcatenateHandler.php:tx_myext_cssConcatenateHandler->concatenateCss';
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.

Example:

config.concatenateJs = 1

Note: TYPO3 comes with a built-in concatenation handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['jsConcatenateHandler'].

Example:

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsConcatenateHandler'] =
   TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/class.tx_myext_jsConcatenateHandler.php:tx_myext_jsConcatenateHandler->concatenateJs';
concatenateJsAndCss

Property

concatenateJsAndCss

Data type

boolean

Default

0

Description

Setting config.concatenateJsAndCss bundles JS and CSS files in the FE.

Example:

config.concatenateJsAndCss = 1

Note: TYPO3 comes with a built-in concatenation handler, but you can also register your own one using $GLOBALS['TYPO3_CONF_VARS']['FE']['concatenateHandler'].

Example:

$GLOBALS['TYPO3_CONF_VARS']['FE']['concatenateHandler'] =
   TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) .
   'Classes/class.tx_myext_concatenateHandler.php:tx_myext_concatenateHandler->concatenateFiles';

Note: This property was deprecated and is planned to be removed! Use config.concatenateJs and config.concatenateCss instead.

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 somwhere 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.

Keywords: mountpoint

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.

Usage

# 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

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.

debug

Property

debug

Data type

boolean

Description

If set any debug-information in the TypoScript code is output. This applies e.g. to menu objects and the parsetime output.

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 text.var1

Example:

config.defaultGetVars {
    test.var1.var2.p3 = 15
    L = 3
}
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, bodyTagMargins 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 lanuage.

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_frames for the XHTML 1.0 Frameset 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 comfig.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 config.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 "config.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 stdWrap.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 "config.language" (above) 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)

Example:

config.linkVars = L, print

This will add "&L=[L-value]&print=[print-value]" to all links in TYPO3.

config.linkVars = L(1-3), print

Same as above, but "&L=[L-value]" will only be added if the current value is 1, 2 or 3.

Note: Do not include the "type" parameter in the linkVars list, as this can result in unexpected behavior.

locale_all

Property

locale_all

Data type

string

Description

PHP: 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/

TSFE->localeCharset is intelligently set to the assumed charset of the locale strings. This is used in stdWrap.strftime to convert locale strings to the UTF-8 of the frontend.

Example:

This will render dates in danish made with stdWrap/strftime:

locale_all = danish
locale_all = da_DK

Note

It is possible to supply a comma-separated list of locales as a fallback chain

lockFilePath

Property

lockFilePath

Data type

string

Default

fileadmin/

Description

This value affects the functionality of filelist which is part of the stdWrap suite.

Set lockFilePath to the relative path of a folder. filelist will only return values for a folder that starts with the path given by lockFilePath.

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.

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.

pageGenScript

Property

pageGenScript

Data type

resource

Default

typo3/sysext/frontend/Classes/Page/PageGenerator.php

Description

Alternative page generation script for applications using \TYPO3\CMS\Frontend\Http\RequestHandler for initialization, caching, stating and so on. This script is included in the global scope of \TYPO3\CMS\Frontend\Http\RequestHandler and thus you may include libraries here. Always use include_once for libraries.

Remember not to output anything from such an included script. All content must be set into $TSFE->content. Take a look at typo3/sysext/frontend/Classes/Page/PageGenerator.php.

Note: This option is ignored if

['FE']['noPHPscriptInclude'] => 1;

is set in LocalConfiguration.php.

pageRendererTemplateFile

Property

pageRendererTemplateFile

Data type

string

Default

EXT:core/Resources/Private/Templates/PageRenderer.html

Description

Sets the template for page renderer class TYPO3CMSCorePagePageRenderer.

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 config.titleTagFunction and config.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" below.

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_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

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.

setJS_mouseOver

Property

setJS_mouseOver

Data type

boolean

Description

If set, the over() and out() JavaScript functions are forced to be included

setJS_openPic

Property

setJS_openPic

Data type

boolean

Description

If set, the openPic JavaScript function is forced to be included

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 config.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

[globalVar = GP:L = 1]
   # ISO code is filled by the respective DB value from sys_language (uid 1)
   config.sys_language_uid = 1

   # You can override this of course
   config.sys_language_isocode = fr

[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 $GLOBALS['TSFE']->sys_language_content.

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 $GLOBALS['TSFE']->sys_language_content and $GLOBALS['TSFE']->sys_language_uid 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 $GLOBALS['TSFE']->sys_language_content is set to the value of $GLOBALS['TSFE']->sys_language_uid.

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 $TSFE->sys_language_content > 0. Internally it sets the property $TSFE->sys_language_contentOL 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 $TSFE->sys_language_content. 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_softExclude

Property

sys_language_softExclude

Data type

string

Description

Setting additional "exclude" flags for l10n_mode in TCA for frontend rendering.

Fields set in this property will override if the same field is set for "sys_language_softMergeIfNotBlank".

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 $GLOBALS['TSFE']->sys_language_uid property. The $GLOBALS['TSFE']->sys_language_content property is set based on the value of the sys_language_uid and other settings like sys_language_mode.

It is usually set to the value of the &L request parameter, using a TypoScript condition like in this example:

config.sys_language_uid = 0

[globalVar = GP:L = 1]
   config.sys_language_uid = 1
[GLOBAL]
[globalVar = GP:L = 2]
   config.sys_language_uid = 2
[GLOBAL]
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

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
typolinkCheckRootline

Property

typolinkCheckRootline

Data type

boolean

Description

If set, then every "typolink" is checked whether it's linking to a page within the current rootline of the site.

If not, then TYPO3 searches for the first found domain record (without redirect) in that rootline from out to in.

If found (another domain), then that domain is prepended the link, the external target is used instead and thus the link jumps to the page in the correct domain.

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 (config.sys_language_XXX directives)

- all domains have the same set of languages defined

This option implies "config.typolinkCheckRootline=1", which will be activated automatically. Setting value of "config. typolinkCheckRootline" inside TS template will have no effect.

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 config.doctype is set to a string then config.xhtmlDoctype must be set to one of these keywords:

xhtml_trans for XHTML 1.0 Transitional doctype.

xhtml_frames for XHTML 1.0 Frameset doctype.

xhtml_strict for XHTML 1.0 Strict doctype.

xhtml_basic for XHTML basic doctype.

xhtml_11 for XHTML 1.1 doctype.

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}. For these constants see the according chapter in "TypoScript Syntax and In-depth Study".

Properties
Property Data Type stdWrap Default
(array of keys) string    
Property details
(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.

See ->parseFunc.

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    
bodyTagMargins integer    
config ->CONFIG    
CSS_inlineStyle string    
cssInline ->CARRAY    
footerData ->CARRAY    
frameSet ->FRAMESET    
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)    
insertClassesFromRTE boolean    
javascriptLibs (array of strings)    
jsFooterInline ->CARRAY    
jsInline ->CARRAY    
meta ->META    
shortcutIcon resource    
stdWrap stdWrap    
stylesheet resource    
typeNum integer   0
wrap wrap    
Property details
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>

Description

Body tag on the page

Example:

<body bgcolor="{$bgCol}">

Default

<body>

bodyTagAdd

Property

bodyTagAdd

Data type

string

Description

This content is added to the end of the bodyTag.

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 "config.disableBodyTag", which - if set - disables body tag generation independently from what might be set here.

bodyTagMargins

Property

bodyTagMargins

Data type

integer

Description

margins in the body tag.

Property:

.useCSS = 1 (boolean) - will set a "BODY {margin: ...}" line in the in-document style declaration - for XHTML compliance.

Example:

bodyTagMargins = 4

This adds leftmargin="4" topmargin="4" marginwidth="4" marginheight="4" to the bodyTag.

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).

frameSet

Property

frameSet

Data type

->FRAMESET

Description

if any properties is set to this property, the page is made into a frameset.

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

Description

Head-tag if alternatives are wanted

Default

<head>

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>

.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 "http://..."), 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 = http://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 "http://..."), 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.

.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 "http://..."), 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.

.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.

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"}};
insertClassesFromRTE

Property

insertClassesFromRTE

Data type

boolean

Description

If set, the classes for the Rich Text Editor configured in Page TSconfig are inserted as the first thing in the Style-section right after the setting of the stylesheet.

.add_mainStyleOverrideDefs: [* / list of tags ]. Will add all the "RTE.default. mainStyleOverride_add" - tags configured as well.

Note: Instead of using this property, most likely the RTE should be configured by stylesheets!

javascriptLibs

Property

javascriptLibs

Data type

(array of strings)

Description

This allows to include the JavaScript libraries that are shipped with the TYPO3 Core.

javascriptLibs {
   # include jQuery (boolean)
   jQuery = 1
   # Change the version
   # (possible values: latest|1.7.2|…, default: latest)
   # Note: jQuery.source has to be a CDN like "google"
   # when jQuery.version is not "latest"
   jQuery.version = latest
   # Include from local or different CDNs
   # (possible values: local|google|jquery|msn, default: local)
   jQuery.source = local
   # Set jQuery into its own scope to avoid conflicts (boolean)
   jQuery.noConflict = 1
   # Change the namespace when noConflict is activated
   # and use jQuery with "TYPO3.###NAMESPACE###(…);"
   # (string, default: jQuery)
   jQuery.noConflict.namespace = ownNamespace
}
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

Example:

page.jsInline {
        10 = TEXT
        10.stdWrap.dataWrap = var pageId = {TSFE:id};
}

Note:

With config.removeDefaultJS = external, the inline JavaScript is moved to an external file.

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.

stylesheet

Property

stylesheet

Data type

resource

Description

Inserts a stylesheet in the <HEAD>-section of the page;

<link rel="stylesheet" href="[resource]">

typeNum

Property

typeNum

Data type

integer

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)!

Default

0

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-property is available:

httpEquivalent:
If set to 1, the http-equiv attribute is used in the meta tag instead of the name attribute. Default: 0.
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 (cObject)

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>

CLEARGIF

Note

This content object has been deprecated in TYPO3 CMS 7.1. If you still use it for now, you need to install the extension "compatibility6". In the long run, you are advised to migrate to alternatives such as FLUIDTEMPLATE to customize the output of the content.

Inserts a transparent gif-file.

Property

height

Data type

<img>-data:height /stdWrap

Description

Height of the image.

Default

1

Property

width

Data type

<img>-data:width /stdWrap

Description

Width of the image.

Default

1

Property

wrap

Data type

wrap /stdWrap

Default

|<br />

Property

stdWrap

Data type

->stdWrap

Description

(Executed after ".wrap".)

[tsref:(cObject).CLEARGIF]

Example:
20 = CLEARGIF
20.height = 20

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.

COLUMNS

Note

This content object has been deprecated in TYPO3 CMS 7.1. If you still use it for now, you need to install the extension "compatibility6". In the long run, you are advised to migrate to alternatives such as FLUIDTEMPLATE to customize the output of the content.

Inserts a table with several columns. Size and styling of the table tag can be defined with the according options.

Property

tableParams

Data type

<TABLE>-params /stdWrap

Description

Attributes of the table tag.

Default

border="0" cellspacing="0" cellpadding="0"

Property

TDparams

Data type

<TD>-params /stdWrap

Description

Attributes of the td tags.

Default

valign="top"

Property

rows

Data type

integer (Range: 2-20) /stdWrap

Description

The number of rows in the columns.

Default

2

Property

totalWidth

Data type

integer /stdWrap

Description

The total-width of the columns+gaps.

Property

gapWidth

Data type

integer /stdWrap +optionSplit

Description

Width of the gap between columns.

0 = no gap

Property

gapBgCol

Data type

HTML-color /stdWrap +optionSplit

Description

Background-color for the gap-tablecells.

Property

gapLineThickness

Data type

integer /stdWrap +optionSplit

Description

Thickness of the divider line in the gap between cells.

0 = no line

Property

gapLineCol

Data type

HTML-color /stdWrap +optionSplit

Description

Line color of the divider line.

Default

black

Property

[column-number]

1,2,3,4...

Data type

cObject

Description

This is the content object for each column.

Property

after

Data type

cObject

Description

This is a cObject placed after the columns-table.

Property

if

Data type

->if

Description

If "if" returns false, the columns are not rendered!

Property

stdWrap

Data type

->stdWrap

[tsref:(cObject).COLUMNS]

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 source code for TYPO3 \ CMS \ Frontend \ Controller \ TypoScriptFrontendController \ ContentContentObject.

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
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.

Default
< [table name]
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.
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.

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 {
   # ...
}

CTABLE

Note

This content object has been deprecated in TYPO3 CMS 7.1. If you still use it for now, you need to install the extension "compatibility6". In the long run, you are advised to migrate to alternatives such as FLUIDTEMPLATE to customize the output of the content.

Creates a table in which you can define the content of the various cells.

A CTABLE is a little more feature packed than the simple OTABLE. It features a content column and four surrounding columns, which may be useful for putting menus into them.

Property

offset

Data type

x,y /stdWrap

Description

Offset from upper left corner.

Default

0,0

Property

tm

Data type

->CARRAY +TDParams /stdWrap

Description

TopMenu

The default value of TDParams is: valign="top".

stdWrap is available for the property TDParams.

Property

lm

Data type

->CARRAY +TDParams /stdWrap

Description

LeftMenu

The default value of TDParams is: valign="top".

stdWrap is available for the property TDParams.

Property

rm

Data type

->CARRAY +TDParams /stdWrap

Description

RightMenu

The default value of TDParams is: valign="top".

stdWrap is available for the property TDParams.

Property

bm

Data type

->CARRAY +TDParams /stdWrap

Description

BottomMenu

The default value of TDParams is: valign="top".

stdWrap is available for the property TDParams.

Property

c

Data type

->CARRAY +TDParams /stdWrap

Description

Content-cell

The default value of TDParams is: valign="top".

stdWrap is available for the property TDParams.

Property

cMargins

Data type

margins /stdWrap

Description

Distance around the content-cell "c".

Default

0,0,0,0

Property

cWidth

Data type

pixels /stdWrap

Description

Width of the content-cell "c".

Property

tableParams

Data type

<TABLE>-params /stdWrap

Description

Attributes of the table tag.

Default

border="0" cellspacing="0" cellpadding="0"

Property

stdWrap

Data type

->stdWrap

[tsref:(cObject).CTABLE]

Example:
page.10 = CTABLE
page.10 {
  offset = 5, 0
  tableParams = style="border-width: 0px; width: 400px;"
  cWidth = 400
  c.1 = CONTENT
  c.1.table = tt_content
  c.1.select {
    pidInList = this
    orderBy = sorting
  }

  tm.10 < temp.sidemenu
  tm.TDParams = style="vertical-align: top;"

  stdWrap.wrap = <div id="mytable">|</div>
}

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 Admin Panel be displayed (config.admPanel = 1) and that the user has checked the "Display Edit Icons" option. Whenever the edit panel is inserted, page caching is disabled.

The edit panel inserts icons for moving, editing, deleting, hiding and creating records.

In conjunction with css_styled_content, an EDITPANEL will appear for each content element on the page. It is also possible to insert an EDITPANEL as cObject in the template, using TypoScript.

Note

The extension "feedit" needs to be installed for this to work.

Property

label

Data type

string /stdWrap

Description

Title for the panel. You can insert the record title with %s

Example:

label = Section <b>%s</b>

Property

allow

Data type

string

Description

Define which functions are accessible. Further this comma-separated list may be reduced, if the BE_USER does not have permission to perform the action.

Values should be listed separated by comma. These are the options you can choose from:

  • toolbar: is a list of icons regarding the page, so use this for page records only.
  • edit: edit element.
  • new: create new element.
  • delete: delete element.
  • move: move element.
  • hide: hide element.

Property

newRecordFromTable

Data type

string

Description

Will display a panel for creation of new element (in the top of list) on the page from that table.

Property

newRecordInPid

Data type

integer

Description

Define a page ID where new records (except new pages) will be created.

Property

line

Data type

boolean / integer

Description

If set, a black line will appear after the panel. This value will indicate the distance from the black line to the panel.

Property

edit.displayRecord

Data type

boolean

Description

If set, then the record edited is displayed above the editing form.

Property

onlyCurrentPid

Data type

boolean

Description

If set, only records with a pid matching the current id (TSFE->id) will be shown with the panel.

Property

innerWrap

Data type

wrap /stdWrap

Description

Wraps the edit panel.

Property

outerWrap

Data type

wrap /stdWrap

Description

Wraps the whole edit panel including the black line (if configured).

Property

printBeforeContent

Data type

boolean

Description

Normally the edit panel is displayed below the content element it belongs to. If this option is set, the panel is printed in front of the according element.

Example:

tt_content.stdWrap.editPanel.printBeforeContent = 1

This displays the edit panels in front of the according elements, if you use css_styled_content.

Default

0

Property

previewBorder

Data type

boolean / integer

Description

If set, the hidden/starttime/endtime/fe_user elements which are previewed will have a border around them.

The integer value denotes the thickness of the border.

Property

previewBorder.innerWrap

previewBorder.outerWrap

previewBorder.color

Data type

wrap / HTML color

Description

innerWrap: Wraps the content elements (including the icons) inside the preview border (an HTML table).

outerWrap: Wraps the whole content element including the border.

color: Denotes the color of the border.

Property

stdWrap

Data type

->stdWrap

[tsref:(cObject).EDITPANEL]

Example:
page = PAGE
page.10 = EDITPANEL
page.10 {
  ...
}

Here the edit panel is inserted as a cObject. In such a case, there is nothing to edit in the FE, but the panel can be used to create new records, for example.

FILE

This object returns the content of the file specified in the property "file".

It is defined as PHP function fileResource() in typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php.

Note: Do not mix this up with the cObject FILES; both are different cObjects.

Property

file

Data type

resource /stdWrap

Description

The file whose content should be returned.

If the resource is jpg, jpeg, gif or png the image is inserted as an image-tag. All other formats are read and inserted into the HTML code.

The maximum filesize of documents to be read is set to 1024 KB internally!

Property

linkWrap

Data type

linkWrap /stdWrap

Description

(Executed before ".wrap" and ".stdWrap".)

Property

wrap

Data type

wrap /stdWrap

Description

(Executed after ".linkWrap" and before ".stdWrap".)

Property

stdWrap

Data type

->stdWrap

Description

(Executed after ".linkWrap" and ".wrap".)

Property

altText

titleText

Data type

string /stdWrap

Description

For <img> output only!

If no alttext is specified, it will use an empty alttext.