TypoScript Explained

Version

main

Language

en

Author

TYPO3 contributors

License

This document is published under the Open Publication License.

Rendered

Thu, 16 Jan 2025 22:30:49 +0000


This document is a complete reference of all object types and properties of TypoScript as used in frontend TypoScript and backend TypoScript, also called TSconfig.

You can find a quick guide to TypoScript configuration at Getting started: A quick introduction into TypoScript and explanations of TypoScript syntax in the "TypoScript Syntax" chapter.


Table of Contents:

TypoScript Explained

Version

main

Language

en

Author

TYPO3 contributors

License

This document is published under the Open Publication License.

Rendered

Thu, 16 Jan 2025 22:30:49 +0000


This document is a complete reference of all object types and properties of TypoScript as used in frontend TypoScript and backend TypoScript, also called TSconfig.

You can find a quick guide to TypoScript configuration at Getting started: A quick introduction into TypoScript and explanations of TypoScript syntax in the "TypoScript Syntax" chapter.


Table of Contents:

Introduction into TypoScript

TypoScript is a configuration language used to configure both the frontend output and the backend of a a TYPO3 web site.

TypoScript is not a programming language but a means of configuring the website.

Frontend TypoScript

Frontend TypoScript is mainly used to configure which data should be send to the Fluid templates.

It can also be used to define settings send to Extbase plugins, metadata for a whole page etc.

In the beginning of TYPO3, TypoScript was used as templating language. In modern project it is not common to do that anymore.

For an introduction see Getting started: A quick introduction into TypoScript.

Backend TypoScript / TSconfig

Backend TypoScript, also called TSconfig, can be used to configure the output of certain forms etc in the TYPO3 backend.

Page TSconfig

Page TSconfig can be made available globally, on a per site or per page level.

For the possibilities see the Page TSconfig Reference.

User TSconfig

User TSconfig can be made available globally for certain user groups or certain users. It cannot be set for just one site or page. It can however override Page TSconfig.

For the possibilities see the User TSconfig reference.

TypoScript - A quick overview

This introduction is designed to give you a comprehensive understanding of how TypoScript works. In other words the goal is not to just help you make it work, but to make sure that you end up knowing why and how it works.

At the end of this tutorial, you will not have a complete TYPO3 CMS-powered website, but you should feel confident about how to get there.

A common workflow used by beginners is to try arbitrary properties on objects until things somehow begin to work. However understanding how TypoScript really works allows you to proceed more efficiently and waste less time in painful trial and error.

Going through this tutorial is helpful for understanding other tutorials, like the Site package tutorial.

Backend configuration

TypoScript influences many aspects of a TYPO3 site:

TypoScript can be used in the TSconfig field of a backend user or a backend user group or in the TSconfig field of a page. It will then change the look and behavior of forms in the backend.

The frontend rendering in contrast is defined by the TypoScript used in TypoScript records. This document covers only frontend rendering.

Prerequisites

It is assumed that you have a running TYPO3 installation. See TYPO3 Getting Started Tutorial, installing TYPO3 with DDEV.

and that you have been through the TYPO3 - Getting Started Tutorial in order to have a general idea of how the TYPO3 CMS backend operates.

A few more elements that you need to know before starting:

  • all content elements are stored in a database table called tt_content
  • each content element has a database field called CType in which the type of the content element is stored
  • the tt_content table also has a field called pid which refers to the page the content element is on
  • in general, each TYPO3 CMS table has a field called uid which contains the primary key (unique id for each record)
  • you will probably find useful to have a database access to check how information is stored as we proceed along this tutorial

Why TypoScript?

Strictly speaking, TypoScript is a configuration language. We cannot program with it, but can configure a TYPO3 CMS website in a very comprehensive way. With TypoScript, we define the rendering of the website, including navigation, generic content, and how individual content elements are rendered on a page.

TYPO3 CMS is a content management system that clearly separates content and design. TypoScript is the glue that joins these two together again. TypoScript reads content which is stored in the database, prepares it for display and then renders it in the frontend.

To render a website, we only need to define what content to display and how it will be rendered.

  • The "what" is controlled by the backend - where pages and content are generated.
  • The "how" is controlled by TypoScript.

With TypoScript, we can define how the individual content elements are rendered in the frontend. For example, we can use TypoScript to add a <div> tag to an element, or the <h1> tag to a headline.

The main TypoScript record

The TypoScript code used to define how pages are rendered is located in the "main" TypoScript record. In this record a so-called "rootlevel flag" is set.

The Rootlevel flag in the tab Options a template record

The Rootlevel flag in the tab Options a template record

When the frontend renders a page, TYPO3 CMS searches along the page tree up to the root page to find a "main" TypoScript record. Normally, there are additional TypoScript records besides the "main" TypoScript record. For now, we will assume we are only using the "main" TypoScript record.

TypoScript syntax is very straightforward. On the left side, objects and properties are defined. On the right side are the assigned values. Both objects and properties can contain other objects. Object properties are defined by using the dot "." notation.

The following is a typical example of TypoScript syntax:

page = PAGE
page.10 = TEXT
page.10.value = Hello World
Copied!

The term "template"

Sometimes the term "template" is used as a synonym for the TypoScript record or the combined TypoScript configuration from all sources. This has historic reasons. Until TYPO3 v11 TypoScript could be edited in a backend module called "Template". In the beginning of TYPO3 sites were build almost exclusively with TypoScript while it slowly evolved to be mainly a configuration language.

As a Fluid template is also called "template" the terms took on a double meaning in TYPO3. With TYPO3 v12 we speak about TypoScript records, TypoScript files and the complete TypoScript configuration. However you will still find the outdated term "TypoScript template" or just "template" in places.

Troubleshooting

Common mistakes made in the TypoScript configuration can cause a message like this:

Error message "No TypoScript record found!"

If you turn on the debug mode you will get more detailed information:

Error message "No TypoScript record found!"

No TypoScript record found!: This warning appears if no TypoScript record, with the root level flag enabled, is found in the page tree.

Error message "The page is not configured!"

The page is not configured! [type=0][]. This means that there is no TypoScript object of type PAGE with typeNum=0 configured.: This warning appears if the TypoScript Configuration of the current page contains no :ref:PAGE <guide-page>` definition.

The following TypoScript setup code is enough to remove this warning:

page = PAGE
page.10 = TEXT
page.10.value = Hello World
Copied!

Do not worry about this code for now, it will be explained later.

TypoScript is just an array

Internally, TypoScript is parsed and stored as a PHP array. For example:

page = PAGE
page.10 = TEXT
page.10.value = Hello World
page.10.stdWrap.wrap = <h2>|</h2>
Copied!

will be converted to the following PHP array:

<?php

$data = [
    'page' => 'PAGE',
    'page.' => [
        '10' => 'TEXT',
        '10.' => [
            'value' => 'Hello World',
            'stdWrap.' => [
                'wrap' => '<h2>|</h2>',
            ],
        ],
    ],
];
Copied!

Upon evaluation, a "PAGE" object will be created first, and the parameter $data['page.'] will be assigned to it. The "PAGE" object will then search for all properties, which it knows about. In this case, it will find a numeric entry ("10"), which has to be evaluated. A new object of type "TEXT" with the parameter $data['page.']['10.'] will be created. The "TEXT" object knows the parameters value and stdWrap. It will set the content of value accordingly. The parameters from stdWrap will be passed to the "stdWrap" function. There the property 'wrap' is known, and the text "Hello world" will be inserted at the pipe (|) position and returned.

It is important to be aware of this relationship in order to understand the behaviour of TypoScript. For example, if the above TypoScript is extended with the following line:

page.10.myFunction = Magic!
Copied!

the following entry will be added to the PHP array:

$data['page.']['10.']['myFunction'] = 'Magic!';
Copied!

However, the "TEXT" object does not know any property called "myFunction". Consequently, the entry will have no effect.

First steps

The basic rendering is defined in the "Setup" field of the main TypoScript record.

TypoScript essentially consists of objects, which have certain properties. Some of these properties can accept other objects, others stand for functions or simple values.

The PAGE object is responsible for the rendering of a website page in the frontend:

# The object page is defined as PAGE object.
page = PAGE

# PAGE objects have the property typeNum.
page.typeNum = 0

# page has an object "10" of type TEXT. It is a TEXT object.
page.10 = TEXT

# TEXT objects in turn have a property called "value".
page.10.value = Hello World
Copied!

The PAGE object on the one hand offers numerous named properties (like typeNum). On the other hand it also has an endless number of numbered objects (a so-called content array). The names of these objects only consist of numbers and the objects are sorted accordingly when they are rendered, from the smallest number to the largest. The order of the lines in the TypoScript record is irrelevant:

# Create a PAGE object.
page = PAGE
page.typeNum = 0

page.30 = TEXT
page.30.value = This gets rendered last.

# Rendering will first output object number 10, then 20 and 30.
# An object with number 25 would logically be output between 20 and 30.
page.20 = TEXT
page.20.value = This is rendered in the middle.

# This is the first output object
page.10 = TEXT
page.10.value = This is rendered first.

# Here we create a second PAGE object, which we can use for the
# print view.
print = PAGE
print.typeNum = 98
print.10 = TEXT
print.10.value = This is the print version.
Copied!

Every entry is stored in a multidimensional PHP array. Every object and every property, therefore, is unique. We could define an arbitrary number of PAGE objects; however, the typeNum has to be unique. For every typeNum, there can be only one PAGE object.

In the example, for the parameter typeNum = 98, a different output mode is created. By using typeNum, various output types can be defined. If typeNum is not set explicitly, it defaults to "0". Typically, typeNum = 0 is used for the HTML output.

When a page is requested with just index.php?id=1, typeNum = 0 will be assumed and the output will be HTML. To get the print output, the request will have to pass a "type" attribute, i.e. index.php?id=1&type=98.

It is thus possible to generate many different outputs depending on one's needs (XML, JSON, PDF, etc.). TypoScript configuration can be copied between those various views, changing only what's specific for each of them.

The previous example would look like this as a PHP array:

<?php

$TypoScript['page'] = 'PAGE';
$TypoScript['page.']['typeNum'] = 0;
$TypoScript['page.']['10'] = 'TEXT';
$TypoScript['page.']['10.']['value'] = 'This is rendered first.';
$TypoScript['page.']['20'] = 'TEXT';
$TypoScript['page.']['20.']['value'] = 'This is rendered in the middle.';
$TypoScript['page.']['30'] = 'TEXT';
$TypoScript['page.']['30.']['value'] = 'This gets rendered last.';

$TypoScript['print'] = 'PAGE';
$TypoScript['print.']['typeNum'] = 98;
$TypoScript['print.']['10'] = 'TEXT';
$TypoScript['print.']['10.']['value'] = 'This is the print version.';
Copied!

Empty spaces at the start and end of values are removed by TYPO3 CMS automatically (using the PHP trim() function).

The = sign corresponds to a simple assignment. Here is an overview of the various operators:

# The object test is an object of type TEXT.
# "=" means "set value".
test = TEXT
test.value = Holla

# "<" means "copy object".
# page.10 returns "Holla"
page.10 < test

# Change the original object.
# The change has no effect on page.10; it still returns "Holla".
test.value = Hello world

# "=<" means "create an object reference (link the object)".
test.value = Holla
page.10 =< test

# Change the object which is referenced.
# Changes DO have an effect on page.10.
# page.10 will return "Hello world".
test.value = Hello world
Copied!

Object types are always written with capital letters; parameters and functions typically in camel case (first word lower case, next word starts with a capital letter, no space between words). There are some exceptions to this.

With the . as a separator parameter, functions and child objects are referenced and can be assigned values accordingly:

page.10.stdWrap.wrap = <h1>|</h1>
Copied!

The TypoScript Reference (TSref) is the ultimate resource to find out which objects, functions and properties exist.

Things can get more complicated when objects are nested inside each other and many properties are used:

page = PAGE
page.typeNum = 0
page.10 = TEXT
page.10.value = Hello world
page.10.stdWrap.typolink.parameter = http://www.typo3.org/
page.10.stdWrap.typolink.additionalParams = &parameter=value

# The function name "ATagParams" does not use the standardized
# "camelCase".
page.10.stdWrap.typolink.ATagParams = class="externalwebsite"
page.10.stdWrap.typolink.extTarget = _blank
page.10.stdWrap.typolink.title = The website of TYPO3
page.10.stdWrap.postCObject = TEXT
page.10.stdWrap.postCObject.value = This text also appears in the link text
page.10.stdWrap.postCObject.stdWrap.wrap = |, because the postCObject is executed before the typolink function.
Copied!

To make things clearer, TypoScript code can be structured using curly braces ({}) at each nesting level:

page = PAGE
page {
  typeNum = 0

  10 = TEXT
  10 {
    value = Hello world
    stdWrap {
      typolink {
        parameter = http://www.typo3.org/
        additionalParams = &parameter=value

        # The function name "ATagParams" does not use the standardized
        # "camelCase".
        ATagParams = class="externalwebsite"

        extTarget = _blank
        title = The website of TYPO3
      }

      postCObject = TEXT
      postCObject {
        value = This text also appears in the link text
        stdWrap.wrap (
                  |, because the postCObject is executed before the typolink function.
        )
      }
    }
  }
}
Copied!

Parenthesis (()) are used for writing text values on more than one line.

Using this style of notation reduces the danger of typographic errors and makes the script easier to read. In addition it reduces the repetition of variable names making it easier to rename an object.

The full reference for the syntax is found in the TypoScript Syntax and In-depth Study.

Configure the PAGE in TypoScript

A TypoScript object of type PAGE is needed to display anything in the frontend of TYPO3.

The PAGE object is used to define a certain view of the content that was entered in the backend.

To display an HTML representation of your content usually a Fluid template is used to define the output of the HTML body while the PAGE object can additionally define meta data for the HTML head or even the HTTP response.

By default the top level variable page is used to define the main PAGE object. The following would display the empty skeleton of an HTML page:

page = PAGE
Copied!

If this line is missing, you get the error message "No page configured for type=0.".

See also Troubleshooting.

Displaying the page body with TypoScript

Numeral indexes on the PAGE object are used to output the actual content of the page. Many integrators like to use the index 10.

As we already saw in section First steps, the following code outputs "Hello World!":

TypoScript setup
page = PAGE
page {
  10 = TEXT
  10.value = Hello World!
}
Copied!

In a more common use case you want to load the page content from a Fluid template:

TypoScript setup
page = 10
page {
  10 = PAGEVIEW
  10 {
    paths {
      100 = EXT:my_site_package/Resources/Private/PageView/
    }
    dataProcessing {
      10 = page-content
    }
  }
}
Copied!

You need at least a Minimal site package (see site package tutorial) to keep your templates in its private resources folder, for example /packages/site_package/Resources/Private/Templates:

/packages/site_package/Resources/Private/Templates/Pages/Default.html
<main>
    <p>Hello World!</p>
</main>
Copied!

Loading CSS in TypoScript

You can write inline CSS using property cssInline.[array], or place your CSS file in the public resources of your Minimal site package:

TypoScript setup
page = PAGE
page {
  10 = TEXT
  10.value = <div class="myTodo">TODO: Add Fluid template </div>
  cssInline {
    10 = TEXT
    10.value (
      .myTodo {
        border: 2px solid #ee7600;
      }
    )
  }
  includeCSS {
    styles = EXT:site_package/Resources/Public/Css/styles.css
  }
}
Copied!

Loading JavaScript in TypoScript

You can write inline JavaScript using property jsFooterInline.[array], or place your JavaScript file in the public resources of your Minimal site package:

TypoScript setup
page = PAGE
page {
  10 = TEXT
  10.value = <div class="myTodo">TODO: Add Fluid template </div>
  jsFooterInline {
    10 = TEXT
    10.value (
      alert("Hello World! ");
    )
  }
  includeCSS {
    includeJSFooter = EXT:site_package/Resources/Public/JavaScript/main.js
  }
}
Copied!

Favicon / shortcut icon definition in the TypoScript PAGE

Use property shortcutIcon to define the favicon:

TypoScript setup
page = PAGE
page {
  shortcutIcon = EXT:site_package/Ressources/Public/Icons/favicon.ico
  10 = TEXT
  10.value = TODO: Add Fluid template
}
Copied!

You need to have a Minimal site package (see site package tutorial) and put the favicon file in the public resources folder of that site package. If you followed the instruction from the site package tutorial that would be path /packages/site_package/Resources/Public/Icons.

Tracking code: Add content to the end of your page

You can use the property footerData.[array] to enter some HTML code just before the closing </body> tag:

TypoScript setup
page = PAGE
page {
  10 = TEXT
  10.value = TODO: Add Fluid template
  footerData {
    10 = TEXT
    10.value (
      <!-- Enter some tracking code supplied by your provider -->
      <p>My tracking code</p>
    )
  }
}
Copied!

Reading content records

Obviously entering all content for the website would be terribly tiresome, although possible from a theoretical point of view.

What we want is to have a TypoScript which gathers the content automatically. The example below creates a page on which, for each content element on that page, the headline and the text is displayed.

After creating the PAGE object, we use the CONTENT object to retrieve content from the database. For each content element we use the TEXT object to perform the actual rendering:

page = PAGE
page.typeNum = 0

# The CONTENT object executes a database query and loads the content.
page.10 = CONTENT
page.10.table = tt_content
page.10.select {

  # "sorting" is a column from the tt_content table and
  # keeps track of the sorting order, which was specified in
  # the backend.
  orderBy = sorting

  # Only select content from column "0" (the column called
  # "normal") and quote the database identifier (column name)
  # "colPos" (indicated by wrapping with {#})
  where = {#colPos}=0
}

# For every result line from the database query (that means for every content
# element) the renderObj is executed and the internal data array is filled
# with the content. This ensures that we can call the .field property and we
# get the according value.
page.10.renderObj = COA
page.10.renderObj {

  10 = TEXT

  # The field tt_content.header normally holds the headline.
  10.stdWrap.field = header

  10.stdWrap.wrap = <h1>|</h1>

  20 = TEXT

  # The field tt_content.bodytext holds the content text.
  20.stdWrap.field = bodytext

  20.stdWrap.wrap = <p>|</p>
}
Copied!

The CONTENT object executes an SQL query on the database. The query is controlled by the select property, which - in our case - defines that we want all records from the column 0 (which is the column called "NORMAL" in the backend), and that the result should be sorted according to the field called "sorting".

The select property has a pidInList which can be used to retrieve elements from a specific page. If it is not defined - as in our example - elements are taken from the current page.

The renderObj property defines how each record gets rendered. It is defined as COA (Content Object Array), which can hold an arbitrary number of TypoScript objects. In this case, two TEXT objects are used, which are rendered one after the other (remember that the order of the rendering is not controlled by the order in TypoScript, but by the numbers with which they are defined). The TEXT object "10" will be created first and the TEXT object "20" will be rendered after it.

The challenge is to render all content elements like the web designer predetermined. Therefore, we have to create TypoScript definitions for every single database field (e.g. for images, image size, image position, link to top, index, etc.).

Insert content in a HTML template

Although we now know how to render content, we do not have a real website yet.

Again everything could be done using TypoScript. That would be pretty complex and error prone. Furthermore if a HTML template file is prepared by a designer for the website, it would be a shame not to reuse it as is as much as possible. It would also make further corrections to the HTML template much harder to apply.

TYPO3 CMS provides the FLUIDTEMPLATE object, with which we can use Fluid template and render our website with it:

10 = FLUIDTEMPLATE
10 {
  templateName = Default

  templateRootPaths {
    0 = EXT:site_package/Resources/Private/Templates/Pages/
  }
  partialRootPaths {
    0 = EXT:site_package/Resources/Private/Partials/Pages/
  }
  layoutRootPaths {
    0 = EXT:site_package/Resources/Private/Layouts/Pages/
  }
}
Copied!

In your template file you can now replace the parts that should be filled by TYPO3 with references to the TypoScript configuration objects you defined earlier.

For example to render a template with the menu we defined add:

<nav>
    <f:cObject typoscriptObjectPath="lib.textmenu" />
</nav>

<div class="container">
    <f:cObject typoscriptObjectPath="lib.dynamicContent" data="{pageUid: '{data.uid}', colPos: '0'}" />
</div>
Copied!

The various content elements

The setup we just defined is pretty basic and will work only for content elements containing text. But the content elements are varied and we also need to render images, forms, etc. and we do not want to define everything in TypoScript - using HTML templates would be more convenient.

The type of a content element is stored in the column CType of table "tt_content". We can use this information with a CASE object, which makes it possible to differentiate how the individual content element types are rendered.

The following code is the default TypoScript rendering definition as taken from the TYPO3 Core. The default renderObj of a table is a TypoScript definition named after that table. In case of content in TYPO3 the table is called tt_content therefore the default renderObj is also called tt_content:

Content element rendering taken from typo3/sysext/frontend/ext_localconf.php
tt_content = CASE
tt_content {
  key {
    # The field CType will be used to differentiate.
    field = CType
  }
  # Render a error message in case no specific rendering definition is found
  default = TEXT
  default {
    field = CType
    htmlSpecialChars = 1
    wrap = <p style="background-color: yellow; padding: 0.5em 1em;"><strong>ERROR:</strong> Content Element with uid "{field:uid}" and type "|" has no rendering definition!</p>
    wrap.insertData = 1
  }
}
Copied!

The basic extension for rendering content in TYPO3 since TYPO3 v8 is fluid_styled_content. The example shows how fluid_styled_content is set up: It defines a basic content element based on the content object FLUIDTEMPLATE which is able to render html templates using the Fluid templating engine. For every content element, the basic template, layout and partial parts are defined. As you can see by looking at the lines starting with 10 = there is the possibility to add your own templates by setting the corresponding constant (in the Constants section of a TypoScript record):

Taken from typo3/sysext/fluid_styled_content/Configuration/TypoScript/Helper/ContentElement.typoscript
lib.contentElement = FLUIDTEMPLATE
lib.contentElement {
  templateName = Default
  templateRootPaths {
    0 = EXT:fluid_styled_content/Resources/Private/Templates/
    10 = {$styles.templates.templateRootPath}
  }
  partialRootPaths {
    0 = EXT:fluid_styled_content/Resources/Private/Partials/
    10 = {$styles.templates.partialRootPath}
  }
  layoutRootPaths {
    0 = EXT:fluid_styled_content/Resources/Private/Layouts/
    10 = {$styles.templates.layoutRootPath}
  }
  # ...
}
Copied!

Each content element inherits that configuration. As an example take a look at the content element definition of the content element of type header:

Taken from typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Header.typoscript
# Header Only:
# Adds a header only.
#
# CType: header
tt_content.header =< lib.contentElement
tt_content.header {
  templateName = Header
}
Copied!

First, all configuration options defined in lib.contentElement are referenced. Then the templateName for rendering a content element of type header is set - in this case Header. This tells fluid to look for a Header.html in the defined template path(s) (see above, by default in EXT:fluid_styled_content/Resources/Private/Templates/).

To adjust how the default elements are rendered you can overwrite the templates in your own site package extension and set the TypoScript constants defining the paths (see above). In your own templates you have the data of the currently rendered content element available in the {data} fluid variable. For example take a look at how the text element is rendered:

Taken from typo3/sysext/fluid_styled_content/Resources/Private/Templates/Text.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">
    <f:format.html>{data.bodytext}</f:format.html>
</f:section>
</html>
Copied!

The database field bodytext from the tt_content table (which is the main text input field for content elements of type text) is available as {data.bodytext} in the Fluid template. For more information about fluid_styled_content see its manual.

Create a menu with TypoScript

Until now, we learned how the page content is rendered; however, the page navigation is missing.

TYPO3 provides a special data processor, the menu data processor to pass data to render a menu to the Fluid template.

Configure the data processor in TypoScript:

TypoScript Setup
page = PAGE
page {
  10 = PAGEVIEW
  10 {
    paths.10 = EXT:my_site_package/Resources/Private/Templates/Pages/
    # ...
    dataProcessing {
      10 = menu
      10.as = myMainMenu
    }
  }
}
Copied!

And render the menu in your Fluid template. You need at least a Minimal site package (see site package tutorial) to keep your templates in its private resources folder, for example /packages/site_package/Resources/Private/Templates:

/packages/site_package/Resources/Private/Templates/Pages/Default.html
<header>
    <ul class="navbar-nav">
        <f:for each="{myMainMenu}" as="menuItem">
            <li class="nav-item">
                <a class="nav-link {f:if(condition: menuItem.active, then:'active')}"
                   href="{menuItem.link}"
                   target="{menuItem.target}"
                   title="{menuItem.title}"
                >
                    {menuItem.title}
                </a>
            </li>
        </f:for>
    </ul>
</header>
<main>
    <p>Hello World!</p>
</main>
Copied!

Find more examples on how to configure and render menus with TypoScript and Fluid in chapter Main menu of the Site Package Tutorial.

You can find more examples on how to output menus of different styles, including multi-level menus, breadcrumbs, language menus, and sitemaps in the chapter about the menu data processor.

Using fluid_styled_content

It is worth taking a deeper look at the TypoScript of the system extension typo3/cms-fluid-styled-content . It comes with more than 900 lines of TypoScript code containing definitions for each type of content element.

Although it may seem daunting, it is very instructive to review all this code, as there is much to learn by example. To view the raw code, place yourself on the root page of your website and move to the Site Management > TypoScript module. Then choose the submodule Included TypoScript from the drop-down.

You should see a list of all used TypoScript records and files and how they possibly include one another. All TypoScript is evaluated by TYPO3 CMS from top to bottom.

Screenshot of the module Site Management > TypoScript > Included TypoScript

Click on the { }, "show code", button to see the code

With a click on the { }, "show code", button, you can view the content of that TypoScript file.

As the TypoScript is split up in several files you can also use the { + }, "show resolved code", button to show the code including all its includes.

You will see that the set set:typo3/fluid-styled-content adds rendering definitions for all content elements. When rendering special content like file relations or menus the concept of data processors is used. You can find out more about data processors in the manual of fluid_styled_content.

HTML purists may find that the set set:typo3/fluid-styled-content generates too much markup.

It is perfectly possible to trim down this setup or write one's own entirely. However this is not recommended for beginners.

TypoScript objects

As we already saw there is quite a variety of TypoScript objects. Each object has a number of properties. These can be simple data types or functions, which have their own set of properties. Using properties that don't exist will have no effect.

The TypoScript Reference lists all data types, functions and objects with their properties. This chapter offers a short overview of the most common objects to give you an idea of what is available.

Some most common objects:

Objects executing database queries

  • CONTENT can be used to access arbitrary tables of TYPO3 CMS internals. This does not only include table "tt_content", but extension tables can also be referenced. The select function makes it possible to generate complex SQL queries.
  • RECORDS can be used to reference specific data records. This is very helpful if the same text has to be present on all pages. By using RECORDS, a single content element can be defined and shown. Thus, an editor can edit the content without having to copy the element repetitively. This object is also used by the content element type "Insert records".

    In the following example, the email address from an address record is rendered and linked as email at the same time:

    page.80 = RECORDS
    page.80 {
      source = 1
      tables = tt_address
      conf.tt_address = COA
      conf.tt_address {
        20 = TEXT
        20.stdWrap.field = email
        20.stdWrap.typolink.parameter.field = email
      }
    }
    
    Copied!
  • HMENU imports the page tree and offers comfortable ways to generate a menu of pages or a sitemap. Special menus include the breadcrumb trail, simple list of pages or subpages, a page browser (providing "Previous" and "Next" buttons for a set of pages) and a language selector.

Objects rendering content

  • IMAGE for the rendering of an image:

    lib.logo = IMAGE
    lib.logo {
      file = fileadmin/logo.gif
      file.width = 200
      stdWrap.typolink.parameter = 1
    }
    
    Copied!

    The result is an image based on file logo.gif with width of 200 pixels and a link to the page 1.

  • TEXT is for the rendering of standard text or the content of fields:

    lib.slogan = TEXT
    lib.slogan.value = Inspiring people to share
    lib.slogan.wrap = <div class="highlight">|</div>
    
    Copied!
  • FILES is used to retrieve information about one or more files and perform some rendering with it:

    lib.banner = FILES
    lib.banner {
      references {
        table = pages
        fieldName = media
        uid.data = page:uid
      }
      renderObj = IMAGE
      renderObj {
        file.import.data = file:current:uid
        file.treatIdAsReference = 1
        file.width = 500
        wrap = <div class="banner">|</div>
      }
    }
    
    Copied!

    This code will probably look pretty abstract to you right now. What it does is to reference the images that were related to a given page in the "media" field. It takes each of these images and resizes them to a maximum width of 500 pixels. Each image is wrapped in a <div> tag.

  • FLUIDTEMPLATE renders a template with the template engine Fluid with variables and data that you define - as previously discussed in the "Insert content in a HTML template" chapter.

Further objects

  • CASE allows case differentiation. In the core this object is used for rendering different content elements according to their type.
  • COA (content object array) allows us to combine an arbitrary number of objects.
  • COA_INT is a COA object, but non-cached. This element will be regenerated upon each call. This is useful with time and date or user-dependent data, for example.
  • LOAD_REGISTER / RESTORE_REGISTER objects allow us to fill the global array $GLOBALS['TSFE']->register[] with content. These objects return nothing. Single values and complete TypoScript objects can be used. In doing so, the register works as a stack: With every call, a further element is stacked. With RESTORE_REGISTER, the element on top can be removed. Values in the register can be used with the getText data type.
  • USER and USER_INT are for user-defined functions. Every frontend plugin from a TYPO3 CMS extension is such an object. USER_INT is the non-cached variant.
  • IMG_RESOURCE is used by the IMAGE object. The resource returned is normally the src attribute of the <img> tag. If images are scaled, this object serves as a calculation basis for the new files, which are stored in the _processed_ folder of each file storage.
  • GIFBUILDER is used for generating image files dynamically. Various texts and images can be combined, and much more.

TypoScript functions

TypoScript functions can be considered as a set of common properties. Whenever an object has a property corresponding to a given function, you are assured to have that set of properties available.

This chapter gives you a brief overview of the most common functions available in TypoScript. See chapter Functions for a complete list.

The most used function is the "standard wrap", usually known as "stdWrap".

Using stdWrap correctly

The stdWrap function is one of the most powerful and most widely used of all TypoScript. Most properties actually support stdWrap turning each of them into some kind of Swiss army knife.

stdWrap is very rich, having itself a large number of properties. This chapter is intended to give you a feel for stdWrap so that you may get familiar with it and be ready to explore it in greater depth using the TypoScript Reference.

Details of stdWrap

Heed the order

The single most important thing to know about stdWrap is that all properties are parsed/executed exactly in the order in which they appear in the TypoScript Reference, no matter in which order you have set them in your TypoScript record.

Let's consider this example:

10 = TEXT
10 {
  value = typo3
  noTrimWrap = |<strong>Tool: |</strong>|
  case = upper
}
Copied!

It results in the following:

<strong>Tool: TYPO3</strong>
Copied!

The case property is executed before the noTrimWrap property. Hence only "typo3" was changed to uppercase and not the "Tool:" with which it is wrapped.

Modify the order

There is a way around this ordering restriction. stdWrap has a property called orderedStdWrap in which several stdWrap properties can be called in numerical order. Thus:

10 = TEXT
10 {
  value = typo3
  orderedStdWrap {
    10.noTrimWrap = |<strong>Tool: |</strong>|
    20.case = upper
  }
}
Copied!

results in:

<strong>TOOL: TYPO3</strong>
Copied!

because we explicitly specified that noTrimWrap should happen before case.

It should be noted that stdWrap itself has a stdWrap property, meaning that it can be called recursively. In most case orderedStdWrap will do the job and is much easier to understand making code easier to maintain.

The data type

While writing TypoScript, it is crucial to know what kind of data type you are handling. It is common to see beginners try to combine functions arbitrarily, until the anticipated result is finally achieved by accident.

The TypoScript reference is very clear about which properties exist and what their data type is, so please refer to that essential resource while writing your TypoScript configuration.

cObject

The stdWrap property "cObject" can be used to replace the content with a TypoScript object. This can be a COA, a plugin or a text like in this example:

10.typolink.title.cObject = TEXT
10.typolink.title.cObject {
  value = Copyright
  case = upper
}
Copied!

Using the getText data type

There's one particular data type which might leave you wondering, because it may seem to behave rather like a function. This is getText.

The data property of stdWrap has this particular data type. It makes it possible retrieve values from a large number of sources, including:

  • global TYPO3 CMS arrays
  • GET/POST vars
  • database
  • localized strings
  • page rootline

Here are some examples:

10 = TEXT
10.data = field:abstract
Copied!

Creates a text object that contains the value of the "abstract" field from the current page:

10 = TEXT
10.data = leveltitle:0
Copied!

Creates a text object that contains the title of the page on level 0 of the current branch, i.e. the website root for that branch:

10 = TEXT
10.data = LLL:EXT:myext/Resources/Private/Language/locallang.xlf:siteTitle
Copied!

Creates a text object that contains the value of the "siteTitle" string in the given localization, appropriately translated for the current language.

As you can see, the base syntax is a keyword, then a colon (:) and then some values that makes with regards to the chosen keyword. Although such a tool may appear to be a function, it is not considered one as it is entirely defined on the right side of the assignment and is thus not a property of any given TypoScript object.

This is just a very quick overview. As usual, the TypoScript Reference is your friend.

imgResource

The imgResource function relates to modifications of pictures. Its main usage is the property file of the IMAGE object.

This, for example, allows an image to be resized:

temp.myImage = IMAGE
temp.myImage {
  file = toplogo.gif
  file.width = 200
  file.height = 300
}
Copied!

It is also possible to set minimum or maximum dimensions:

temp.myImage = IMAGE
temp.myImage {
  file = toplogo.gif

  # maximum size
  file.maxW = 200
  file.maxH = 300

  # minimum size
  file.minW = 100
  file.minH = 120
}
Copied!

imgResource also provides direct access to ImageMagick/GraphicsMagick features:

temp.myImage = IMAGE
temp.myImage {
  file = toplogo.gif
  file.params = -rotate 90
}
Copied!

select

The select function generates a SQL SELECT query, which is used to read records from the database. select automatically checks whether the records might be "hidden", "deleted", or if they have a "start and end date". If pidInList is used (meaning a list of pages is rendered), the function also checks if the current user is allowed to see all records.

With the help of the select function, it is possible to show the content of a page on all pages. For example:

temp.leftContent = CONTENT
temp.leftContent {

  table = tt_content
  select {

    # The page with ID = 123 is the source.
    pidInList = 123

    # Sorting is the same as in the backend.
    orderBy = sorting

    # Only select the content of the left column.
    where = {#colPos}=1

    # Define the field with the language ID in tt_content.
    languageField = sys_language_uid
  }
}

# Replace the mark ###LEFT### with the output of temp.leftContent.
marks.LEFT < temp.leftContent
Copied!

split

The split function can be used to split given data at a predefined character and process the single pieces afterwards. At every iteration, the current index key SPLIT-COUNT is stored (starting with 0).

By using split, we could, for example, read a table field and wrap every single line with a certain code (e.g. generate an HTML table, which can be used to show the same content on more than one page):

20 = TEXT

# The content of the field "bodytext" is imported (from $cObj->data-array).
20.stdWrap.field = bodytext
20.stdWrap.split {

  # The separation character is defined (char = 10 is the newline character).
  token.char = 10

  # We define which element will be used.
  # By using optionSplit we can distinguish between elements.
  # Corresponding elements with the numbers must be defined!
  # For rendering, the numbers 1 and 2 are used in alternation.
  # In this example, the classes "odd" and "even" are used so we
  # can zebra style a table.
  cObjNum = |*|1||2|*|

  # The first element is defined (which is referenced by cObjNum).
  # The content is imported using stdWrap->current.
  1.current = 1

  # The element is wrapped.
  1.wrap = <tr class="odd"><td> | </td></tr>

  # The 2nd element is determined and wrapped.
  2.current = 1
  2.wrap = <tr class="even"><td> | </td></tr>
}

# A general wrap to create a valid table markup.
20.stdWrap.wrap = <table> | </table>
Copied!

if

The if function is perhaps the most difficult of all TypoScript functions. It does not work like the "if" construct known from most programming language and is thus very open to misuse. Hopefully the examples below will help you get it right.

Generally the if function returns true, if all conditions are fulfilled. This resembles a boolean AND combination. If what we would like returned is a false value, we can use the negate option to negate the result:

10 = TEXT
10 {

  # Content of the TEXT object.
  value = The L parameter is passed as GET variable.

  # Results in "true" and leads to rendering of the upper value, if the
  # GET/POST parameter is passed with a value, which is not 0.
  stdWrap.if.isTrue.data = GP:L
}
Copied!

With the use of if it is also possible to compare values. For this purpose we use value property:

10 = TEXT
10 {

  # WARNING: This value resembles the value of the TEXT object, not that of the "if"!
  value = 3 is bigger than 2.

  # Compare parameter of the "if" function.
  stdWrap.if.value = 2

  # Please note: The sorting order is "backwards",
  # returning the sentence "3 is bigger than 2".
  stdWrap.if.isGreaterThan = 3
}
Copied!

Because the properties of the if function implement stdWrap functions, all kinds of variables can be compared:

10 = TEXT
10 {
  # Value of the TEXT object.
  value = The record can be shown, because the starting date has passed.

  # Condition of the if clause (number of seconds since January 1st, 1970).
  stdWrap.if.value.data = date:U

  # Condition backwards again: Start time isLessThan date:U.
  stdWrap.if.isLessThan.field = starttime
}
Copied!

parseFunc

This function parses the main part of the content, i.e., the content which has been entered in the Rich Text Editor. The function is responsible for the fact that the content is not rendered exactly as it was entered in the RTE. Some default parsing rules are implemented in the core, like parsing link tags via typolink function.

You can also use parseFunc for your own processing. In the following example, every occurrence of "COMP" is replaced by "My company name":

page.stdWrap.parseFunc.short {
  COMP = My company name
}
Copied!

The various possibilities of changing the default behavior can be found by using the TypoScript object browser. All possibilities of how parseFunc can alter the rendering can be found in the TypoScript Reference.

Next steps

Armed with this basic knowledge of TypoScript, you may want to continue your exploration of TYPO3 CMS by following the Sitepackage Tutorial, which will guide you through the creation of a whole website template using TypoScript.

To learn more about the structure and syntax of TypoScript, you can refer to the TypoScript Syntax and In-depth Study reference.

Finally - as was mentioned again and again throughout this tutorial - the ultimate resource about TypoScript objects, functions and data types is the TypoScript Reference.

Using and setting TypoScript

See Introduction into TypoScript for an introduction to TypoScript and Templating.

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

The TypoScript template configuration can be viewed and edited in the Site Management > TypoScript module.

TypoScript provider for sites and sets

New in version 13.1

TYPO3 sites have been enhanced to be able to operate as a TypoScript template provider.

By design, a site TypoScript provider always defines a new scope (root-flag) and does not inherit from parent sites (for example, sites up in the root line). This behavior is not configurable by design, as TypoScript code sharing is intended to be implemented via sharable sets.

Note that sys_template records will still be loaded, but they are optional, and applied after the TypoScript provided by the site.

TypoScript dependencies can be included via set dependencies. The TypoScript definitions included via sets are automatically ordered and deduplicated.

Site as a TypoScript provider

The files setup.typoscript and constants.typoscript (placed next to the site's config.yaml file) will be loaded as TypoScript setup and constants, if available. See also Site handling.

Site dependencies (sets) will be loaded first, that means setup and constants can be overridden on a per-site basis.

Example: A site that depends on a sitepackage

The following site configuration depends on a site set provided by a sitepackage extension.

config/sites/my-site/config.yaml
base: 'http://example.com/'
rootPageId: 1
dependencies:
  - myvendor/my-sitepackage
Copied!

You can place TypoScript constants or setup in files of that name in the same folder like the site configuration:

config/sites/my-site/setup.typoscript
page.headerData {
    50 = TEXT
    50.value = <!-- This is only displayed in the header of site example.org -->
}
Copied!

Same goes for TypoScript constants:

config/sites/my-site/constants.typoscript
page.trackingCode = 123456
Copied!

Set as a TypoScript provider

Set-defined TypoScript can be shipped within a set. The files setup.typoscript and constants.typoscript (placed next to the config.yaml file of the set) will be loaded, if available. They are inserted into the TypoScript chain of the site TypoScript that will be defined by a site that is using sets.

Set constants will always be overruled by site settings. Since site settings always provide a default value, a TypoScript constant will always be overruled by a defined setting. This can be used to provide backward compatibility with TYPO3 v12 in extensions, where constants shall be used in v12, while v13 will always prefer defined site settings.

TypoScript dependencies dependencies to TypoScript in other extensions or other sets are to be included via site sets.

Dependencies are included recursively. Sets are automatically ordered and deduplicated. That means TypoScript will not be loaded multiple times, if a shared dependency is required by multiple sets.

Example: The set of a sitepackage

The following set of a sitepackage depends on the TypoScript and other settings of EXT:fluid_styled_content and EXT:felogin:

EXT:my_sitepackage/Configuration/Sets/MySitepackage/config.yaml
name: myvendor/my-sitepackage
label: My sitepackage set

# Load TypoScript, TSconfig and settings from dependencies
dependencies:
  - typo3/fluid-styled-content
  - typo3/felogin
Copied!

The set can be included as a dependency by other sets or a site configuration.

The set can include further TypoScript constants or setup. It can use @import statements to import TypoScript from another location:

EXT:my_sitepackage/Configuration/Sets/MySitepackage/constants.typoscript
@import 'EXT:my_sitepackage/Configuration/TypoScript/Constants'
Copied!
EXT:my_sitepackage/Configuration/Sets/MySitepackage/setup.typoscript
@import 'EXT:my_sitepackage/Configuration/TypoScript/Setup'
Copied!

Importing TypoScript already contained in other sets should be avoided in favour of using a set dependency.

Provide frontend TypoScript in a TYPO3 extension

Changed in version 13.1

TypoScript on a per-site basis can now be included via sites and sets.

Provide TypoScript in your extension or site package

TypoScript files must have the ending .typoscript.

They are located in Configuration/Sets/MySet within your extension. Read more about how to provide the TypoScript as set for TYPO3 v13 and above and how to provide TypoScript for both TYPO3 v13 and v12.

  • constants.typoscript contains the frontend TypoScript constants
  • setup.typoscript contains the frontend TypoScript

TypoScript provided as site set (only TYPO3 v13.1 and above)

The file structure of the extension could, for example look like this:

With the extension's TypoScript residing in EXT:my_extension/Configuration/Sets/MyExtension and the TypoScript for some optional feature in EXT:my_extension/Configuration/Sets/MyExtensionWithACoolFeature. Let us assume, that the optional feature depends on the main TypoScript.

The sets can now be defined for TYPO3 v13 as follows:

The main set of the extension

EXT:my_extension/Configuration/Sets/MyExtension/config.yaml
name: myvendor/my-extension
label: My Extension, main set
Copied!

The sub set for an optional feature

EXT:my_extension/Configuration/Sets/MyExtensionWithACoolFeature/config.yaml
name: myvendor/my-extension-with-a-cool-feature
label: Set for a cool feature

# This feature depends on the TypoScript and settings of the main set
dependencies:
  - myvendor/my-extension
Copied!

Overriding the TypoScript

The TypoScript provided in the site set will be loaded exactly once and respect the dependencies defined in the site set configuration. Therefore if you have to override the frontend TypoScript of another site set your site set should depend on the other site set:

packages/my_site_package/Configuration/Sets/MySitePackage/config.yaml
name: my-vendor/my-site-package
label: My Set
dependencies:
  - my-vendor/my-other-set
  - some-vendor/some-extension
Copied!

Your extension can then safely override frontend TypoScript of the some_extension, for example:

packages/my_site_package/Configuration/Sets/MySitePackage/setup.typoscript
plugin.some_extension_pi1.settings.someSetting = Special setting
Copied!

Supporting both site sets and TypoScript records

Changed in version 13.1

With TYPO3 13.1 site sets as TypoScript provider where introduced. Existing extensions should support site sets as well as TypoScript records for backward compatibility reasons.

One TypoScript include set

If your extension supported one static file include you should provide the same files in your main site set as well:

EXT:my_extension/Configuration/TCA/Overrides/sys_template.php (before and after)
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
    'my_extension',
    'Configuration/TypoScript/',
    'Examples TypoScript'
);
Copied!

In your main site set provide the same files that where provided as includes by \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile until now:

  • packages/my_extension/Configuration/

    • Sets

      • MySet

        • config.yaml
        • constants.typoscript
        • setup.typoscript
    • TypoScript

      • constants.typoscript
      • setup.typoscript
packages/my_extension/Configuration/Sets/MySet/constants.typoscript
@import 'EXT:my_extension/Configuration/TypoScript/setup.typoscript'
Copied!
packages/my_extension/Configuration/Sets/MySet/setup.typoscript
@import 'EXT:my_extension/Configuration/TypoScript/setup.typoscript'
Copied!

Multiple TypoScript include sets

If there should be more then one set of TypoScript templates that may be included, they were usually stored in sub folders of Configuration/TypoScript until now.

When introducing site sets usually one site set per TypoScript record include set is needed:

  • packages/my_extension/Configuration

    • TypoScript

      • SpecialFeature1

        • constants.typoscript
        • setup.typoscript
      • SpecialFeature2

        • setup.typoscript
      • constants.typoscript
      • setup.typoscript
    • Sets

      • MyMainSet

        • config.yaml
        • constants.typoscript
        • setup.typoscript
      • MySpecialFeature1Set

        • config.yaml
        • constants.typoscript
        • setup.typoscript
      • MySpecialFeature2Set

        • config.yaml
        • setup.typoscript

For backward compability reasons ExtensionManagementUtility::addStaticFile still needs to be called for each folder that should be available in the TypoScript template record:

EXT:my_extension/Configuration/TCA/Overrides/sys_template.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
    'my_extension',
    'Configuration/TypoScript/',
    'My Extension - Main TypoScript'
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
    'my_extension',
    'Configuration/TypoScript/Example1/',
    'My Extension - Additional example 1'
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
    'my_extension',
    'Configuration/TypoScript/SpecialFeature2/',
    'My Extension - Some special feature'
);
Copied!

Each site set then provides the TypoScript files the according location by importing it, for example:

packages/my_extension/Configuration/Sets/MySet/setup.typoscript
@import 'EXT:my_extension/Configuration/TypoScript/MySpecialFeature2Set/setup.typoscript'
Copied!

Make TypoScript available (always load)

Use ExtensionManagementUtility::addTypoScript if the frontend TypoScript must be available in backend modules without page context, for example to register the YAML of the EXT:form system extension for the backend.

EXT:my_extension/ext_localconf.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTypoScript(
    'my_extension',
    'setup',
    '
        module.tx_form {
            settings {
                yamlConfigurations {
                    100 = EXT:my_site_package/Configuration/Form/CustomFormSetup.yaml
                }
            }
        }
    ',
);
Copied!

More information

TypoScript backend module

Changed in version 13.1

TypoScript on a per-site basis can now be entered via sites and sets. It is still possible but not recommended to keep TypoScript in the backend in TYPO3 13.

TypoScript can be stored in a database record or in a file. Storing it in a file is recommended as you can keep it under version control, deploy it etc.

To store your TypoScript in a file, you can use your site set as TypoScript provider or store the TypoScript in a custom site package. Use the Submodule "Active TypoScript" to analyze how the TypoScript is interpreted after parsing and combining.

When kept in the database, TypoScript is entered manually in both the Constants and Setup fields of template records (which are stored in the database in table sys_template).

Submodule "TypoScript records overview"

This submodule shows all pages that contain TypoScript either by having a TypoScript record or by having a Site Set TypoScript provider.

Screenshot of Submodule "TypoScript records overview" in the TYPO3 backend

If TypoScript was added by a record, it is linked.

Submodule "Constant Editor"

Changed in version 13.3

With the introduction of the site Site settings editor settings can be edited in a comfortable and type safe way on site level.

The constant editor is kept for backward compatibility.

The backend module Site Management > TypoScript > Constant Editor used a special format of Comments to display a form for editing the constants.

Screenshot of the TYPO3 Backend showing the constant editor

It is not recommended to newly introduce constants in the constant editor. The documentation of the constant editors comment format can still be found at Comment Syntax

Submodule "Edit TypoScript Record"

This can be done in the Site Management > TypoScript module in the submodule Edit TypoScript Record.

The submodule "Edit TypoScript Record" in the TYPO3 Backend.

When you click on Edit the whole TypoScript record you can edit the complete record:

The submodule whole TypoScript record in edit mode

As the TypoScript record is just a normal record it can also be seen in and edited from the list module:

The TypoScript record in the list module

Include TypoScript files

In both the "Constants" and "Setup" fields, the @import syntax can be used to include TypoScript contained inside files:

EXT:my_site_package/Configuration/TypoScript/setup.typoscript
# Import a single file
@import 'EXT:my_site_package/Configuration/TypoScript/randomfile.typoscript'

# Import multiple files of a single directory in file name order
@import 'EXT:my_site_package/Configuration/TypoScript/*.typoscript'

# The filename extension can be omitted and defaults to .typoscript
@import 'EXT:my_site_package/Configuration/TypoScript/'
Copied!

Include TypoScript from extensions

Changed in version 13.1

TypoScript on a per-site basis can now be entered via sites and sets. If the extension to be used already supports site sets, those should be used instead of TypoScript includes in the record.

It is also possible to "Include TypoScript sets" from extensions in the TypoScript record.

  1. In the Site Management > TypoScript module, select :guilabel:Edit TypoScript Record`.
  2. Click Edit the whole TypoScript record
  3. Chose the tab Advanced Options
  4. Click the templates to include in Available Items.

    "Include TypoScript sets" by choosing from the "Available items"

Include other TypoScript records

Apart from this, it is also possible to include other TypoScript template records (in the field called Include TypoScript records).

Include TypoScript records

Submodule "Included TypoScript"

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

A visual representation of how TypoScript is included.

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

You can click on the {+} button to see details about the TypoScript definition and its includes.

Submodule "Active TypoScript"

You can use the submodule Active TypoScript to debug the configuration array build after all TypoScript configurations are parsed and combined. TypoScript Constants and Setup are listed separately here and Constant usage is shown. However there is no information what location the setting came from. Use the Submodule "Included TypoScript" to analyze where TypoScript was set and this module to look at the result.

Screenshot of the Active TypoScript submodule in the TYPO3 Backend

Debug the parsed and combined TypoScript

Access TypoScript in an extension

This page explains how to access TypoScript settings in an extension.

Extbase controllers

In Extbase controllers, Flexform settings and TypoScript settings will be merged together. If settings exists in both, the Flexform takes precedence and overrides the TypoScript setting. Note that both Flexform and TypoScript settings must use the convention of preceding the setting with settings. (for example, settings.threshold).

Extbase offers some advantages: Some things work automatically out-of-the-box. However, you must stick to the Extbase conventions ("conventions over configuration").

In order to access TypoScript settings from an Extbase controller.

  1. Use the convention of defining your TypoScript settings in settings

    EXT:my_extension/Configuration/TypoScript/setup.typoscript
    plugin.tx_myextension {
       view {
          # view settings
       }
    
       settings {
          key1 = value1
          key2 = value2
       }
    }
    Copied!
  2. Access them via $this->settings

    For example, in your controller:

    $myvalue1 = $this->settings['key1'] ?? 'default';
    Copied!

Fluid

If Extbase controllers are used, $this->settings is automatically passed to the Fluid template. Allowing you to access settings like this:

{settings.key1}
Copied!

Constants

Screenshot of the TYPO3 Backend showing the constant editor

The Constant Editor in the TYPO3 backend

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

Defining constants

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

Reserved name

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

Multi-line values: The ( ) signs

Constants do not support multiline values!

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

Example

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

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

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

Using constants

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

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

Only constants, which are actually defined in the Constants field or an included constants.typoscript file, are substituted.

Constants from included TypoScript files are also substituted. All TypoScript constants are combined before the TypoScript Setup configuration is resolved.

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

Example

EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
  typeNum = 0
  bodyTag = <body class="{$tx_my_sitepackage.bgCol}">
  10 = IMAGE
  10.file = {$tx_my_sitepackage.file.toplogo}
}
Copied!

For the above example to work, the constants from the last example have to be defined in the constants field or a file called constants.typoscript:

EXT:my_sitepackage/Configuration/TypoScript/constants.typoscript
tx_my_sitepackage {
  bgCol = bg-primary
  file.toplogo = EXT:my_sitepackage/Resources/Public/Images/Logo.png
}
Copied!
Screenshot of the TypoScript record editor showing the Constants and Setup fields

The fields Constants and Setup in the TypoScript backend record

You can use the sub module Site Management > TypoScript > Active TypoScript to display which values are assigned to constants. The constant key is displayed in red, the replacement in green:

Screenshot of the Active TypoScript with constants substituted

Register

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

Defining registers

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

Example

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

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

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

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

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

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

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

Debugging / analyzing

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

Analyzing defined constants

The backend submodule Site Management > TypoScript > Active TypoScript provides a tree view to all defined TypoScript Constants on the currently active page.

A Screenshot showing the "Constants" section of the "Active TypoScript" submodule.

Analyzing defined TypoScript Constants in the Active TypoScript submodule.

Finding errors

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

The submodule 'Included TypoScript' showing a syntax warning

In the frontend, the typo3/cms-adminpanel is another possibility to debug TypoScript: use its section called TypoScript. It shows selected rendered (configuration) values, SQL queries, error messages and more.

Debugging

TypoScript itself offers a number of debug functions:

  • stdWrap comes with the properties , and which help checking which values are currently available and which configuration is being handled.
  • TMENU comes with the property debugItemConf. If set to 1, it outputs the configuration arrays for each menu item. Useful to debug optionSplit things and such.

Using and setting TSconfig

This chapter gives an overview where TSconfig is set, how it can be edited, and the load order of the different variants.

TSconfig can be used in page, it is then referred to as "Page TSconfig", or for backend users and backend user groups, in which case it is known as "User TSconfig".

Lists different options of how to include Page TSconfig options.

Lists different options of how to include User TSconfig options.

A short introduction in the syntax of TSconfig and how it differs from TypoScript setup.

Explains how Conditions can be used in TSconfig of both user and page.

Explains how TSconfig can be retrieved from and used within the PHP code of backend modules.

Setting page TSconfig

It is recommended to always define custom page TSconfig in a project-specific sitepackage extension. This way the page TSconfig settings can be kept under version control.

The options described below are available for setting page TSconfig in non-sitepackage extensions.

Page TSconfig can be defined globally as Default page TSconfig, on site level via Page TSconfig via site or set or for a page tree, a page and all its subpages.

It is also possible to set set page TSconfig directly in the page properties but this is not recommended anymore.

Setting the page TSconfig globally

Global page TSconfig should be stored within an extension, usually a sitepackage extension. The content of the file Configuration/page.tsconfig within an extension is automatically loaded during build time.

It is possible to load other TSconfig files with the import syntax within this file:

EXT:my_sitepackage/Configuration/page.tsconfig
@import 'EXT:my_sitepackage/Configuration/TsConfig/Page/Basic.tsconfig'
@import 'EXT:my_sitepackage/Configuration/TsConfig/Page/Mod/Wizards/NewContentElement.tsconfig'
Copied!

Many page TSconfig settings can be set globally. This is useful for installations that contain only one site and use only one sitepackage extension.

Extensions supplying custom default page TSconfig that should always be included, can also set the page TSconfig globally.

The PSR-14 event BeforeLoadedPageTsConfigEvent is available to add global static page TSconfig before anything else is loaded.

Page TSconfig on site level

New in version 13.1

Page TSconfig can be included on a per site level.

Page TSconfig can be defined on a site level by placing a file called page.tsconfig in the storage directory of the site (config/sites/<identifier>/).

Extensions and site packages can provide page TSconfig in site sets by placing a file called page.tsconfig into the folder of that set.

This way sites and sets can ship page TSconfig without the need for database entries or by polluting global scope. Dependencies can be expressed via site sets, allowing for automatic ordering and deduplication.

See also site sets as page TSconfig provider.

Example: load page TSconfig from the site set and the site

Let us assume, you have a site set defined in your extension:

EXT:my_extension/Configuration/Sets/MySet/config.yaml
name: my-vendor/my-set
label: My Set
Copied!

And use it in a site in your project:

config/sites/my-site/config.yaml
base: 'http://example.com/'
rootPageId: 1
dependencies:
  - my-vendor/my-set
Copied!

You can now put a file called page.tsconfig in the same folder like your site configuration and it will be automatically loaded for all pages in that site.

config/sites/my-site/page.tsconfig
# This tsconfig will be loaded for pages in site "my-site"
# [...]
Copied!

Or you can put the file page.tsconfig in the same directory like the site set you defined in your extension. It will then be loaded by all pages of all sites that depend on this set:

EXT:my_extension/Configuration/Sets/MySet/page.tsconfig
# This tsconfig will be loaded for pages in all sites that depend on set 'my-vendor/my-set'
# [...]
Copied!

Static page TSconfig

Include static page TSconfig into a page tree

Static page TSconfig that has been registered by your sitepackage or a third party extension can be included in the page properties.

  1. Go to the page properties of the page where you want to include the page TSconfig.
  2. Go to the tab Resources, then to page TSconfig > Include static page TSconfig (from extensions) and select the desired configurations from the Available Items.

Register static page TSconfig files

Register PageTS config files in the Configuration/TCA/Overrides/pages.php of any extension.

These can be selected in the page properties.

EXT:my_sitepackage/Configuration/TCA/Overrides/pages.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

ExtensionManagementUtility::registerPageTSConfigFile(
    'extension_name',
    'Configuration/TsConfig/Page/myPageTSconfigFile.tsconfig',
    'My special config',
);
Copied!

It is not possible to use language strings LLL:... for the third parameter as the extension name will be automatically appended.

If you need to localize these labels, modify the TCA directly instead of using the API function:

EXT:my_sitepackage/Configuration/TCA/Overrides/pages.php
<?php

$GLOBALS['TCA']['pages']['columns']['tsconfig_includes']['config']['items'][] =
    [
        'LLL:EXT:my_sitepackage/Resources/Private/Language/locallang_db.xlf:pages.pageTSconfig.my_ext_be_layouts',
        'EXT:my_sitepackage/Configuration/TsConfig/Page/myPageTSconfigFile.tsconfig',
    ];
Copied!

Set page TSconfig directly in the page properties

Go to the page properties of the page where you want to include the page TSconfig and open the tab Resources.

You can enter page TSconfig directly into the field Page TSconfig:

TSconfig-related fields in the Resources tab of a page

Page TSconfig inserted directly into the page properties is applied to the page itself and all its subpages.

Verify the final configuration

The full page TSconfig for any given page can be viewed using the module Page TSconfig with in the Site Management section.

Overriding and modifying values

Page TSconfig is loaded in the following order, the latter override the former:

  1. Default page TSconfig that was set globally
  2. Static page TSconfig that was included for a page tree.
  3. Direct page TSconfig entered directly in the page properties.
  4. User TSconfig overrides

Static and direct page TSconfig are loaded for the page they are set on and all their subpages.

The TypoScript syntax to modify values can also be used for the page TSconfig.

Example

Default page TSconfig

EXT:site_package/Configuration/page.tsconfig
RTE.default.proc.allowTagsOutside = hr
Copied!

Static page TSconfig included on the parent page

EXT:site_package/Configuration/page.tsconfig
RTE.default.proc.allowTagsOutside := addToList(blockquote)
Copied!

Finally you get the value "hr,blockquote".

Setting user TSconfig

It is recommended to always define custom user TSconfig in a project-specific sitepackage extension. This way the user TSconfig settings can be kept under version control.

Importing the user TSconfig into a backend user or group

  1. Open the record of the user or group. Go to Options > TSconfig.

    The TSconfig field in the Options tab of a backend user

    The TSconfig field in the Options tab of a backend user

  2. Enter the following TSconfig to import a configuration file from your sitepackage:

    TsConfig added in the backend record of a backend user or group
    @import 'EXT:my_sitepackage/Configuration/TsConfig/User/my_editor.tsconfig'
    Copied!

This will make all settings in the file available to the user. The file itself can be kept under version control together with your sitepackage.

TSconfig defined at user level overrides TSconfig defined at group level.

If a user is a member of several groups, the TSconfig from each group is loaded. The order in which the groups are added to the user in field General > Group is used.

The TSconfig from latter groups overrides the TSconfig from earlier groups if both define the same property.

Setting default user TSconfig

New in version 13.0

Starting with TYPO3 v13.0 user TSconfig in a file named Configuration/user.tsconfig in an extension is automatically loaded during build time.

User TSconfig is designed to be individual for users or groups of users. However, good defaults can be defined and overridden by group or user-specific TSconfig.

Default user TSconfig should be stored within an extension, usually a sitepackage extension. The content of the file Configuration/user.tsconfig within an extension is automatically loaded during build time.

It is possible to load other user TSconfig files with the import syntax within this file:

EXT:my_extension/Configuration/user.tsconfig
@import 'EXT:my_sitepackage/Configuration/TsConfig/User/default.tsconfig'
Copied!

The PSR-14 event BeforeLoadedUserTsConfigEvent is available to add global static user TSconfig before anything else is loaded.

Verify the final configuration

The full user TSconfig of the currently logged-in backend user can be viewed using the System > Configuration backend module and choosing the action $GLOBALS['BE_USER']->getTSConfig() (User TSconfig). However this module can only be accessed by admins.

Viewing user TSconfig using the Configuration module

Viewing user TSconfig using the Configuration module

The Configuration module is available with installed lowlevel system extension.

Override and modify values

Properties, which are set in the TSconfig field of a group, are valid for all users of that group.

Values set in one group can be overridden and modified in the same or another group. If a user is a member of multiple groups, the TSconfig settings are evaluated in the order in which the groups are included in the user account: When editing the backend user, the selected groups are evaluated from top to bottom.

Example:

  • Add in user TSconfig

    EXT:site_package/Configuration/user.tsconfig
    page.RTE.default.showButtons = bold
    Copied!
  • You get the value "bold".
  • Add later in user TSconfig

    EXT:site_package/Configuration/user.tsconfig
    page.RTE.default.showButtons := addToList(italic)
    Copied!
  • You get the value "bold,italic".

Finally, you can override or modify the settings from groups that your user is a member of in the user TSconfig field of that specific user.

Example:

Let's say the user is a member of a usergroup with this configuration:

EXT:site_package/Configuration/page.tsconfig
TCAdefaults.tt_content {
    hidden = 1
    header = Hello!
}
Copied!

Then we set the following values in the TSconfig field of the specific user.

EXT:site_package/Configuration/user.tsconfig
page.TCAdefaults.tt_content.header = 234
options.clearCache.all = 1
Copied!

This would override the default value of the header ("234") and add the clear cache option. The default value of the hidden field is not changed and simply inherited directly from the group.

Overriding page TSconfig in user TSconfig

All properties from page TSconfig can be overridden in user TSconfig by prepending the property name with page..

When a page TSconfig property is set in user TSconfig that way, regardless of whether it is in the TSconfig field of a group or a user, it overrides the value of the according page TSconfig property.

To illustrate this feature let's say new pages and copied pages are not hidden by default:

EXT:site_package/Configuration/page.tsconfig
TCAdefaults.pages.hidden = 0
TCEMAIN.table.pages.disableHideAtCopy = 1
Copied!

If we activate the following configuration in the user TSconfig of a certain backend user group, new and copied pages will be hidden for that group. The user TSconfig to be used is the same, but prefixed with page.

EXT:site_package/Configuration/TSconfig/editors.tsconfig
// Override the settings from the page TSconfig for the editors usergroup
page {
    TCAdefaults.pages.hidden = 1
    TCEMAIN.table.pages.disableHideAtCopy = 0
}
Copied!

Syntax

While the objects, properties and conditions are different, the syntax of TSconfig is basically the same as it is for TypoScript in frontend TypoScript templates.

Please note the following differences:

Conditions

TSconfig TypoScript conditions offer a way to conditionally change TypoScript based on current context. See the TypoScript syntax condition chapter for the basic syntax of conditions.

It is possible to use TypoScript conditions in both user TSconfig and page TSconfig, just as it is done in frontend TypoScript. The list of available variables and functions is different, though.

The Symfony expression language tends to throw warnings when sub arrays are checked in a condition that do not exist. Use the traverse function to avoid this.

Condition variables available in TSconfig

applicationContext

applicationContext

applicationContext
Type
string

Current application context as string. See Application context.

Example: Condition applies in application context "Development"

EXT:site_package/Configuration/page.tsconfig
[applicationContext == "Development"]
    // Your settings go here
[END]
Copied!

Example: Condition applies in any application context that does not start with "Production"

This condition applies in any context that is "Production" or starts with "Production" (for example Production/Staging"):

EXT:site_package/Configuration/page.tsconfig
[applicationContext matches "/^Production/"]
    // Your settings go here
[END]
Copied!

page

page

page
Type
array

All data of the current page record as array. Only available in page TSconfig, not in user TSconfig.

Example: Condition applies only on certain pages

EXT:site_package/Configuration/page.tsconfig
# Check single page uid
[traverse(page, "uid") == 2]
    // Your settings go here
[END]
# Check list of page uids
[traverse(page, "uid") in [17,24]]
    // Your settings go here
[END]
# Check list of page uids NOT in
[traverse(page, "uid") not in [17,24]]
    // Your settings go here
[END]
# Check range of pages (example: page uid from 10 to 20)
[traverse(page, "uid") in 10..20]
    // Your settings go here
[END]

# Check the page backend layout
[traverse(page, "backend_layout") == 5]
    // Your settings go here
[END]
[traverse(page, "backend_layout") == "example_layout"]
    // Your settings go here
[END]

# Check the page title
[traverse(page, "title") == "foo"]
    // Your settings go here
[END]
Copied!

tree

tree

tree
Type
Object

Object with tree information. Only available in page TSconfig, not in user TSconfig.

tree.level

tree.level

tree.level
Type
integer

Current tree level. Only available in page TSconfig, not in user TSconfig. Starts at 1 (root level).

Example: Condition applies on a page on root level

EXT:site_package/Configuration/page.tsconfig
# Check if page is on level 1 (root):
[tree.level == 1]
    // Your settings go here
[END]
Copied!

tree.pagelayout

tree.pagelayout

tree.pagelayout
Type
integer / string

Check for the defined backend layout of a page including the inheritance of the field Backend Layout (subpages of this page). Only available in page TSconfig, not in user TSconfig.

Example: Condition applies on pages with a certain backend layout

EXT:site_package/Configuration/page.tsconfig
# Use backend_layout records uids
[tree.pagelayout == 2]
    // Your settings go here
[END]

# Use TSconfig provider of backend layouts
[tree.pagelayout == "pagets__Home"]
    // Your settings go here
[END]
Copied!

tree.rootLine

tree.rootLine

tree.rootLine
Type
array

An array of arrays with uid and pid. Only available in page TSconfig, not in user TSconfig.

Example: Condition applies on all subpages of page

EXT:site_package/Configuration/page.tsconfig
[tree.rootLine[0]["uid"] == 1]
    // Your settings go here
[END]
Copied!

tree.rootLineIds

tree.rootLineIds

tree.rootLineIds
Type
array

An array with UIDs of the root line. Only available in page TSconfig, not in user TSconfig.

Example: Condition applies if a page is in the root line

EXT:site_package/Configuration/page.tsconfig
# Check if page with uid 2 is inside the root line
[2 in tree.rootLineIds]
    // Your settings go here
[END]
Copied!

tree.rootLineParentIds

tree.rootLineParentIds

tree.rootLineParentIds
Type
array

An array with parent UIDs of the root line. Only available in page TSconfig, not in user TSconfig.

Example: Condition applies if a page's parent is in the root line

EXT:site_package/Configuration/page.tsconfig
# Check if page with uid 2 is the parent of a page inside the root line
[2 in tree.rootLineParentIds]
    // Your settings go here
[END]
Copied!

backend

backend

backend
Type
Object

Object with backend information.

backend.user

backend.user

backend.user
Type
Object

Object with current backend user information.

backend.user.isAdmin

backend.user.isAdmin

backend.user.isAdmin
Type
boolean

True if current user is admin.

Example: Condition applies if the current backend user is an admin

EXT:site_package/Configuration/page.tsconfig
# Evaluates to true if current backend user is administrator
[backend.user.isAdmin]
    // Your settings go here
[END]
Copied!

backend.user.isLoggedIn

backend.user.isLoggedIn

backend.user.isLoggedIn
Type
boolean

True if current user is logged in.

Example: Condition applies if any backend user is logged in

EXT:site_package/Configuration/page.tsconfig
[backend.user.isLoggedIn]
    // Your settings go here
[END]
Copied!

backend.user.userId

backend.user.userId

backend.user.userId
Type
integer

UID of current user.

Example: Condition applies if a certain backend user is logged in

EXT:site_package/Configuration/page.tsconfig
# Evaluates to true if user uid of current logged in backend user is equal to 5
[backend.user.userId == 5]
    // Your settings go here
[END]
Copied!

backend.user.userGroupIds

backend.user.userGroupList

backend.user.userGroupList
Type
array

array of user group IDs of the current backend user.

Example: Condition applies if a backend user of a certain group is logged in

EXT:site_package/Configuration/page.tsconfig
[2 in backend.user.userGroupIds]
    // Your settings go here
[END]
Copied!

backend.user.userGroupList

backend.user.userGroupList

backend.user.userGroupList
Type
string

Comma list of group UIDs

Example: Condition applies if the groups of a user meet a certain pattern

EXT:site_package/Configuration/page.tsconfig
[like(","~backend.user.userGroupList~",", "*,1,*")]
    // Your settings go here
[END]
Copied!

workspace

workspace

workspace
Type
Object

object with workspace information

workspace.workspaceId

.workspaceId

.workspaceId
Type
integer

UID of current workspace.

Example: Condition applies only in a certain workspace

EXT:site_package/Configuration/page.tsconfig
[workspace.workspaceId == 0]
    // Your settings go here
[END]
Copied!

workspace.isLive

workspace.isLive

workspace.isLive
Type
boolean

True if current workspace is live.

Example: Condition applies only in live workspace

EXT:site_package/Configuration/page.tsconfig
[workspace.isLive]
    // Your settings go here
[END]
Copied!

workspace.isOffline

workspace.isOffline

workspace.isOffline
Type
boolean

True if current workspace is offline

Example: Condition applies only in offline workspace

EXT:site_package/Configuration/page.tsconfig
[workspace.isOffline]
    // Your settings go here
[END]
Copied!

typo3

typo3

typo3
Type
Object

Object with TYPO3 related information

typo3.version

typo3.version

typo3.version
Type
string

TYPO3 version (e.g. 13.4.0-dev)

Example: Condition only applies in an exact TYPO3 version like 13.4.0

EXT:site_package/Configuration/page.tsconfig
[typo3.version == "13.4.0"]
    // Your settings go here
[END]
Copied!

typo3.branch

typo3.branch

typo3.branch
Type
string

TYPO3 branch (e.g. 13.4)

Example: Condition applies in all TYPO3 versions of a branch like 13.4

EXT:site_package/Configuration/page.tsconfig
[typo3.branch == "13.4"]
    // Your settings go here
[END]
Copied!

typo3.devIpMask

typo3.devIpMask

typo3.devIpMask
Type
string

Example: Condition only applies if the devIpMask is set to a certain value

EXT:site_package/Configuration/page.tsconfig
[typo3.devIpMask == "203.0.113.6"]
    // Your settings go here
[END]
Copied!

Condition functions available in TSconfig

date()

date([parameter])

date([parameter])
Type
integer
Parameter
[parameter]: string / integer

Get current date in given format. See PHP date function as reference for possible usage.

Example: Condition applies at certain dates or times

EXT:site_package/Configuration/page.tsconfig
# True if day of current month is 7
[date("j") == 7]
    // Your settings go here
[END]

# True if day of current week is 7
[date("w") == 7]
    // Your settings go here
[END]

# True if day of current year is 7
[date("z") == 7]
    // Your settings go here
[END]

# True if current hour is 7
[date("G") == 7]
    // Your settings go here
[END]
Copied!

like()

like([search-string], [pattern])

like([search-string], [pattern])
Type
boolean
parameter
[search-string] : string; [pattern]: string

This function has two parameters: The first parameter is the string to search in, the second parameter is the search string.

Example: Use the "like()" function in conditions

EXT:site_package/Configuration/page.tsconfig
# Search a string with * within another string
[like("fooBarBaz", "*Bar*")]
    // Your settings go here
[END]

# Search string with single characters in between, using ?
[like("fooBarBaz", "f?oBa?Baz")]
    // Your settings go here
[END]

# Search string using regular expression
[like("fooBarBaz", "/f[o]{2,2}[aBrz]+/")]
    // Your settings go here
[END]
Copied!

traverse()

traverse([array], [key])

traverse([array], [key])
Type
any
Parameter
[array]: array; [key]: string or integer

This function gets a value from an array with arbitrary depth and suppresses PHP warning when sub arrays do not exist. It has two parameters: The first parameter is the array to traverse, the second parameter is the path to traverse.

In case the path is not found in the array, an empty string is returned.

Example: Condition applies if request parameter matches a certain value

EXT:site_package/Configuration/page.tsconfig
# Traverse query parameters of current request along tx_news_pi1[news]
[traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0]
    // Your settings go here
[END]
Copied!

compatVersion()

compatVersion([version-pattern])

compatVersion([version-pattern])
Type
boolean
Parameter
[version-pattern]: string

Compares against the current TYPO3 branch.

Example: Condition applies if the current TYPO3 version matches a pattern

EXT:site_package/Configuration/page.tsconfig
# True if current version is 13.4.x
[compatVersion("13.4")]
    // Your settings go here
[END]
[compatVersion("13.4.0")]
    // Your settings go here
[END]
[compatVersion("13.4.1")]
    // Your settings go here
[END]
Copied!

getenv()

getenv([enviroment_variable])

getenv([enviroment_variable])
Type
string
Parameter
[enviroment_variable]: string

PHP function getenv.

Example: Condition applies if the virtual host is set to a certain value

EXT:site_package/Configuration/page.tsconfig
[getenv("VIRTUAL_HOST") == "www.example.org"]
    // Your settings go here
[END]
Copied!

feature()

feature([feature_key])

feature([feature_key])
Type
any
Parameter
[feature_key]: string

Provides access to feature toggles current state.

Example: condition applies if a feature toggle is enabled

EXT:site_package/Configuration/page.tsconfig
# True if feature toggle for strict TypoScript syntax is enabled:
[feature("TypoScript.strictSyntax") === false]
    // Your settings go here
[END]
Copied!

site()

site([keyword])

site([keyword])
Type
string
Parameter
[keyword]: string

Get value from site configuration, or null if no site was found or property does not exists. Only available in page TSconfig, not available in user TSconfig. Available Information:

site("identifier")
Returns the identifier of current site as string.
site("base")
Returns the base of current site as string.
site("rootPageId")
Returns the root page uid of current site as integer.
site("languages")
Returns array of available languages for current site. For deeper information, see siteLanguage().
site("allLanguages")
Returns array of available and unavailable languages for current site. For deeper information, see siteLanguage().
site("defaultLanguage")
Returns the default language for current site. For deeper information, see siteLanguage().
site("configuration")
Returns an array with all available configuration for current site.

Example: Condition applies if a certain value is set in the site configuration

EXT:site_package/Configuration/page.tsconfig
# Site identifier
[site("identifier") == "my_website"]
    // Your settings go here
[END]

# Match site base host
[site("base").getHost() == "www.example.org"]
    // Your settings go here
[END]

# Match base path
[site("base").getPath() == "/"]
    // Your settings go here
[END]

# Match root page uid
[site("rootPageId") == 1]
    // Your settings go here
[END]

# Match a configuration property
[traverse(site("configuration"), "myCustomProperty") == true]
    // Your settings go here
[END]
Copied!

PHP API

Retrieving TSconfig settings

The PHP API to retrieve page and user TSconfig in a backend module can be used as follows:

EXT:my_sitepackage/Classes/Controller/MyBackendController.php
<?php

declare(strict_types=1);

namespace UsingSettingTSconfig\_PhpApi;

use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;

final class MyBackendController
{
    public function someMethod(int $currentPageId): void
    {
        // Retrieve user TSconfig of currently logged in user
        $userTsConfig = $this->getBackendUser()->getTSConfig();

        // Retrieve page TSconfig of the given page id
        $pageTsConfig = BackendUtility::getPagesTSconfig($currentPageId);
    }

    private function getBackendUser(): BackendUserAuthentication
    {
        return $GLOBALS['BE_USER'];
    }
}
Copied!

Both methods return the entire TSconfig as a PHP array. The former retrieves the user TSconfig while the latter retrieves the page TSconfig.

All imports, overrides, modifications, etc. are already resolved. This includes page TSconfig overrides by user TSconfig.

Similar to other TypoScript-related API methods, properties that contain sub-properties return their sub-properties using the property name with a trailing dot, while a single property is accessible by the property name itself. The example below gives more insight on this.

If accessing TSconfig arrays, the PHP null coalescing operator ?? is useful: TSconfig options may or not be set, accessing non-existent array keys in PHP would thus raise PHP notice level warnings.

Combining the array access with a fallback using ?? helps when accessing these optional array structures.

Incoming (user) TSconfig:
options.someToggle = 1
options.somePartWithSubToggles = foo
options.somePartWithSubToggles.aValue = bar
Copied!
Parsed array returned by getTSConfig(), note the dot if a property has sub keys:
<?php

return [
    'options.' => [
        'someToggle' => '1',
        'somePartWithSubToggles' => 'foo',
        'somePartWithSubToggles.' => [
            'aValue' => 'bar',
        ],
    ],
];
Copied!
Example how to read user TSconfig
<?php

declare(strict_types=1);

namespace UsingSettingTSconfig\_PhpApi;

final class _MyBackendLoggedInController
{
    public function isUserToggleEnabled(): bool
    {
        // Typical call to retrieve a sanitized value:
        return $isToggleEnabled = (bool)($this->getUserTsConfig()['options.']['someToggle'] ?? false);
    }

    public function getSomePartWithSubToggles(): array
    {
        // Retrieve a subset, note the dot at the end:
        return $this->getUserTsConfig()['options.']['somePartWithSubToggles.'] ?? [];
    }

    private function getUserTsConfig(): array
    {
        return $GLOBALS['BE_USER']->getTSConfig();
    }
}
Copied!

Changing or adding page TSconfig

The PSR-14 event ModifyLoadedPageTsConfigEvent is available to modify or add page TSconfig entries.

Identifiers

TypoScript is line based. Each line normally contains three parts:

[Identifier] [Operator] [Value]
Copied!

In this example we have the identifier myIdentifier with the sub identifier mySubIdentifier, the assignment operator = and the value myValue.

Extension examples, file Configuration/TypoScript/Syntax/General/setup.typoscript
myIdentifier.mySubIdentifier = myValue
Copied!

The identifier path (in above example myIdentifier.mySubIdentifier) is a dotted path of single identifiers, and the first block of non-whitespace characters on a line until an operator, a curly open brace, or a whitespace. The dot (.) is used to separate single identifiers, creating a hierarchy.

When a dot is part of a single identifier name (this may, for instance, sometimes happen when configuring FlexForm details), it must be quoted with a backlash. The example below results in the identifier myIdentifier with the sub identifier my.identifier.with.dots having the assigned value myValue:

Extension examples, file Configuration/TypoScript/Syntax/Escaping/setup.typoscript
myIdentifier.my\.identifier\.with\.dots = myValue
Copied!

Code blocks

Curly braces can be used to structure identifier paths in a more efficient way: Without repeating upper parts of a path in each line. This allows nesting.

Example without braces:

Extension examples, file Configuration/TypoScript/Syntax/CodeBlock/setup.typoscript
myIdentifier = TEXT
myIdentifier.stdWrap.field = title
myIdentifier.stdWrap.ifEmpty.data = leveltitle:0
Copied!

This can be written as:

Extension examples, file Configuration/TypoScript/Syntax/CodeBlock2/setup.typoscript
myIdentifier = TEXT
myIdentifier {
   stdWrap.field = title
   stdWrap.ifEmpty.data = leveltitle:0
}
Copied!

Curly braces can be nested to further improve readability. This is also the same as above:

Extension examples, file Configuration/TypoScript/Syntax/CodeBlock3/setup.typoscript
myIdentifier = TEXT
myIdentifier {
   stdWrap {
      field = title
      ifEmpty {
         data = leveltitle:0
      }
   }
}
Copied!

Some rules apply during parsing:

  • Everything on the same line after the opening { and closing } brace is considered a comment, even if the comment markers #, // and /* ... */ are missing.
  • The closing brace } must be on a single line in order to close a block. The following construct is invalid, the closing brace is interpreted as part of the value, so the TypoScript and TSconfig backend modules will mumble with a "missing closing brace" warning:

    Extension examples, file Configuration/TypoScript/Syntax/CodeBlockInvalidClosingBrace/setup.typoscript
    myIdentifier = TEXT
    myIdentifier {
       value = bar }
    Copied!
  • Conditions can not be placed within blocks, they are always "global" level and stop any brace nesting. The following construct is invalid, the TypoScript and TSconfig backend modules will mumble with a "missing closing brace" warning:

    Extension examples, file Configuration/TypoScript/Syntax/CodeBlockInvalidCondition/setup.typoscript
    myIdentifier = TEXT
    myIdentifier {
       value = foo
       [frontend.user.isLoggedIn]
          value = bar
       [end]
    }
    Copied!
  • Nesting is per-file / per-text-snippet: It does not "swap" into included files. This was the case with the old TypoScript parser. It has been a nasty side-effect, leading to hard to debug problems. File includes with @import within curly braces are not relative (anymore).

    A construct like this is invalid, the TypoScript and TSconfig backend modules will mumble with a "missing closing brace" warning:

    Extension examples, file Configuration/TypoScript/Syntax/CodeBlockInvalidCondition/setup.typoscript
    myIdentifier = TEXT
    myIdentifier {
       @import 'EXT:my_extension/Configuration/TypoScript/bar.typoscript'
       value = foo
    }
    Copied!

Operators

TypoScript syntax comes with a couple of operators to assign values, copy from other identifier paths, and to manipulate values. Let's have a closer look at them.

Value assignment with "="

This most common operator assigns a single line value to an identifier path. Everything after the = character until the end of the line is considered to be the value. The value is trimmed, leading and trailing whitespaces are removed.

Values are parsed for constant references. With a value assignment like foo = someText {$someConstant} furtherText, the parser will look up the constant reference {$someConstant} and tries to substitute it with a defined constant value. If such a constant does not exist, it falls back to the string literal including the {$ and } characters.

A couple of examples:

Extension examples, file Configuration/TypoScript/Syntax/Assignment/setup.typoscript
# Identifier "myIdentifier" is set to the value "foo"
myIdentifier = foo

# Identifier path "myIdentifier.mySubIdentifier" is set to the value "foo"
myIdentifier.mySubIdentifier = foo

# "myIdentifier.mySubIdentifier" it set to the value "foo",
# but is immediately overwritten to value "bar"
myIdentifier.mySubIdentifier = foo
myIdentifier.mySubIdentifier = bar

# Same as above, value of "myIdentifier.mySubIdentifier" is "bar"
myIdentifier.mySubIdentifier = foo
myIdentifier {
   mySubIdentifier = bar
}

# Value assignments are not comment-aware, "#", "//" and "/*" after a
# "=" operator do not start a comment. The value of identifier
# "myIdentifier.mySubIdentifier" is "foo // not a comment"
myIdentifier.mySubIdentifier = foo // not a comment

# Value assignment using a constant:
# Ends up as "foo myConstantValue bar" if constant "myConstant" is set to "myConstantValue"
# Ends up as "foo {$myConstantValue} bar" if constant "myConstant" is not set
myIdentifier. mySubIdentifier = foo {$myConstantValue} bar
Copied!

Multiline assignment with "(" and ")"

Opening and closing parenthesis are used to assign multi-line values. This allows defining values that span several lines and thus include line breaks.

The end parenthesis ) is important: If it is not found, the parser considers all following lines until the end of the TypoScript text snipped to be part of the value. This includes comments, [GLOBAL] conditions and @import file includes: They are not a syntax construct and are considered part of the value assignment.

However, the value is parsed for constants (text looking like {$myIdentifier.mySubIdentifier}: The parser will try to substitute them to their assigned constant value. The "TypoScript" and "Page TSconfig" backend modules may show a warning if a reference to a constant can't be resolved. If a constant reference can't be resolved, the value falls back to its string literal. Since multi-line values are sometimes used to output JavaScript, and JavaScript also uses a syntax construct like {$...}, this may lead to false positive warnings in those backend modules.

A couple of examples:

Extension examples, file Configuration/TypoScript/Syntax/OperatorMultiLine/setup.typoscript
myIdentifier= TEXT
myIdentifier.value (
   This is a
   multiline assignment
)

myIdentifier= TEXT
myIdentifier.value (
   <p class="warning">
      This is HTML code.
   </p>
)

myIdentifier= TEXT
myIdentifier.value (
   This looks up the value for constant {$myConstant}
   and falls back to the string "{$myConstant}" if it can
   not be resolved.
)
Copied!

Unset with ">"

This can be used to unset a previously defined identifier path value, and all of its sub identifiers:

Extension examples, file Configuration/TypoScript/Syntax/ObjectUnset/setup.typoscript
myIdentifier.mySubIdentifier = TEXT
myIdentifier.mySubIdentifier = myValue
myIdentifier.mySubIdentifier.stdWrap = <p>|</p>

# "myIdentifier.mySubIdentifier" is completely removed, including value
# assignment and sub identifier "stdWrap"
myIdentifier.mySubIdentifier >

# Same as above: Everything after ">" operator is considered a comment
myIdentifier.mySubIdentifier > // Some comment
Copied!

Copy with "<"

The < character is used to copy one identifier path to another. The whole current identifier state is copied: both value and sub identifiers. It overrides any old sub identifiers and values at that position.

The copy operator is useful to follow the DRY - Don't repeat yourself principle. It allows maintaining a configuration set at a central place, and copies are used at further places when needed again.

The result of the below TypoScript is two independent sets which are duplicates. They are not references to each other but actual copies:

Extension examples, file Configuration/TypoScript/Syntax/OperatorCopy1/setup.typoscript
myIdentifier = TEXT
myIdentifier.value = Hello world
myOtherIdentifier = TEXT
myOtherIdentifier.value = Hello world

# The above is identical to this:
myIdentifier = TEXT
myIdentifier.value = Hello world
myOtherIdentifier < myIdentifier
Copied!

The copy operator is allowed within code blocks as well:

Extension examples, file Configuration/TypoScript/Syntax/OperatorCopy2/setup.typoscript
myIdentifier {
   10 = TEXT
   10.value = Hello world
   20 < myIdentifier.10
}
Copied!

In the above example, the copied identifier path is referred to with its full path myIdentifier.10. When copying on the same level, it is allowed to use a relative path, indicated by a prepended dot. The following produces the same result as above:

Extension examples, file Configuration/TypoScript/Syntax/OperatorCopy3/setup.typoscript
myIdentifier {
   10 = TEXT
   10.value = Hello world
   20 < .10
}
Copied!

Using the copy operator creates a copy of the source path at exactly this point in the parsing process. Changing the source afterwards does not change the target, and changing the target afterwards does not change the source:

Extension examples, file Configuration/TypoScript/Syntax/OperatorCopy4/setup.typoscript
# The above is identical to this:
myIdentifier = TEXT
myIdentifier.value = Hello world
myOtherIdentifier < myIdentifier

# Changing myIdentifier *after* it has been copied over to myOtherIdentifier,
# does *not* change myOtherIdentifier. The below line only changes the
# value of myIdentifier, not myOtherIdentifier:
myIdentifier.value = Hello world 2

# Changing myOtherIdentifier *after* it has been copied from to myIdentifier,
# does *not* change myIdentifier. The below line only changes the
# value of myOtherIdentifier, not myIdentifier:
myOtherIdentifier.value = Hello world 3
Copied!

References with "=<"

In the context of frontend TypoScript, it is possible to create references from one identifier path to another within the tt_content path. References mean that multiple positions can copy the same source identifier path without making an actual copy. This allows changes to the source identifier afterwards, which changes the targets as well. References can be convenient for this special case, but should be used with caution.

Extension examples, file Configuration/TypoScript/Syntax/OperatorReference/setup.typoscript
lib.myIdentifier = TEXT
lib.myIdentifier {
   value = Hello world
   stdWrap.wrap = <p>|</p>
}
tt_content.text =< lib.myIdentifier
tt_content.textpic =< lib.myIdentifier

# This changes lib.myIdentifier.stdWrap.wrap *and* tt_content.text.stdWrap.wrap
lib.myIdentifier.stdWrap.wrap = <h1>|</h1>
# This changes only tt_content.textpic.stdWrap.wrap
tt_content.textpic.stdWrap.wrap = <h2>|</h2>
Copied!

Value modifications with ":="

This operator assigns a value to an identifier path by calling a predefined function which modifies the existing value in different ways. This is very useful when a value should be modified without completely redefining it again.

A modifier is referenced by its modifier name, plus arguments in parenthesis. These predefined functions are available:

prependString()

Add a string to the beginning of the existing value.

foo = cd
foo := prependString(ab)
# foo is "abcd"
Copied!
appendString()

Add a string to the end of the existing value.

foo = ab
foo := appendString(cd)
# foo is "abcd"
Copied!
removeString()

Remove a string from the existing value.

foo = foobarfoo
foo := removeString(foo)
# foo is "bar"
Copied!
replaceString()

Replace old with new value. Separate these using |.

foo = abcd
foo := replaceString(bc|123)
# foo is "a123d"
Copied!
addToList()

Add values to the end of a list of existing values. There is no check for duplicate values, and the list is not sorted in any way.

foo = 123,456
foo := addToList(789)
# foo is "123,456,789"

foo =
foo := addToList(123)
# foo is "123" (no leading comma added on empty existing value)
Copied!
removeFromList()

Remove a comma-separated list of values from an existing comma-separated list of values. Empty values are removed as well.

foo = foo,123,bar,456,foo,,789
foo:= removeFromList(foo,bar)
# foo is "123,456,789"
Copied!
uniqueList()

Remove duplicate entries from a comma-separated list of values.

foo = 123,456,abc,456,456
foo := uniqueList()
# foo is "123,456,abc"
Copied!
reverseList()

Reverses the order of entries in a comma-separated list of values.

foo = 123,456,abc,456
foo := reverseList()
# foo is "456,abc,456,123"
Copied!
sortList()

Sorts the entries in a comma-separated list of values. There are optional sorting parameters, multiple can be separated using ,:

ascending (default)
Sort the items in ascending order: First numbers from small to big, then letters in alphabetical order.
descending
Sort the items in descending order: First letters in descending order, then numbers from big to small.
numeric
Apply numeric sorting: Numbers from small to big, letters sorted after "0".
foo = 10,100,0,20,abc
foo := sortList()
# foo is "0,10,20,100,abc"

foo = 10,0,100,-20
foo := sortList(numeric)
# foo is "-20,0,10,100"

foo = 10,100,0,20,-20
foo := sortList(numeric,descending)
# foo is "100,20,10,0,-20"
Copied!
getEnv()

Access a $_ENV value. Resolves to empty value if not set.

# $_ENV['foo'] = 'fooValue'
foo := getEnv(foo);
# foo is "fooValue"
Copied!
myCustomFunction()

Changed in version 12.0

The PSR-14 event \TYPO3\CMS\Core\TypoScript\AST\Event\EvaluateModifierFunctionEvent is available to define custom TypoScript functions. The event replaces the hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsparser.php']['preParseFunc'] .

The section EvaluateModifierFunctionEvent provides an example and the API.

Null coalescing operator ?? for TypoScript constants

New in version 13.1

TypoScript constants expressions support a null coalescing operator (??) as a way for providing a migration path from a legacy constant name to a newer name, while providing full backwards compatibility for the legacy constant name, if still defined.

Example that evaluates to $config.oldThing if set, otherwise the newer setting $myext.thing would be used:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
plugin.tx_myext.settings.example = {$config.oldThing ?? $myext.thing}
Copied!

Comments

TypoScript supports single line comments as well as multiline comment blocks.

// and # indicate a comment. Everything until the end of the line will be ignored by the parser. /* indicates a multiline comment start, */ stops it.

When using //, # and /* after an assignment =, this is not considered a comment, but part of the value! Same is true for multiline assignments.

Some examples:

Extension examples, file Configuration/TypoScript/Syntax/Comments/setup.typoscript
# This is a comment
// This is a comment
/* This is a
   multiline comment */

foo < bar // This is a comment
foo < bar /* This is a valid comment, too */

foo > # Another valid comment

foo := addToList(1) # Yes, a comment

[foo = bar] # Many comment. Much wow.

foo (
  # This is NOT a comment but part of the value assignment!
  bar = barValue
) # This is a comment

foo = bar // This is NOT a comment but part of the value assignment!
Copied!

Conditions

TypoScript can contain if and if / else control structures. They are called conditions, their "body" is only considered if a condition criteria evaluates to true. Examples of condition criteria are:

  • Is a user logged in?
  • Is it Monday?
  • Is the page called in a certain language?

Conditions are a TypoScript syntax construct. They are thus available in both frontend TypoScript and backend TSconfig. However, condition criteria are based on prepared variables and functions, and those are different in frontend TypoScript and backend TSconfig. For example, the frontend variable does not exist in TSconfig, it is (obviously) impossible to have a backend TSconfig condition that checks for a logged in frontend user.

For a reference of allowed condition criteria, please refer to the according chapter in the frontend TypoScript Reference and the backend TSconfig Reference. These references come with examples for single condition criteria as well.

The TSconfig and TypoScript backend modules show lists of existing conditions and allow simulating criteria verdicts to analyze their impact on the resulting TypoScript tree.

Condition criteria are based on the Symfony expression language. The Core allows extending the Symfony expression language with own variables and functions, see symfony expression language API for more details.

Basic example

Extension examples, file Configuration/TypoScript/Syntax/Conditions1/setup.typoscript
[date("j") == 9]
   page.10.value = It is the 9th day of the month!
[ELSE]
   page.10.value = It is NOT the 9th day of the month!
[END]
Copied!

Syntax and rules

The general syntax is like this:

Extension examples, file Configuration/TypoScript/Conditions2/setup.typoscript
# Some TypoScript, always parsed
[condition criteria]
   # Some TypoScript, only parsed if the condition criteria is met
[ELSE]
   # Some TypoScript, only parsed if the condition criteria is *not* met
   # [ELSE] is optional
[GLOBAL]
# ... some TypoScript, always parsed
Copied!

These general rules apply:

  • Conditions are encapsulated in [ and ]
  • [ELSE] negates a previous condition criteria and can contain a new body until [END] or [GLOBAL]. [ELSE] is considered if the condition criteria did not evaluate to true.
  • [END] and [GLOBAL] stop a given condition scope. This is similar to a closing curly brace } in programming languages like PHP.
  • Multiple condition criteria can be combined using or or ||, as well as and or &&
  • Single criteria can be negated using !

    Changed in version 12.0

    [END] and [GLOBAL] behave exactly the same. Both are kept for historical reasons (for now).

  • Conditions can use constants. They are available in frontend TypoScript "setup" and in TSconfig from "site settings". A simple example if this constant myPageUid = 42 is set:

    [traverse(page, "uid") == {$myPageUid}]
        page.10.value = Page uid is 42
    [end]
    Copied!
  • Conditions can not be nested within code blocks.

    Changed in version 12.0

    Conditions can be nested into each other, if they are located in different snippets (files or records), see example below. They can not be nested within the same code snippet.

  • A second condition that is not [ELSE], [END] or [GLOBAL] stops a previous condition and starts a new one. This is the main reason conditions can not be nested within one text snippet.
  • Changed in version 12.0

    @import can be nested inside conditions. This allows conditional includes and is a new feature of the TYPO3 v12 parser.

  • Changed in version 12.0

    Conditions automatically stop at the end of a text snippet (file or record), even without [END] or [GLOBAL]. Another snippet on the same level is in "global" scope automatically. The backend TypoScript and TSconfig modules may mumble about a not properly closed condition, though.

  • New in version 12.1

    Using the null-safe operator is possible when accessing properties on objects which might not be available in some context, for example TSFE in the backend:

    # Previously
    [getTSFE() && getTSFE().id == 123]
    
    # Now
    [getTSFE()?.id == 123]
    Copied!

Examples

  • If a user is logged in, or if the client is local, text will be output in upper case:

    Extension examples, file Configuration/TypoScript/Syntax/Conditions3/setup.typoscript
    page = PAGE
    page.10 = TEXT
    page.10.value = HELLO WORLD!
    
    [frontend.user.isLoggedIn || ip('127.0.0.1')]
       page.20 = TEXT
       page.20 {
          value = A frontend user is logged in, or the browser IP is 127.0.0.1
          stdWrap.case = upper
       }
    [GLOBAL]
    Copied!
  • In case if is empty and only a else body is needed for a single condition criteria, these two are identical:

    Extension examples, file Configuration/TypoScript/Syntax/Conditions4/setup.typoscript
    page = PAGE
    page.10 = TEXT
    page.10.value = You are logged in
    
    # This is hard to read
    [frontend.user.isLoggedIn]
    [ELSE]
       page.10.value = You are *not* logged in
    [END]
    
    # This is faster to read
    [!frontend.user.isLoggedIn]
       page.10.value = You are *not* logged in
    [END]
    Copied!
  • Conditions can not be nested within curly braces. The example below is invalid syntax and the backend modules mumble with "missing braces":

    Extension examples, file Configuration/TypoScript/Syntax/Conditions5/setup.typoscript
    # Invalid: Conditions must not be used within code blocks
    someIdentifier {
       someProperty = foo
       [frontend.user.isloggedIn]
          someProperty = bar
       [GLOBAL]
    }
    Copied!

File imports

Changed in version 14.0

To structure and reuse single TypoScript snippets and not stuffing everything into one file or record, the syntax allows loading TypoScript content from sub files.

The keyword @import is a syntax construct and thus available in both frontend TypoScript and backend TSconfig.

@import allows including additional files using wildcards on the file level. Wildcards in paths are not allowed.

The TypoScript parser allows to place @import within condition bodies, which allows conditional imports with @import.

@import is not allowed to be placed within code blocks and breaks any curly braces level, resetting current scope to top level.

@import

This keyword allows including files inspired by a syntax similar to SASS. It is restricted, but still allows wildcards on file level. Single files must end with .typoscript if included in frontend Typoscript. In backend TSconfig, single files should end with .tsconfig, but may end with .typoscript as well (for now).

The include logic is a bit more restrictive with TYPO3 v12, previous versions have been slightly more relaxed in this regard. See this changelog for more details.

The following rules apply:

  • Multiple files are imported in alphabetical order. If a special loading order is desired it is common to prefix the filenames with numbers that increase for files that shall be loaded later.
  • Recursion is allowed: Imported files can have @import statements.
  • Changed in version 12.0

    It is allowed to put @import within a condition. This example imports the additional file only if a frontend user is logged in:

    [frontend.user.isLoggedIn]
        @import './userIsLoggedIn.typoscript'
    [END]
    Copied!
  • Directory imports are not recursive, meaning that a directory import does not automatically travel down its subdirectories.
  • Quoting the filename is necessary with the new syntax. Either double quotes (") or single quotes (') can be used.
  • Wildcards * are only allowed on file level, not on directory level. Only a single wildcard character is allowed.
  • Includes relative to the current file location are allowed using ./ as prefix.
  • Includes must start with EXT: if not relative. Loading files outside of extensions is not possible.
  • Directory traversal using ../ is not allowed.

Some examples:

# Import a single file
@import 'EXT:my_extension/Configuration/TypoScript/randomfile.typoscript'

# Import multiple files in a single directory, sorted by file name
@import 'EXT:my_extension/Configuration/TypoScript/*.typoscript'

# It's possible to omit the file ending. For frontend TypoScript, ".typoscript" is
# appended automatically, backend TSconfig allows both ".typoscript" and ".tsconfig"
@import 'EXT:my_extension/Configuration/TypoScript/'

# Import files starting with "foo", ending with ".typoscript" (frontend)
@import 'EXT:my_extension/Configuration/TypoScript/foo*'

# Import files ending with ".setup.typoscript"
@import 'EXT:my_extension/Configuration/TypoScript/*.setup.typoscript'

# Import "bar.typoscript" relative to current file
@import './bar.typoscript'

# Import all ".setup.typoscript" files in sub directory relative to current file
@import './subDirectory/*.setup.typoscript'
Copied!

Alternatives to using file imports

The following features can make file inclusion unnecessary:

TypoScript string formats

The values assigned to properties in TypoScript are internally handled as strings.

Some properties expect a certain format of string. These formats are described in this chapter.

Enforcing these string formats is up to the implementation of the property using them. They are therefore no real constructs of the TypoScript syntax.

boolean

boolean

boolean

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
EXT:site_package/Configuration/TypoScript/setup.typoscript
dummy.enable = 0   # false, preferred notation
dummy.enable = 1   # true,  preferred notation
dummy.enable =     # false, because the value is empty
Copied!

date-conf

date-conf

date-conf

Used to format a date, see PHP function date(). See the documentation of allowed date time formats in PHP.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.date-conf = d-m-y
Copied!

function name

function name

function name

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

Examples

Method name in a namespaced class:

lib.someThing = USER_INT
lib.someThing.userFunc = MyVendor\MyExtension\SomeNamespace\SomeClass->someFunction
Copied!
EXT:my_extension/Classes/SomeNamespace/SomeClass.php
<?php

namespace MyVendor\MyExtension\SomeNamespace;

use Psr\Http\Message\ServerRequestInterface;

class SomeClass
{
    /**
     * @param string $content Empty string (no content to process)
     * @param array $conf TypoScript configuration
     */
    public function someFunction(string $content, array $conf, ServerRequestInterface $request): string
    {
        $changedContent = $content;
        // Do something
        return $changedContent;
    }
}
Copied!

integer

integer

integer
Examples

42, -8, -9, 0

Positive integers expect to be greater or equal zero.

path

path

path

Path relative to the root directory from which we operate. Also resolves EXT: syntax.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.settings.somePath = fileadmin/stuff/
Copied!

resource

resource

resource

If the value contains a "/", it is expected to be a reference (absolute or relative) to a file in the file system. There is no support for wildcard characters in the name of the reference.

Example

Reference to a file in the file system:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.settings.someFile = fileadmin/picture.gif
Copied!

string

string

string

Any property in TypoScript is a string technically. String can be defined in a single line or with multiple lines, using the Multiline assignment with "(" and ")".

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.value = The quick brown fox jumps over the lazy dog.
Copied!
Extension examples, file Configuration/TypoScript/Syntax/ObjectUnset/setup.typoscript
myIdentifier.mySubIdentifier = TEXT
myIdentifier.mySubIdentifier = myValue
myIdentifier.mySubIdentifier.stdWrap = <p>|</p>

# "myIdentifier.mySubIdentifier" is completely removed, including value
# assignment and sub identifier "stdWrap"
myIdentifier.mySubIdentifier >

# Same as above: Everything after ">" operator is considered a comment
myIdentifier.mySubIdentifier > // Some comment
Copied!

Content Objects (cObject)

"cObject" is an (abstract) object type used to define content objects. Following are some object types that can be used, when the reference calls for a cObject data type.

Please see Content objects (general information) for an introduction.

Content objects (general information)

PHP information

The content objects (data type: cObject) 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 content objects

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
#
# 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
}
Copied!

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 referenced 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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
Copied!

The result is this configuration:

Notice that .value was not cleared, because it's simply two arrays which are joined:

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.

Properties

array of cObjects

array of cObjects
Type
cObject

Array of cObjects. Use this to define cObjects for the different values of Properties. If Properties 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.

cache

cache
Type
cache

See cache function description for details.

default

default
Type
cObject

Use this to define the rendering for those values of Properties that do not match any of the values of the Properties. If no default cObject is defined, an empty string will be returned for the default case.

if

if
Type
->if

If if returns false, nothing is returned.

key

key
Type
string / stdWrap
Default
default

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 Properties is rendered.

This property defines the source of the value that will be matched against the values of the Properties. 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.

setCurrent

setCurrent
Type
string / stdWrap

Sets the "current" value.

stdWrap

stdWrap
Type
stdWrap

stdWrap around any object that was rendered no matter what the Properties value is.

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 Properties field layout is "1" or not (Properties).

The result is in either case wrapped with |<br>.

EXT:site_package/Configuration/TypoScript/setup.typoscript
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>
Copied!

Content object array - COA, COA_INT

COA stands for "content object array".

An object with the content type COA 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.

Properties

1,2,3,4...

1,2,3,4...
Type
cObject

Numbered properties to define the different cObjects, which should be rendered.

cache

cache
Type
cache

See cache function description for details.

if

if
Type
->if

If if returns false, the COA is not rendered.

stdWrap

stdWrap
Type
->stdWrap

Executed on all rendered cObjects after property Properties.

wrap

wrap
Type
wrap / stdWrap

Wraps all rendered cObjects. Executed before property Properties.

Examples:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.contentexample = COA
lib.contentexample {
  10 = TEXT
  10.value = <h1>Header</h1>

  20 = CONTENT
  20 {
    table = tt_content
    select.orderBy = sorting
    select.where = {#colPos}=0
  }

  30 = TEXT
  30.value = <footer>Footer text</footer>
}
Copied!

The previous example will print a simple <h1> header, followed by the page content records and a <footer> element.

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.currentDate = COA_INT
lib.currentDate {
  10 = TEXT
  10.stdWrap.data = date:U
  10.stdWrap.strftime = %H:%M:%S
}
Copied!

This example will not be cached and so will display the current time on each page hit.

CONTENT

An object with the content type CONTENT 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.

Properties

select

select
Type
select

The SQL-statement, a SELECT query, is set here, including automatic visibility control.

table

table
Type
table name / stdWrap

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

renderObj
Type
Content Objects (cObject)
Default
< [table name]

The cObject used for rendering the records resulting from the query in Properties.

If renderObj is not set explicitly, then < [table name] is used. So in this case the configuration of the according Properties is being copied.

See the notes on the example below.

slide

slide
Type
integer / stdWrap

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 site root.
1
Only the current level.
2
Up from one level back.

Use -1 in combination with collect.

slide.collect

slide.collect
Type
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 site root.

slide.collectFuzzy

slide.collectFuzzy
Type
boolean / stdWrap

Only useful with slide.collect. 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

slide.collectReverse
Type
boolean / stdWrap

Reverse order of elements in collect mode. If set, elements of the current page will be at the bottom.

wrap

wrap
Type
wrap / stdWrap

Wrap the whole content.

stdWrap

stdWrap
Type
stdWrap

Apply stdWrap functionality.

cache

cache
Type
cache

See cache function description for details.

Examples

CONTENT explained in detail

See PHP class \TYPO3\CMS\Frontend\ContentObject\ContentContentObject for details on code level.

EXT:site_package/Configuration/TypoScript/setup.typoscript
1 = CONTENT
1 {
   if {
   }
   table = tt_content
   select {
      pidInList = this
      where = colPos = 1
      orderBy = sorting
   }
   renderObj = < tt_content
   slide = 0
   slide {
      collect = 0
      collectReverse = 0
      collectFuzzy = 0
   }
   wrap =
   stdWrap =
}
Copied!

Expanded form:

EXT:site_package/Configuration/TypoScript/setup.typoscript
1 = CONTENT

// STEP 1: do nothing if 'if' evaluates to false

1.if {
   # ifclause =
}
Copied!
EXT:site_package/Configuration/TypoScript/setup.typoscript
// STEP 2: define parameters

1.table = tt_content           # default='' #stdWrap

1.select {
   pidInList = this
   where = colPos = 1
   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 =
Copied!
EXT:site_package/Configuration/TypoScript/setup.typoscript
// 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'
Copied!

See also: if, select, Wrap, stdWrap, Content Objects (cObject)

Display all tt_content records from this page

Here is an example of the CONTENT object:

EXT:site_package/Configuration/TypoScript/setup.typoscript
1 = CONTENT
1.table = tt_content
1.select {
   pidInList = this
   orderBy = sorting
   where = {#colPos}=0
}
Copied!

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.

Apply special rendering

Here is an example of record-rendering objects:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.typeNum = 0

# The CONTENT object executes a database query and loads the content.
page.10 = CONTENT
page.10.table = tt_content
page.10.select {

   # "sorting" is a column from the tt_content table and
   # keeps track of the sorting order, which was specified in
   # the backend.
   orderBy = sorting

   # Only select content from column "0" (the column called
   # "normal") and quote the database identifier (column name)
   # "colPos" (indicated by wrapping with {#})
   where = {#colPos}=0
}

# For every result line from the database query (that means for every content
# element) the renderObj is executed and the internal data array is filled
# with the content. This ensures that we can call the .field property and we
# get the according value.
page.10.renderObj = COA
page.10.renderObj {

   10 = TEXT

   # The field tt_content.header normally holds the headline.
   10.stdWrap.field = header

   10.stdWrap.wrap = <h1>|</h1>

   20 = TEXT

   # The field tt_content.bodytext holds the content text.
   20.stdWrap.field = bodytext

   20.stdWrap.wrap = <p>|</p>
}
Copied!

EXTBASEPLUGIN

The content object EXTBASEPLUGIN allows to render Extbase plugins.

Properties

cache

cache
Type
cache

See cache function description for details.

extensionName

extensionName
Type
string

pluginName

pluginName
Type
string

The plugin name.

Example: Display an Extbase plugin via TypoScript

EXT:my_extension/Configuration/TypoScript/setup.typoscript
page.10 = EXTBASEPLUGIN
page.10.extensionName = MyExtension
page.10.pluginName = MyPlugin
Copied!

Example: Display an Extbase plugin in a Fluid template

It is possible to display an Extbase plugin in Fluid using the CObject ViewHelper <f:cObject>:

EXT:my_extension/Resources/Private/Templates/Pages/SomeTemplate.html
<!-- ... -->
<f:cObject
        typoscriptObjectPath="lib.myPlugin"
        data="{someValue: page.pageRecord.someValue, someSetting: site.someSetting}"
/>
Copied!

Create a lib object which utilizes the EXTBASEPLUGIN into a lib object:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
lib.myPlugin = EXTBASEPLUGIN
lib.myPlugin {
    extensionName = MyExtension
    pluginName = MyPlugIn1
    settings.detailPid = 42
}
Copied!

For extensionName and pluginName use the names as configured in \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin():

EXT:my_extension/ext_localconf.php
<?php

use MyVendor\MyExtension\Controller\MyController;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

defined('TYPO3') || die('Access denied.');

ExtensionUtility::configurePlugin(
    'MyExtension',
    'MyPlugIn1',
    [MyController::class => 'list, show'],
    [],
    ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
Copied!

If you passed data to the ViewHelper, you can access the data in the controller's action by getting the currentContentObject from the request:

EXT:my_extension/Classes/Controller/MyController.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

class MyController extends ActionController
{
    public function listAction(): ResponseInterface
    {
        /** @var ContentObjectRenderer $contentObject */
        $contentObject = $this->request->getAttribute('currentContentObject');
        $dataFromTypoScript = $contentObject->data;
        $someValue = (int)($dataFromTypoScript['someValue'] ?? 0);
        $someSetting = $dataFromTypoScript['someSetting'] ?? '';
        // Do something
        return $this->htmlResponse();
    }
}
Copied!

FILES

A content object of type FILES uses the File Abstraction Layer (FAL) and is used to display information about files.

Properties

cache

cache
Type
cache

See cache function description for details.

files

files
Type
string / stdWrap

Comma-separated list of sys_file UIDs, which are loaded into the FILES object.

Example:

page.10 = FILES
page.10.files = 12,15,16
Copied!

references

references
Type
string / stdWrap or array

Provides a way to load files from a file field (of type IRRE with sys_file_reference as child table). You can either provide a UID or a comma-separated list of UIDs from the database table sys_file_reference or you have to specify a table, uid and field name in the according sub-properties of "references". See further documentation of these sub-properties in the table below.

Examples:

references = 27,28
Copied!

This will get the items from the database table sys_file_reference with the UIDs 27 and 28.

references {
  table = tt_content
  uid = 256
  fieldName = image
}
Copied!

This will fetch all relations to the image field of the tt_content record "256".

references {
  table = pages
  uid.data = page:uid
  fieldName = media
}
Copied!

This will fetch all items related to the page.media field.

collections

collections
Type
string / stdWrap

Comma-separated list of sys_file_collection UIDs, which are loaded into the FILES object.

folders

folders
Type
string / stdWrap

Comma-separated list of combined folder identifiers which are loaded into the FILES object.

A combined folder identifier looks like this: [storageUid]:[folderIdentifier].

The first part is the UID of the storage and the second part the identifier of the folder. The identifier of the folder is often equivalent to the relative path of the folder.

The property folders has the option recursive to get files recursively.

Example:

page.10 = FILES
page.10.folders = 2:mypics/,4:myimages/
Copied!

Example for option recursive:

filecollection = FILES
filecollection {
   folders = 1:images/
   folders.recursive = 1

   renderObj = IMAGE
   renderObj {
      file.import.data = file:current:uid
   }
}
Copied!

sorting

sorting
Type
string / stdWrap

Name of the field, which should be used to sort the files.

sorting.direction

sorting.direction
Type
string / stdWrap
Default
asc

The direction, in which the files should be sorted. Possible values are "asc" for ascending and "desc" for descending.

begin

begin
Type
integer / stdWrap

The first item to return. If not set (default), items beginning with the first one are returned.

maxItems

maxItems
Type
integer / stdWrap

Maximum number of items to return. If not set (default), all items are returned. If Properties and Properties together exceed the number of available items, no items beyond the last available item will be returned.

renderObj

renderObj
Type
cObject +optionSplit

The cObject used for rendering the files. It is executed once for every file. Note that during each execution you can find information about the current file using the getText property "file" file with the "current" keyword. Look there to find out which properties of the file are available.

Example:

page.10.renderObj = TEXT
page.10.renderObj {
  stdWrap.data = file:current:size
  stdWrap.wrap = <p>File size:<strong>|</strong></p>
}
Copied!

This returns the size of the current file.

stdWrap

stdWrap
Type
->stdWrap

Special key: "references"

references.table

references.table
Type
string / stdWrap

The table name of the table having the file field.

references.uid

references.uid
Type
integer / stdWrap

The UID of the record from which to fetch the referenced files.

references.fieldName

references.fieldName
Type
string / stdWrap

Field name of the file field in the table.

Examples

Usage with files

In this example, we first load files using several of the methods explained above (using sys_file UIDs, collection UIDs, and folders). Then we use the TEXT cObject as Properties to output the file size of all files that were found:

page.10 = FILES

page.10.files = 12,15,16
page.10.collections = 2,9
page.10.folders = 1:mypics/

page.10.renderObj = TEXT
page.10.renderObj {
    stdWrap.data = file:current:size
    stdWrap.wrap = <p>File size: <strong>|</strong></p>
}
Copied!

Usage with references

In this second example, we use "references" to get the images related to a given page (in this case, the current page). We start with the first image and return up to five images. Each image is then rendered as an IMAGE cObject with some meta data coming from the file itself or from the reference to it (title):

page.20 = FILES
page.20 {
    references {
        table = pages
        uid.data = tsfe:id
        fieldName = media
    }

    begin = 0
    maxItems = 5

    renderObj = IMAGE
    renderObj {
        file.import.dataWrap = {file:current:storage}:{file:current:identifier}
        altText.data = file:current:title
        wrap = <div class="slide">|</div>
    }
    stdWrap.wrap = <div class="carousel">|</div>
}
Copied!

Usage with sliding

One usual feature is to use images attached to pages and use them up and down the page tree, a process called "sliding".

lib.banner = FILES
lib.banner {
    references {
        data = levelmedia: -1, slide
    }

    renderObj = IMAGE
    renderObj {
        file.import.dataWrap = {file:current:storage}:{file:current:identifier}
        altText.data = file:current:title
        wrap = <div class="banner">|</div>
    }
}
Copied!

FLUIDTEMPLATE

An object of type FLUIDTEMPLATE combines TypoScript with the Fluid templating engine.

A FLUIDTEMPLATE object generates content using Fluid templates. It can be used in content elements or to generate content in the top-level page object (see the example on this page).

New in version 13.1

Data available in Fluid templates

New in version 13.2

The following data is available in the Fluid template:

  • The content of the current data array.

    • At page level it contains the current page record.
    • If the FLUIDTEMPLATE is used in the context of the Fluid ViewHelper CObject ViewHelper <f:cObject> it contains data in the Fluid Property data.
    • If called in the context of Extbase it contains the data assigned to the view in the Controller.
    • Use the record-transformation data processor to get additional computed information from the data array.
  • The settings array set by the parameter settings
  • Variables in the variables setting
  • Data retrieved by data processors

You can use the debug ViewHelper to output all available data using the magic {_all} variable:

<f:debug>{_all}</f:debug>
Copied!

Properties

cache

cache
Type
cache

See cache function description for details.

dataProcessing

dataProcessing
Type
array of class references by full namespace

Add one or more processors to manipulate the $data variable of the currently rendered content object, such as tt_content or page. Use the sub-property options to pass parameters to the processor class.

extbase.controllerActionName

extbase.controllerActionName
Type
string / stdWrap

Sets the name of the action.

extbase.controllerExtensionName

extbase.controllerExtensionName
Type
string / stdWrap

Sets the extension name of the controller.

extbase.controllerName

extbase.controllerName
Type
string / stdWrap

Sets the name of the controller.

extbase.pluginName

extbase.pluginName
Type
string / stdWrap

Sets variables for initializing extbase.

file

file
Type
string / stdWrap

The fluid template file. It is an alternative to ".template" and is used only if ".template" is not set.

Example
EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        file = EXT:my_sitepackage/Resources/Private/Templates/Page/MyTemplate.html
    }
}
Copied!

format

format
Type
keyword / stdWrap
Default
html

format sets the format of the current request. It can be something like "html", "xml", "png", "json" or even "rss.xml" or something similar.

layoutRootPath

layoutRootPath
Type
path / stdWrap

Sets a specific layout path, usually EXT:my_extension/Resources/Private/Layouts/ or a folder below that path.

layoutRootPaths

layoutRootPaths
Type
array of path with stdWrap

Used to define several paths for layouts, which will be tried in reversed order (the paths are searched from bottom to top). The first folder where the desired layout is found is used. If the array keys are numeric, they are first sorted and then tried in reversed order.

Example
EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        file = EXT:my_sitepackage/Resources/Private/Templates/Main.html
        layoutRootPaths {
            10 = EXT:my_base_sitepackage/Resources/Private/Layouts
            20 = EXT:my_sitepackage/Resources/Private/Layouts
        }
    }
}
Copied!

If property layoutRootPath (singular) is also used, it will be placed as the first option in the list of fall back paths.

partialRootPath

partialRootPath
Type
path / stdWrap

Sets a specific partial path, usually EXT:my_extension/Resources/Private/Partials/ or a folder below that path.

partialRootPaths

partialRootPaths
Type
array of path with stdWrap

Used to define several paths for partials, which will be tried in reverse order. The first folder where the desired partial is found is used. The keys of the array define the order.

See layoutRootPaths for more details.

settings

settings
Type
array of keys

Sets the settings array in the fluid template. The value can then be used in the view.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        file = EXT:site_default/Resources/Private/Templates/MyTemplate.html
        settings {
            copyrightYear = 2013
        }
    }
}
Copied!

To access copyrightYear in the template file use:

{settings.copyrightYear}
Copied!

Apart from setting a key-value pair as in the example, you can also reference objects or access constants.

stdWrap

stdWrap
Type
->stdWrap

Provides the usual stdWrap functionality.

template

template
Type
cObject

Use this property to define the content object which should be used as a template file. It is an alternative to ".file"; if ".template" is set, it takes precedence.

templateName

templateName
Type
string / stdWrap

This name is used together with the set format to find the template in the templateRootPaths. Use this property to define a content object to use as a template file. It is an alternative to .file. If .templateName is set, it takes precedence.

Example 1
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.stdContent = FLUIDTEMPLATE
lib.stdContent {
    templateName = Default
    layoutRootPaths {
        10 = EXT:frontend/Resources/Private/Layouts
        20 = EXT:sitemodification/Resources/Private/Layouts
    }
    partialRootPaths {
        10 = EXT:frontend/Resources/Private/Partials
        20 = EXT:sitemodification/Resources/Private/Partials
    }
    templateRootPaths {
        10 = EXT:frontend/Resources/Private/Templates
        20 = EXT:sitemodification/Resources/Private/Templates
    }
    variables {
        foo = TEXT
        foo.value = bar
    }
}
Copied!
Example 2
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.stdContent = FLUIDTEMPLATE
lib.stdContent {
    templateName = TEXT
    templateName.stdWrap {
        cObject = TEXT
        cObject {
            data = levelfield:-2,backend_layout_next_level,slide
            override.field = backend_layout
            split {
                token = frontend__
                1.current = 1
                1.wrap = |
            }
        }
        ifEmpty = Default
    }
    layoutRootPaths {
        10 = EXT:frontend/Resources/Private/Layouts
        20 = EXT:sitemodification/Resources/Private/Layouts
    }
    partialRootPaths {
        10 = EXT:frontend/Resources/Private/Partials
        20 = EXT:sitemodification/Resources/Private/Partials
    }
    templateRootPaths {
        10 = EXT:frontend/Resources/Private/Templates
        20 = EXT:sitemodification/Resources/Private/Templates
    }
    variables {
        foo = bar
    }
}
Copied!

templateRootPath

templateRootPath
Type
file path /stdWrap

Sets a specific template path, usually EXT:my_extension/Resources/Private/Templates/ or a folder below that path.

templateRootPaths

templateRootPaths
Type
array of file paths with stdWrap

Used to define several paths for templates, which will be tried in reverse order (the paths are searched from bottom to top). The first folder where the desired layout is found is used. If the array keys are numeric, they are first sorted and then tried in reverse order.

Useful in combination with the templateName property.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
page {
    10 = FLUIDTEMPLATE
    10 {
        templateName = Default
        templateRootPaths {
            10 = EXT:sitedesign/Resources/Private/Templates
            20 = EXT:sitemodification/Resources/Private/Templates
        }
    }
}
Copied!

variables

variables
Type
(array of cObjects)

Sets the variables that will be available in the fluid template. The keys are the variable names in Fluid.

Reserved variables are "data" and "current", which are set automatically to the current data set.

Example: Usage with RecordTransformationProcessor

New in version 13.2

The record-transformation data processor transforms the current data array of the FLUIDTEMPLATE to a record object.

This can be used for content elements of Fluid Styled Content or custom ones. In this example the Fluid Styled Content element "Text" has its data transformed for easier and enhanced usage.

EXT:my_extension/Configuration/TypoScript/setup.typoscript
# tt_content.text = FLUIDTEMPLATE
tt_content.text {
  templateName = Text
  dataProcessing {
    10 = record-transformation
    10 {
      as = data
    }
  }
}
Copied!

For usage of the variables within Fluid see Example: Usage with FLUIDTEMPLATE.

Example

New in version 13.1

The Fluid template in EXT:my_sitepackage/Resources/Private/Templates/MyTemplate.html could look like this:

EXT:my_sitepackage/Resources/Private/Templates/MyTemplate.html
<h1>{data.title}<f:if condition="{data.subtitle}">, {data.subtitle}</f:if></h1>
<h3>{mylabel}</h3>
<f:format.html>{data.bodytext}</f:format.html>
<p>&copy; {settings.copyrightYear}</p>
Copied!

You could use it with TypoScript code like this:

Before migration, EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
    templateName = MyTemplate
    templateRootPaths {
        10 = EXT:my_sitepackage/Resources/Private/Templates
    }
    partialRootPaths {
        10 = EXT:my_sitepackage/Resources/Private/Partials
    }
    variables {
        mylabel = TEXT
        mylabel.value = Label coming from TypoScript!
    }
    settings {
        # Get the copyright year from a TypoScript constant.
        copyrightYear = {$year}
    }
}
Copied!

As a result, the page title and the label from TypoScript will be inserted as titles. The copyright year will be taken from the TypoScript constant "year".

Migration from FLUIDTEMPLATE to PAGEVIEW

Before migration, EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        templateName = TEXT
        templateName {
            stdWrap {
                cObject = TEXT
                cObject {
                    data = levelfield:-2, backend_layout_next_level, slide
                    override {
                        field = backend_layout
                    }

                    split {
                        token = pagets__
                        1 {
                            current = 1
                            wrap = |
                        }
                    }
                }

                ifEmpty = Standard
            }
        }

        templateRootPaths {
            100 = EXT:my_sitepackage/Resources/Private/Templates/Pages/
        }

        partialRootPaths {
            100 = EXT:my_sitepackage/Resources/Private/Partials/Pages/
        }

        layoutRootPaths {
            100 = EXT:my_sitepackage/Resources/Private/Layouts/Pages/
        }

        variables {
            pageUid = TEXT
            pageUid.data = page:uid

            pageTitle = TEXT
            pageTitle.data = page:title

            pageSubtitle = TEXT
            pageSubtitle.data = page:subtitle

            parentPageTitle = TEXT
            parentPageTitle.data = levelfield:-1:title
        }

        dataProcessing {
            10 = menu
            10.as = mainMenu
        }
    }
}
Copied!
After migration, EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths {
            100 = EXT:my_sitepackage/Resources/Private/PageView/
        }
        variables {
            parentPageTitle = TEXT
            parentPageTitle.data = levelfield:-1:title
        }
        dataProcessing {
            10 = menu
            10.as = mainMenu
        }
    }
}
Copied!

In Fluid, the pageUid is available as {page.uid} and pageTitle as {page.title}, the subtitle with {page.subtitle}.

In this example some Fluid templates have to be moved:

EXT:my_sitepackage/Resources/Private/Templates/Pages/
Move files to EXT:my_sitepackage/Resources/Private/PageView/Pages/
EXT:my_sitepackage/Resources/Private/Partials/Pages/
Move files to EXT:my_sitepackage/Resources/Private/PageView/Partials/
EXT:my_sitepackage/Resources/Private/Layouts/Pages/
Move files to EXT:my_sitepackage/Resources/Private/PageView/Layouts/

If the Private folder previously looked like this:

  • EXT:my_sitepackage/Resources/Private/

    • Languages
    • Layouts

      • Pages
    • Partials

      • Pages
    • Templates

      • Pages

It should look like this afterwards:

  • EXT:my_sitepackage/Resources/Private/

    • Languages
    • PageView

      • Layouts
      • Pages
      • Partials

HMENU

Objects of type HMENU generate hierarchical menus. In a FLUIDTEMPLATE the HMENU can be used as a DataProcessor called MenuProcessor, which internally uses the HMENU functionality.

The cObject HMENU allows you to define the global settings of the menu as a whole. For the rendering of the single menu levels, different menu objects can be used.

Apart from creating a hierarchical menu of the pages as they are structured in the page tree, HMENU also allows you to use the .special property to create special menus. These special menus take characteristics of special menu types into account.

Properties

Name Type
menu object
integer
cache
integer / stdWrap
"directory" / "list" / "updated" / "rootline" / "browse" / "keywords" / "categories" / "language" / "userfunction"
list of page-uid's / stdWrap
integer / stdWrap
integer / stdWrap
integer / stdWrap +calc
list of integer / stdWrap
list of integer
boolean / stdWrap
list of integer /stdWrap
boolean / keyword
->if
wrap / stdWrap
->stdWrap

1, 2, 3, ...

1, 2, 3, ...
Type
menu object
Default
(no menu)

For every menu level, that should be rendered, an according entry must exist. It defines the menu object that should render the menu items on the according level. 1 is the first level, 2 is the second level, 3 is the third level and so on.

The property "1" is required!

The entry 1 for the first level always must exist. All other levels only will be generated when they are configured.

TYPO3 offers the menu object TMENU.

cache_period

cache_period
Type
integer

The number of seconds a menu may remain in cache. If this value is not set, the first available value of the following will be used:

  1. cache_timeout of the current page
  2. config.cache_period defined globally
  3. 86400 (= 1 day)

cache

cache
Type
cache

See cache function description for details.

entryLevel

entryLevel
Type
integer / stdWrap
Default
0

Defines at which level in the rootLine the menu should start.

special

special
Type
"directory" / "list" / "updated" / "rootline" / "browse" / "keywords" / "categories" / "language" / "userfunction"

Lets you define special types of menus.

See the section about the .special property!

special.value

special.value
Type
list of page-uid's / stdWrap

List of page uid's to use for the special menu. What they are used for depends on the menu type as defined by ".special"; see the section about the .special property!

minItems

minItems
Type
integer / stdWrap

The minimum number of items in the menu. If the number of pages does not reach this level, a dummy-page with the title "..." and uid=[currentpage\_id] is inserted.

Note: Affects all sub menus as well. To set the value for each menu level individually, set the properties in the menu objects (see "Common properties" table).

maxItems

maxItems
Type
integer / stdWrap

The maximum number of items in the menu. Additional items will be ignored.

Note: Affects all sub menus as well. (See "minItems" for a notice.)

begin

begin
Type
integer / stdWrap +calc

The first item in the menu.

Note: Affects all sub menus as well. (See "minItems" for a notice.)

excludeUidList

excludeUidList
Type
list of integer / stdWrap

excludeDoktypes

excludeDoktypes
Type
list of integer
Default
6,254

includeNotInMenu

includeNotInMenu
Type
boolean / stdWrap

alwaysActivePIDlist

alwaysActivePIDlist
Type
list of integer /stdWrap

protectLvar

protectLvar
Type
boolean / keyword

if

if
Type
->if

If "if" returns false, the menu is not generated.

wrap

wrap
Type
wrap / stdWrap

Wrap for the HMENU.

stdWrap

stdWrap
Type
->stdWrap

(Executed after ".wrap".)

For examples on how to use the HMENU please refer to old version of this document, for example HMENU

TMENU

For examples on how to use the TMENU please refer to old version of this document, for example TMENU-.

TMENU item states

These properties are all the item states used by TMENU.

The following Item states are listed from the least to the highest priority:

NO

NO
Type
boolean / TMENUITEM
Default
1 (true)

The default "Normal" state rendering of Item. This is required for all menus.

IFSUB

IFSUB
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for menu items which has subpages.

ACT

ACT
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for menu items which are found in the rootLine.

ACTIFSUB

ACTIFSUB
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for menu items which are found in the rootLine and have subpages.

CUR

CUR
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for a menu item if the item is the current page.

CURIFSUB

CURIFSUB
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for a menu item if the item is the current page and has subpages.

USR

USR
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for menu items which are access restricted pages that a user has access to.

SPC

SPC
Type
boolean / TMENUITEM
Default
0

Enable/Configuration for 'Spacer' pages.

Spacers are pages of the doktype "Spacer". These are not viewable pages but "placeholders" which can be used to divide menu items.

USERDEF1

USERDEF1
Type
boolean / TMENUITEM

User-defined, see itemArrayProcFunc for details on how to use this.

You can set the ITEM_STATE values USERDEF1 and USERDEF2 (+...RO) from a script/user function processing the menu item array. See the property itemArrayProcFunc of the menu objects.

USERDEF2

USERDEF2
Type
boolean / TMENUITEM

Same like USERDEF1 but has a higher priority.

Properties

expAll

expAll
Type
boolean / stdWrap

If this is true, the menu will always show the menu on the level underneath the menu item. This corresponds to a situation where a user has clicked a menu item and the menu folds out the next level. This can enable that to happen on all items as default.

sectionIndex

sectionIndex
Type
boolean

If this property is set, then the menu will not consist of links to pages on the "next level" but rather of links to the parent page to the menu, and in addition "#"-links to the cObjects rendered on the page. In other words, the menu items will be a section index with links to the content elements on the page (by default with colPos=0!).

If you set this, all content elements (from tt_content table) of "Column" = "Normal" and the "Index"-check box clicked are selected. This corresponds to the "Menu/Sitemap" content element when "Section index" is selected as type.

sectionIndex.type

sectionIndex.type
Type
string ("all" / "header")
"all"
The "Index"-checkbox is not considered and all content elements - by default with colPos=0 - are selected.
"header"
Only content elements with a visible header-layout (and a non-empty 'header'-field!) are selected. In other words, if the header layout of an element is set to "Hidden" then the page will not appear in the menu.

sectionIndex.includeHiddenHeaders

sectionIndex.includeHiddenHeaders
Type
boolean

If you set this and sectionIndex.type is set to "header", also elements with a header layout set to "Hidden" will appear in the menu.

sectionIndex.useColPos

sectionIndex.useColPos
Type
integer / stdWrap
Default
0

This property allows you to set the colPos which should be used in the where clause of the query. Possible values are integers, default is "0".

Any positive integer and 0 will lead to a where clause containing "colPos=x" with x being the aforementioned integer. A negative value drops the filter "colPos=x" completely.

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.menu.20.3.1.sectionIndex.useColPos = -1
Copied!

target

target
Type
string
Default
self

Target of the menu links

forceTypeValue

forceTypeValue
Type
integer

If set, the &type parameter of the link is forced to this value regardless of target.

stdWrap

stdWrap
Type
stdWrap

Wraps the whole block of sub items.

wrap

wrap
Type
wrap

Wraps the whole block of sub items, but only if there were items in the menu!

IProcFunc

IProcFunc
Type
function name

The internal array "I" is passed to this function and expected returned as well. Subsequent to this function call the menu item is compiled by implode()'ing the array $I[parts] in the passed array. Thus you may modify this if you need to.

alternativeSortingField

alternativeSortingField
Type
string

Normally the menu items are sorted by the fields "sorting" in the pages- and tt_content-table. Here you can enter a list of fields that is used in the SQL- "ORDER BY" statement instead. You can also provide the sorting order.

Limitations:

This property works with normal menus, sectionsIndex menus and special-menus of type "directory".

minItems

minItems
Type
integer / stdWrap

The minimum items in the menu. If the number of pages does not reach this level, a dummy-page with the title "..." and uid=[currentpage_id] is inserted.

Takes precedence over HMENU property .

maxItems

maxItems
Type
integer / stdWrap

The maximum items in the menu. More items will be ignored.

Takes precedence over HMENU property .

begin

begin
Type
integer / stdWrap +calc

The first item in the menu.

debugItemConf

debugItemConf
Type
boolean

Outputs (by the debug() function) the configuration arrays for each menu item. Useful to debug optionSplit things and such...

overrideId

overrideId
Type
integer (page id)

If set, then all links in the menu will point to this pageid. Instead the real uid of the page is sent by the parameter "&real_uid=[uid]".

This feature is smart, if you have inserted a menu from somewhere else, perhaps a shared menu, but wants the menu items to call the same page, which then generates a proper output based on the real_uid.

addParams

addParams
Type
string

Additional parameter for the menu links.

Must be rawurlencoded.

showAccessRestrictedPages

showAccessRestrictedPages
Type
integer (page ID) / keyword "NONE"

If set, pages in the menu will include pages with frontend user group access enabled. However the page is of course not accessible and therefore the URL in the menu will be linked to the page with the ID of this value. On that page you could put a login form or other message.

If the value is "NONE" the link will not be changed and the site will perform page-not-found handling when clicked (which can be used to capture the event and act accordingly of course). This means that the link's URL will point to the page even if it is not accessible by the current frontend user. Note that the default behavior of page-not-found handling is to show the parent page instead.

Properties:

.addParam: Additional parameter for the URL, which can hold two markers; ###RETURN_URL### which will be substituted with the link the page would have had if it had been accessible and ###PAGE_ID### holding the page ID of the page coming from (could be used to look up which fe_groups was required for access.

.ATagParams: Add custom attributes to the anchor tag.

additionalWhere

additionalWhere
Type
string / stdWrap

Adds an additional part to the WHERE clause for this menu. Make sure to start the part with "AND "!

itemArrayProcFunc

itemArrayProcFunc
Type
function name

The first variable passed to this function is the "menuArr" array with the menu items as they are collected based on the type of menu.

You're free to manipulate or add to this array as you like. Just remember to return the array again!

Note:

.parentObj property is hardcoded to be a reference to the calling typo3/sysext/frontend/Classes/ContentObject/Menu/ object. Here you'll find e.g. ->id to be the uid of the menu item generating a submenu and such.

Presetting element state

You can override element states like SPC, IFSUB, ACT, CUR or USR by setting the key ITEM_STATE in the page records.

submenuObjSuffixes

submenuObjSuffixes
Type
string / optionSplit

Defines a suffix for alternative sub-level menu objects.

TMENUITEM

For examples on how to use the TMENUITEM please refer to old version of this document, for example TMENUITEM-.

The current record is the page record of the menu item. If you would like to get data from the current menu item's page record, use stdWrap.data = field : [field name].

Properties

allWrap

allWrap
Type
Wrap / stdWrap

Wraps the whole item.

wrapItemAndSub

wrapItemAndSub
Type
Wrap / stdWrap

Wraps the whole item and any submenu concatenated to it.

subst_elementUid

subst_elementUid
Type
boolean
Default
0 (false)

If set, all appearances of the string '{elementUid}' in the HTML code of the element (after wrapped in .allWrap) are substituted with the UID number of the menu item.

This is useful, if you want to insert an identification code in the HTML in order to manipulate properties with JavaScript.

before

before
Type
HTML / stdWrap

beforeWrap

beforeWrap
Type
Wrap

Wrap around the .before code.

after

after
Type
HTML / stdWrap

afterWrap

afterWrap
Type
Wrap

Wrap around the .after code.

linkWrap

linkWrap
Type
Wrap

stdWrap

stdWrap
Type
stdWrap

stdWrap to the link text.

ATagBeforeWrap

ATagBeforeWrap
Type
boolean
Default
0 (false)

If set, the link is first wrapped with *.linkWrap* and then the <a> tag.

ATagParams

ATagParams
Type
<A>-params / stdWrap

Additional parameters

ATagTitle

ATagTitle
Type
string / stdWrap

Allows you to specify the "title" attribute of the <a> tag around the menu item.

additionalParams

additionalParams
Type
string / stdWrap

Define parameters that are added to the end of the URL. This must be code ready to insert after the last parameter.

For details, see typolink->additionalParams.

doNotLinkIt

doNotLinkIt
Type
boolean / stdWrap
Default
0

If set, the link texts are not linked at all.

doNotShowLink

Type
boolean / stdWrap
Default
0

If set, the text will not be shown at all (smart with spacers).

stdWrap2

stdWrap2
Type
Wrap / stdWrap
Default
|

stdWrap to the total link text and <a> tag. (Notice that the plain default value passed to the stdWrap function is "|".)

altTarget

altTarget
Type
string

Alternative target overriding the target property of the ref:TMENU <tmenu>, if set.

allStdWrap

allStdWrap
Type
stdWrap

stdWrap of the whole item.

IMAGE

Objects of type IMAGE return an image tag with the image file defined in the property "file" and is processed using the properties that are set on the object.

Note: Gifbuilder also has an IMAGE object - it is not the same as the cObject described here; both are completely different objects.

If you only need the file path to the image; regardless of whether it's been resized, the cObject IMG_RESOURCE will return the file path.

Properties

cache

cache
Type
cache

See cache function description for details.

if

if
Type
->if

If "if" returns false, the image is not shown!

file

file
Type
->imgResource

params

params
Type
string / stdWrap

HTML <IMG> parameters

altText

altText
Type
string / stdWrap

If no alt text is specified, an empty alt text will be used.

titleText

titleText
Type
string / stdWrap

emptyTitleHandling

emptyTitleHandling
Type
string / stdWrap
Default
useAlt

Value can be "keepEmpty" to preserve an empty title attribute, or "useAlt" to use the alt attribute instead.

layoutKey

layoutKey
Type
string / stdWrap
Default
default

Defines the render layout for the IMAGE. The render layout is the HTML Code for the IMAGE itself. Default values include default, srcset, picture, data. Each option represents a different solution to render the HTML Code of the IMAGE. The default code renders the img-tag as a plain html tag with the different attributes.

When implementing a responsive layout you need different image sizes for the different displays and resolutions of your layout. Depending on the HTML framework, the capabilities of desired browsers and the used javascript library for progressive enhancement you can choose either one of the predefined layouts or you can define a new layout of your own by adding an additional layout key.

If you don't have a responsive HTML layout you should use the default layout.

  • default renders a normal non-responsive image as a <img> tag:

    <img src="###SRC###"
         width="###WIDTH###"
         height="###HEIGHT###" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###>
    Copied!
  • srcset renders an image tag pointing to a set of images for the different resolutions. They are referenced inside the srcset attribute the <img> tag for each defined resolution. Each image is actually rendered by TYPO3. Srcset is a proposed addition to HTML5 (https://www.w3.org/TR/html-srcset/).

    <img src="###SRC###"
         srcset="|*|###SRC### ###SRCSETCANDIDATE###,|*|###SRC### ###SRCSETCANDIDATE###" ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###>
    Copied!
  • picture renders a picture tag containing source tags for each resolution and an <img> tag for the default image.

    <picture>
       <source srcset="###SRC###"
               media="###MEDIAQUERY###"###SELFCLOSINGTAGSLASH###>
       <img src="###SRC###" ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###>
    </picture>
    Copied!
  • data renders an image tag containing data-keys for the different resolutions:

    <img src="###SRC###"
         data-###DATAKEY###="###SRC###" ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###>
    Copied!

layout

layout
Type
array

HTML code definition for the different Properties.

layout.layoutKey

layout.layoutKey
Type
array

Definition for the HTML rendering for the named Properties. Depending on your needs you can use the existing pre-defined layoutKey or you can define your own element for your responsive layout.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
picture {
  element = <picture>###SOURCECOLLECTION###<img src="###SRC###" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###></picture>
  source = <source srcset="###SRC###" media="###MEDIAQUERY###" ###SELFCLOSINGTAGSLASH###>
}
Copied!

layout.layoutKey.element

layout.layoutKey.element
Type
string

The outer element definition for the HTML rendering of the image. Possible markers are mainly all parameters which can be defined in the IMAGE object, e.g.:

  • ###SRC### the file URL for the src attribute
  • ###WIDTH### the width of the image for the width tag (only the width value)
  • ###HEIGHT### the height of the image for the height tag (only the width value)
  • ###PARAMS### additional params defined in the IMAGE object (as complete attribute)
  • ###ALTPARAMS### additional alt params defined in the IMAGE object (as complete attribute)
  • ###SELFCLOSINGTAGSLASH### renders the closing slash of the tag, depending on the setting of config.doctype
  • ###SOURCECOLLECTION### the additional sources of the image depending on the different usage in responsive webdesign. The definition of the sources is declared inside layout.layoutKey.source

layout.layoutKey.source

layout.layoutKey.source
Type
stdWrap

Defines the HTML code for the ###SOURCECOLLECTION### of the Properties. Possible markers in the out of the box configuration are:

  • ###SRC### the file URL for the src attribute
  • ###WIDTH### the width of the image for the width tag (only the width value)
  • ###HEIGHT### the height of the image for the height tag (only the width value)
  • ###SELFCLOSINGTAGSLASH### renders the closing slash of the tag, depending on the setting of config.doctype
  • ###SRCSETCANDIDATE### is the value of the srcsetCandidate defined in each SourceCollection.DataKey
  • ###MEDIAQUERY### is the value of the mediaQuery defined in each SourceCollection.DataKey
  • ###DATAKEY### is the name of the dataKey defined in the sourceCollection

You can define additional markers by adding more datakeys to the collection. ###SRCSETCANDIDATE###, ###MEDIAQUERY###, ###DATAKEY### are already defined as additional datakeys in the out of the box typoscript. Thus can be overwritten by your typoscript.

sourceCollection

sourceCollection
Type
array

For responsive images you need different image resolutions for each output device and output mode (portrait vs. landscape). sourceCollection defines the different resolutions for image rendering, normally you would define at least one sourceCollection per layout breakpoint. The amount of sourceCollections, the name and the specification for the sourceCollections will be defined by the HTML/CSS/JS code you are using. The configuration of the sourceCollection defines the size of the image which is rendered.

Each resolution should be set up as separate array in the sourceCollection. Each sourceCollection consists of different dataKey properties which you can define to suit your needs.

EXT:site_package/Configuration/TypoScript/setup.typoscript
sourceCollection {
  small {
    width = 200

    srcsetCandidate = 600w
    mediaQuery = (max-device-width: 600px)
    dataKey = small
  }
  smallRetina {
    if.directReturn = 1

    width = 200
    pixelDensity = 2

    srcsetCandidate = 600w 2x
    mediaQuery = (max-device-width: 600px) AND (min-resolution: 192dpi)
    dataKey = smallRetina
  }
}
Copied!

sourceCollection.dataKey

sourceCollection.dataKey
Type
stdWrap

Definition of your image size definition depending on your responsive layout, breakpoints and display density.

sourceCollection.dataKey.if

sourceCollection.dataKey.if
Type
if

Renders only if the condition is met, this is evaluated before any execution of code.

sourceCollection.dataKey.pixelDensity

sourceCollection.dataKey.pixelDensity
Type
integer / stdWrap
Default
1

Defines the density of the rendered Image, e.g. a retina display would have a density of 2, the density is a multiplier for the image dimensions: If the pixelDensity is set to 2 and the width is set to 200 the generated image file will have a width of 400 but will be treated inside the html code as 200 pixels.

sourceCollection.dataKey.width

sourceCollection.dataKey.width
Type
stdWrap

Defines the width for the html code of the image defined in this source collection. For the image file itself the width will be multiplied by dataKey.pixelDensity.

sourceCollection.dataKey.height

sourceCollection.dataKey.height
Type
stdWrap

Defines the height for the html code of the image defined in this source collection. For the image file itself the height will be multiplied by dataKey.pixelDensity.

sourceCollection.dataKey.maxW

sourceCollection.dataKey.maxW
Type
stdWrap

Defines the maxW for the html code of the image defined in this source collection. For the image file itself the maxW will be multiplied by dataKey.pixelDensity.

sourceCollection.dataKey.maxH

sourceCollection.dataKey.maxH
Type
stdWrap

Defines the maxH for the html code of the image defined in this source collection. For the image file itself the maxH will be multiplied by dataKey.pixelDensity.

sourceCollection.dataKey.minW

sourceCollection.dataKey.minW
Type
stdWrap

Defines the minW for the html code of the image defined in this source collection. For the image file itself the minW will be multiplied by dataKey.pixelDensity.

sourceCollection.dataKey.minH

sourceCollection.dataKey.minH
Type
stdWrap

Defines the minH for the html code of the image defined in this source collection. For the image file itself the minH will be multiplied by dataKey.pixelDensity.

sourceCollection.dataKey.quality

sourceCollection.dataKey.quality
Type
integer

Defines the quality of the rendered images on a scale from 1-100.

sourceCollection.dataKey.*

sourceCollection.dataKey.*
Type
string

You can define additional key value pairs which won't be used for setting the image size, but will be available as additional markers for the image template. See the example mediaquery.

linkWrap

linkWrap
Type
Wrap / stdWrap

(before ".wrap")

imageLinkWrap

imageLinkWrap
Type
boolean / ->imageLinkWrap

Note: Only active if linkWrap is not set and file is not GIFBUILDER (as it works with the original image file).

wrap

wrap
Type
wrap / stdWrap

Wrap for the image tag.

stdWrap

stdWrap
Type
->stdWrap

Examples

Standard rendering

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = IMAGE
# toplogo.png has the dimensions 300 x 150 pixels.
page.10 {
  file = fileadmin/toplogo.png
  params = style="margin: 0px 20px;"
  wrap = |<br>
}
Copied!

This returns:

<img src="/fileadmin/toplogo.png"
     width="300"
     height="150"
     style="margin: 0px 20px;"
     alt=""><br>
Copied!

Responsive/adaptive rendering

EXT:site_package/Configuration/TypoScript/setup.typoscript
30 = IMAGE
30 {
  file = fileadmin/imagefilenamename.jpg
  file.width = 100

  layoutKey = default
  layout {

    default {
      element = <img src="###SRC###" width="###WIDTH###" height="###HEIGHT###" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###>
      source =
    }

    srcset {
      element = <img src="###SRC###" srcset="###SOURCECOLLECTION###" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###>
      source = |*|###SRC### ###SRCSETCANDIDATE###,|*|###SRC### ###SRCSETCANDIDATE###
    }

    picture {
      element = <picture>###SOURCECOLLECTION###<img src="###SRC###" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###></picture>
      source = <source srcset="###SRC###" media="###MEDIAQUERY###" ###SELFCLOSINGTAGSLASH###>
    }

    data {
      element = <img src="###SRC###" ###SOURCECOLLECTION### ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###>
      source.noTrimWrap = | data-###DATAKEY###="###SRC###"|
    }
  }

  sourceCollection {
    small {
      width = 200

      srcsetCandidate = 800w
      mediaQuery = (min-device-width: 800px)
      dataKey = small
    }
    smallHires {
      if.directReturn = 1
      width = 300
      pixelDensity = 2

      srcsetCandidate = 800w 2x
      mediaQuery = (min-device-width: 800px) AND (foobar)
      dataKey = smallHires
      pictureFoo = bar
    }
  }
}
40 < 30
40.layoutKey = data
50 < 30
50.layoutKey = picture
60 < 30
60.layoutKey = srcset
Copied!

This returns as an example all per default possible HTML output:

<img src="/fileadmin/_processed_/imagefilenamename_595cc36c48.png"
     width="600" height="423" alt="">
<img src="/fileadmin/_processed_/imagefilenamename_595cc36c48.png"
     data-small="/fileadmin/_processed_/imagefilenamename_595cc36c48.png"
     data-smallRetina="/fileadmin/_processed_/imagefilenamename_42fb68d642.png"
     alt="">
<picture>
  <source srcset="/fileadmin/_processed_/imagefilenamename_595cc36c48.png"
          media="(max-device-width: 600px)">
  <source srcset="/fileadmin/_processed_/imagefilenamename_42fb68d642.png"
          media="(max-device-width: 600px) AND (min-resolution: 192dpi)">
  <img src="/fileadmin/_processed_/imagefilenamename_595cc36c48.png"
       alt="">
</picture>
<img src="/fileadmin/_processed_/imagefilenamename_595cc36c48.png"
     srcset="/fileadmin/_processed_/imagefilenamename_595cc36c48.png 600w,
             /fileadmin/_processed_/imagefilenamename_42fb68d642.png 600w 2x"
     alt="">
Copied!

GIFBUILDER

GIFBUILDER is an object type, which is used in many situations for creating image files (for example, GIF, PNG or JPG). Wherever the ->GIFBUILDER object type is mentioned, these are the properties that apply.

Using TypoScript, you can define a "numerical array" of GIFBUILDER objects (like TEXT, IMAGE, etc.) and they will be rendered onto an image one by one.

The name GIFBUILDER comes from the time when GIF was the only supported file format. PNG and JPG can be created as well today (configured with $TYPO3_CONF_VARS['GFX']).

Table of Contents:

Examples

Using the AVIF format

New in version 13.3

AVIF is an image format, that is supported by most modern browsers, and usually has a better compression (= smaller file size) than jpg files.

EXT:config/sites/my_site/setup.typoscript
page.10 = IMAGE
page.10 {
  file = GIFBUILDER
  file {
    backColor = yellow
    XY = 1024,199
    format = avif
    quality = 44
    speed = 1

    10 = IMAGE
    10.offset = 10,10
    10.file = 1:/my-image.jpg
  }
}
Copied!

Masking semi-transparent images (Logos) onto other images

You can use the GIFBUILDER to overlay an image with another image using a transparency mask. You probably know PNG24. This file format supports an "alpha" channel ("matte" called in ImageMagick) which is another channel besides RGB and defines "how transparent" each pixel is.

The GDLib (even version 2) currently does not support it properly to overlay such an image over another one. The results are not very nice. But there is the possibility to use ImageMagick for this task.

In TYPO3 this is not done with a single image containing RGB and alpha channel to overlay but rather two separate images: The RGB image itself (overlay image) and 8-bit grayscale image defining the alpha-channel (Mask image).

To generate such an overlayed image with the GIFBUILDER you have to use code like the following:

lib.test = IMAGE
lib.test {
  file = GIFBUILDER
  file {
    XY = 1024,768
    format = jpg
    quality = 88

    10 = IMAGE
    10.file = fileadmin/backimage.jpg

    15 = IMAGE
    15.offset = 420,18
    15.file = fileadmin/overlay.png
    15.mask = fileadmin/mask.png
  }
}
Copied!

You will need a background image. Here "backimage.jpg". For example:

A background image

A background image

Then you will need an image to overlay over the original. It should have no alpha channel. The background does not care when it gets masked away by the mask.

An overlay image

An overlay image

And as last thing you will need the transparency mask. It depends on your Image Magick version and setting whether the black or the white areas will be completely transparent or not. Here is an example of an image mask and inversion of it:

A normal mask

A normal mask

And here the inversed:

An inversed mask

An inversed mask

The resulting masked image will look like:

Resulting masked image

Resulting masked image

You can create the mask from a colored file using the ImageMagick command -colorspace GRAY. You can negate it by adding the command -negate. But this tasks can also be done with every better image manipulation tool (for example, GIMP).

How to create a mask from an alpha-layer PNG

If your designer supplies you with a Photoshop file with transparency mask (or a PNG) you will have to extract the alpha channel information out of the image.

GIMP

Here are the required steps for GIMP:

  1. Open the alpha-layer PNG.
  2. Right click on Image (RCI) > Layer > Mask > Add Layer Mask: Select Layer's alpha channel.
  3. In the layer's dialog you see a little black/white thumb next to the Layer's thumb now. Click on the thumb of the colored image to select working on the image and not on the layer mask.
  4. Select everything (CTRL + A) cut everything (CTRL + K).
  5. Fill the image with black or white (only the masked regions will show up colored - the alpha layer mask).
  6. Insert a new layer and color it opposite of the filling (black or white). Move the layer to the correct position so it is below the just filled regions.
  7. Now you should have a black white image containing the mask from the alpha layer.
  8. You can invert the mask after you have flattened it using Filters > Colors > Value Invert.

ImageMagick

You can also use ImageMagick to separate the mask from the image (tested with ImageMagick version 6):

To extract the mask as greyscale 8-bit PNG, use the command:

convert alphaLayerPng.png  -channel matte -separate +channel -negate png8:mask.png
Copied!

To get the image without the alpha channel use the command:

convert alphaLayerPng.png  +matte image.png
Copied!

Creating (semi-transparent) boxes with transparent text

Using the GIFBUILDER you can also create images from photos and insert a box which could probably be semi-transparent so the background shines through, and insert some "transparent" letters which will let the background image shine through into the box.

Here is an example: It is done with an IMAGE cObject. Then you could retrieve the background image from the media field, for example.

The base image is the same as above. Below is the result - just see yourself:

lib.header = IMAGE
lib.header {
  file = GIFBUILDER
  file {
    XY = 640,480
    format = png

    10 = IMAGE
    10.file = fileadmin/backimage.jpg

    # Example 1, light gray box (#cccccc), no box transparency
    20 = IMAGE
    20 {
      offset = 50,50
      XY = [mask.W],40

      file = GIFBUILDER
      file {
        XY = 400,40
        # The color of the box
        backColor = #cccccc
      }

      mask = GIFBUILDER
      mask {
        XY = [10.w]+40,40
        # The transparency of the box:
        # #000000 = fully transparent like the text
        # #ffffff = nothing transparent at all
        backColor = #ffffff

        10 = TEXT
        10 {
          text = TYPO3 rulez !
          # The transparency of the text
          # Same rules as above
          fontColor = #000000
          fontSize = 20
          offset = 20,30
          fontFile = fileadmin/ALTdragon.ttf
        }
      }
    }

    # Example 2, light green box, half transparent
    30 = IMAGE
    30 {
      offset = 50,120
      XY = [mask.W],40

      file = GIFBUILDER
      file {
        XY = 400,40
        backColor = #66ff66
      }

      mask = GIFBUILDER
      mask {
        XY = [10.w]+40,40
        backColor = #808080

        10 = TEXT
        10 {
          text = TYPO3 rulez !
          fontColor = #000000
          fontSize = 20
          offset = 20,30
          fontFile = fileadmin/ALTdragon.ttf
        }
      }
    }

    # Example 2, light red box, no box transparency, bold + not antialiased text
    40 = IMAGE
    40 {
      offset = 50,190
      XY = [mask.W],40

      file = GIFBUILDER
      file {
        XY = 400,40
        backColor = #ff6666
      }

      mask = GIFBUILDER
      mask {
        XY = [10.w]+40,40
        backColor = #ffffff

        10 = TEXT
        10 {
          text = TYPO3 rulez !
          fontColor = #000000
          fontSize = 20
          offset = 20,30
          fontFile = fileadmin/ALTdragon.ttf
          # Bold
          iterations = 5
          # Antialiased
          antiAlias = 0
        }
      }
    }
  }
}
Copied!

Creating shadows for images

It is also possible to add shadows to images, though mostly CSS shadows should be sufficient nowadays.

Variant 1

Here a background image gets used. The background image (shadow.png) gets scaled to the width and height of the image and the image gets put on top of it with an offset of 10,10 pixels:

Setup

tt_content.image.20.1.file >
tt_content.image.20.1.file = GIFBUILDER
tt_content.image.20.1.file {
  XY = [10.w],[10.h]

  10 = IMAGE
  10 {
    # Background image
    file {
      import.override = fileadmin/shadow.png
      maxW.field = imagewidth
    }
  }

  # Scale background image
  15 = SCALE
  15 {
    width = [10.w]
    # Background Image is 20 pixel higher than scaled down "real" image
    # Thus it should have "normal" height.
    height = [20.h]+20
  }

  # Put real image on top of it
  20 = IMAGE
  20 {
    file {
      import.current = 1
      width {
        stdWrap = 1
        stdWrap.field = imagewidth
        # The real image is made 20 pixels more narrow than set in the Content element
        stdWrap.wrap = |-20
        prioriCalc = intval
      }
    }
    # Inserted at offset 10,10
    offset = 10,10
  }
}
Copied!

Result

Here a background image with a gradient has been "underlied" under the image:

Variant 1

Variant 1

Variant 2

Here a dark box gets created bottom-right of the final image locations and gets blurred. This simulates a shadow. Then the image gets placed on top of it.

Constants

lib.shadowIntensity = #999999
Copied!

Setup

tt_content.image.20.1.file >
tt_content.image.20.1.file = GIFBUILDER
tt_content.image.20.1.file {
  XY = [10.w]+20,[10.h]+20
  # The background color of the image/content
  backColor = #ffffff

  # Create a "dummy" image from the real image which is 20 pixel
  # smaller than the set width.
  10 = IMAGE
  10 {
    file {
      import.current = 1
      width {
        stdWrap = 1
        stdWrap.field = imagewidth
        stdWrap.wrap = |-20
        prioriCalc = intval
      }
    }
    offset = 10,10
  }

  # Draw a black/gray box over the dummy image
  20 = BOX
  20 {
    dimensions = 10,10,[10.w],[10.h]
    # You have to set lib.shadowIntensity in your constants.
    color = {$lib.shadowIntensity}
  }

  # Blur the black box
  30 = EFFECT
  30.value = blur=99 |
  # Blur again if required (wider blurred edge/shadow)
  # 31 < .30

  # Put the image on top again at a slightly more left top position.
  40 < .10
  40.offset = 5,5
}
Copied!

Result

Here the result of the blur method. It looks quite good.

Variant 2

Variant 2

Notes

The latter method should give better results in case you do not need to blend a specific background image in.

You can adjust the blur=99 value to lower values to get smaller blurred edges. Or you can additionally blur multiple times which will give a wider blurred/shadow area.

You can change the color set via lib.shadowIntensity constant to lower values (more black) to get more intense shadows or to a lighter value for lighter shadows.

Quality

If you find that a GIFBUILDER object's quality is too poor for your needs, here are some suggestions made on 06.02.21 on the T3 Dev list by JoH that should enable you to create much better quality images:

  • Never use JPG or GIF as source files for the GIFBUILDER - they always contain artefacts that will be multiplied by the rendering process - use uncompressed TIF or maybe even AI files instead.
  • Render the images twice the size of the original output size and then use the SCALE function in GIFBUILDER as the last object in the list to scale them down to the desired size. (It will render fonts with anti-aliasing even without the niceText property of the GIFBUILDER TEXT object enabled as a side effect).

Colors in TypoScript GIFBUILDER

GraphicColor

GraphicColor
Syntax:

[colordef] : [modifier]

Where modifier can be an integer which is added or subtracted to the three RGB-channels or a floating point with an * before, which will then multiply the values with that factor. The color can be given as HTML-color or as a comma-separated list of RGB-values (integers). An extra parameter can be given, that will modify the color mathematically:

Examples
  • red (HTML color)
  • #ffeecc (HTML color as hexadecimal notation)
  • 255,0,255 (HTML color as decimal notation)

Extra:

  • red : *0.8 ("red" is darkened by factor 0.8)
  • #ffeecc : +16 ("ffeecc" is going to #fffedc because 16 is added)

Note on (+calc)

Whenever the +calc function is added to a value in the data type of the properties underneath, you can use the dimensions of TEXT and IMAGE objects from the GIFBUILDER object array. This is done by inserting a tag like this: [10.w] or [10.h], where 10 is the GIFBUILDER object number in the array and w/h signifies either width or height of the object.

The special property lineHeight (for example, [10.lineHeight]) uses the height a single line of text would take.

On using the special function max(), the maximum of multiple values can be determined. Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
XY = [10.w]+[20.w], max([10.h], [20.h])
Copied!

Here is a full example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.example = IMAGE
lib.example {
  file = GIFBUILDER
  file {
  XY = [10.w]+20, [10.h]+20
  backColor = #ff8700
  format = png

  10 = TEXT
  10 {
    text = TYPO3 GIFBUILDER Example
    fontSize = 20
    fontColor = #ffffff
    offset = 10,25
  }
}
Copied!

As you see, the image has a width/height defined as the width/height of the text printed onto it + 20 pixels.

The generated image looks like:

TYPO3 GIFBUILDER Example

The rendered image from the example above

Properties

1,2,3,4...

1,2,3,4...

1,2,3,4...
Type
Gifbuilder Object + .if (->if)

.if is a property of all GIFBUILDER objects. If the property is present and not set, the object is not rendered! This corresponds to the functionality of .if of the stdWrap function.

backColor

backColor

backColor
Type
Colors in TypoScript GIFBUILDER / stdWrap
Default
white

Background color of the image.

charRangeMap

[array]

charRangeMap.[array]

charRangeMap.[array]
Type
string

Basename of font file to match for this configuration. Notice that only the filename of the font file is used - the path is stripped off. This is done to make matching easier and avoid problems when font files might move to other locations in extensions etc.

So if you use the font file EXT:my_extension/Resources/Private/Fonts/vera.ttf or EXT:install/Resources/Private/Font/vera.ttf both of them will match with this configuration.

The key:

The value of the array key will be the key used when forcing the configuration into splitRendering configuration of the individual GIFBUILDER objects. In the [array] example below the key is 123.

[array].charMapConfig

charRangeMap.[array].charMapConfig

charRangeMap.[array].charMapConfig
Type
TEXT / splitRendering.[array] configuration

splitRendering configuration to set. See GIFBUILDER TEXT object for details.

[array].fontSizeMultiplicator

charRangeMap.[array].fontSizeMultiplicator

charRangeMap.[array].fontSizeMultiplicator
Type
double

If set, this will take the font size of the GIFBUILDER TEXT object and multiply with this amount (xx.xx) and override the fontSize property inside [array].charMapConfig.

[array].pixelSpaceFontSizeRef

charRangeMap.[array].pixelSpaceFontSizeRef

charRangeMap.[array].pixelSpaceFontSizeRef
Type
double

If set, this will multiply the four [x/y]Space[Before/After] properties of split rendering with the relationship between the font size and this value.

In other words: Since pixel space may vary depending on the font size used, you can specify by this value at what font size the pixel space settings are optimized and for other font sizes this will automatically be adjusted according to this font size.

Example:

_GIFBUILDER.charRangeMap {
  123 = arial.ttf
  123 {
    charMapConfig {
      fontFile = EXT:install/Resources/Private/Font/vera.ttf
      value = 48-57
      color = green
      xSpaceBefore = 3
      xSpaceAfter = 3
    }

    pixelSpaceFontSizeRef = 24
  }
}
Copied!

In this example xSpaceBefore and xSpaceAfter will be "3" when the font size is 24. If this configuration is used on a GIFBUILDER TEXT object where the font size is only 16, the spacing values will be corrected by "16/24", effectively reducing the pixel space to "2" in that case.

format

format

format
Type
"gif" / "jpg" / "jpeg" / "png" / "webp" / "avif"
Default
png

File type of the output image.

The quality can be defined globally:

or via the quality property on a per-image basis.

Changed in version 13.0

The default format is now "png". Before TYPO3 v13.0 this was "gif".

New in version 13.0

Support for WebP and AVIF have been added.

maxHeight

maxHeight

maxHeight
Type
positive integer / stdWrap

Maximal height of the image file.

maxWidth

maxWidth

maxWidth
Type
positive integer / stdWrap

Maximal width of the image file.

offset

offset

offset
Type
x,y +calc / stdWrap
Default
0,0

Offset all objects on the image.

quality

New in version 13.0

The quality can be set for WebP images.

quality

quality
Type
Between 10 (lowest quality) and 100 (highest quality) / additionally, 101 (lossless) for WebP

Sets the quality of the image:

speed

speed

speed
Type
integer

Set the "speed" for files in format AVIF (See https://www.php.net/manual/en/function.imageavif.php for more details).

transparentBackground

transparentBackground

transparentBackground
Type
boolean / stdWrap

Set this flag to render the background transparent. TYPO3 makes the color found at position 0,0 of the image (upper left corner) transparent.

If you render text, you should leave the niceText option off as the result will probably be more precise without the niceText antialiasing hack.

transparentColor

transparentColor

transparentColor
Type
Colors in TypoScript GIFBUILDER / stdWrap

Specify a color that should be transparent.

closest

transparentColor.closest

transparentColor.closest
Type
boolean

This will allow for the closest color to be matched instead. You may need this, if your image is not guaranteed "clean".

workArea

workArea

workArea
Type
x,y,w,h +calc / stdWrap

Define the work area on the image file. All the GIFBUILDER objects will see this as the dimensions of the image file regarding alignment, overlaying of images and so on. Only TEXT objects exceeding the boundaries of the work area will be printed outside this area.

XY

XY

XY
Type
x,y +calc (1-2000) / stdWrap
Default
120,50

Size of the image file.

reduceColors

reduceColors

reduceColors

Changed in version 13.0

This property has been removed.

ADJUST

This lets you adjust the tonal range like in the "levels" dialog of Photoshop. You can set the input and output levels and that way remap the tonal range of the image. If you need to adjust the gamma value, have a look at the EFFECT object.

Example

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = ADJUST
20.value = inputLevels = 13, 230
Copied!

Properties

inputLevels

inputLevels

inputLevels
Type
low, high (int<0,255>, int<0, 255>)

With this option you can remap the tone of the image to make shadows darker, highlights lighter and increase contrast.

Possible values for "low" and "high" are integers between 0 and 255, where "high" must be higher than "low".

The value "low" will then be remapped to a tone of 0, the value "high" will be remapped to 255.

Example:

This example will cause the tonal range of the resulting image to begin at 50 of the original (which is set as 0 for the new image) and to end at 190 of the original (which is set as 255 for the new image).

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = ADJUST
20.value = inputLevels = 50, 190
Copied!

outputLevels

outputLevels

outputLevels
Type
low, high (int<0,255>, int<0, 255>)

With this option you can remap the tone of the image to make shadows lighter, highlights darker and decrease contrast.

Possible values for "low" and "high" are integers between 0 and 255, where "high" must be higher than "low".

The beginning of the tonal range, which is 0, will then be remapped to the value "low", the end, which is 255, will be remapped to the value "high".

Example:

This example will cause the resulting image to have a tonal range, where there is no pixel with a tone below 50 and no pixel with a tone above 190 in the image.

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = ADJUST
20.value = outputLevels = 50, 190
Copied!

autoLevels

autoLevels

autoLevels

Sets the inputLevels and outputLevels automatically.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = ADJUST
20.value = autoLevels
Copied!

BOX

Prints a filled box.

Example

EXT:my_extension/Configuration/TypoScript/setup.typoscript
lib.example = IMAGE
lib.example {
  file = GIFBUILDER
  file {
    # Rectangle with 100 pixel width and 50 pixel height
    # in orange with opacity 50%
    10 = BOX
    10 {
      dimensions = 0, 0, 100, 50
      color = #ff8700
      opacity = 50
    }
  }
}
Copied!

Properties

align

align

align
Type
VHalign / stdWrap
Default
l, t

Pair of values, which defines the horizontal and vertical alignment of the box in the image.

Values:

Horizontal alignment:

l
left
c
center
r
right

Vertical alignment:

t
top
c
center
b
bottom

Example:

Horizontally centered, vertically at the bottom:

EXT:site_package/Configuration/TypoScript/setup.typoscript
align = c, b
Copied!

color

color

color
Type
Colors in TypoScript GIFBUILDER / stdWrap
Default
black

Fill color of the box.

dimensions

dimensions

dimensions
Type
x,y,w,h +calc / stdWrap

Dimensions of a filled box.

x,y is the offset.

w,h are the dimensions. Dimensions of 1 will result in 1-pixel wide lines!

opacity

opacity

opacity
Type
positive integer (1-100) / stdWrap
Default
100

The degree to which the box conceals the background.

Mathematically speaking: Opacity = Transparency^-1, i.e. 100% opacity = 0% transparency.

CROP

Properties

align

align

align
Type
VHalign / stdWrap
Default
l, t

Pair of values, which defines the horizontal and vertical alignment of the crop frame.

Values:

Horizontal alignment:

l
left
c
center
r
right

Vertical alignment:

t
top
c
center
b
bottom

Example:

Horizontally centered, vertically at the bottom:

EXT:site_package/Configuration/TypoScript/setup.typoscript
align = c, b
Copied!

backColor

backColor

backColor
Type
Colors in TypoScript GIFBUILDER / stdWrap
Default
The original background color

Background color.

crop

crop

crop
Type
x,y,w,h +calc /stdWrap

x,y is the offset of the crop frame from the position specified by align.

w,h are the dimensions of the frame.

EFFECT

The EFFECT object allows to apply one or more of the following effects to the image.

It has only one property: value. stdWrap is available for value.

Syntax

Syntax
20 = EFFECT
20.value = <effect>=<value> | <effect>=<value>
Copied!

All effects are defined as the effect only or as an effect/value pair inside value. Multiple effects or effect/value pairs are separated by |.

Example

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.image = IMAGE
lib.image {
  file = GIFBUILDER
  file {
    XY = 1024,768
    format = jpg

    10 = IMAGE
    10.file = fileadmin/image.jpg

    20 = EFFECT
    20.value = gamma=1.3 | flip | rotate=180
  }
}
Copied!

Effects

blur

blur

blur
Type
integer (1-99)
Default
0

Blurs the edges inside the image.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = blur=10
Copied!

charcoal

charcoal

charcoal
Type
integer (0-100)
Default
0

Makes the image look as if it has been drawn with charcoal and defines the intensity of that effect.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = charcoal=5
Copied!

colors

colors

colors
Type
integer (2-255)

Defines the number of different colors to use in the image.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = colors=100
Copied!

edge

edge

edge
Type
integer (0-99)
Default
0

Detect edges within an image. This is a gray-scale operator, so it is applied to each of the three color channels separately. The value defines the radius for the edge detection.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = edge=8
Copied!

emboss

emboss

emboss

Creates a relief effect: Creates highlights or shadows that replace light and dark boundaries in the image.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = emboss
Copied!

flip

flip

flip

Vertical flipping.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = flip
Copied!

flop

flop

flop

Horizontal flipping.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = flop
Copied!

gamma

gamma

gamma
Type
double (0.5 - 3.0)
Default
1.0

Sets the gamma value.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = gamma=1.3
Copied!

gray

gray

gray

The image is converted to gray tones.

Example:

This gives the image a slight wave and renders it in gray.

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = wave=1,20 | gray
Copied!

invert

invert

invert

Invert the colors.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = invert
Copied!

rotate

rotate

rotate
Type
integer (0-360)
Default
0

Number of degrees for a clockwise rotation.

Image dimensions will grow if needed, so that nothing is cut off from the original image.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = rotate=180
Copied!

sharpen

sharpen

sharpen
Type
integer (0-99)
Default
0

Sharpens the edges inside the image.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = sharpen=12
Copied!

shear

shear

shear
Type
integer (-90 - 90)
Default
0

Number of degrees for a horizontal shearing. Horizontal shearing slides one edge of the image along the X axis, creating a parallelogram. Provide an integer between -90 and 90 for the number of degrees.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = shear=-30
Copied!

solarize

solarize

solarize
Type
integer (0-99)
Default
0

Color reduction, "burning" the brightest colors black. The brighter the color, the darker the solarized color is. This happens in photography when chemical film is over exposed.

The value sets the grayscale level above which the color is negated.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = solarize=15
Copied!

swirl

swirl

swirl
Type
integer (0-1000)
Default
0

The image is swirled or spun from its center.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = swirl=200
Copied!

wave

wave

wave
Type
integer,integer (both 0-99)
Default
0,0

Provide values for the amplitude and the length of a wave, separated by comma. All horizontal edges in the image will then be transformed by a wave with the given amplitude and length.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = EFFECT
20.value = wave=1,20
Copied!

ELLIPSE

Prints a filled ellipse.

Example

EXT:site_package/Configuration/TypoScript/setup.typoscript
file = GIFBUILDER
file {
  XY = 200,200
  format = png

  10 = ELLIPSE
  10.dimensions = 100,100,50,50
  10.color = red
}
Copied!

Properties

color

color

color
Type
Colors in TypoScript GIFBUILDER / stdWrap
Default
black

Fill color of the ellipse.

dimensions

dimensions

dimensions
Type
x,y,w,h +calc / stdWrap

Dimensions of a filled ellipse.

x,y is the offset.

w,h are the dimensions. Dimensions of 1 will result in 1-pixel wide lines!

EMBOSS

The EMBOSS object uses two shadow offsets in opposite directions and with different colors to create an effect of light cast onto an embossed text.

Properties

blur

blur

blur
Type
integer (1-99) / stdWrap

Blurring of the shadow. Above 40 only values of 40, 50, 60, 70, 80, 90 are relevant.

highColor

highColor

highColor
Type
Colors in TypoScript GIFBUILDER / stdWrap

Upper border color.

intensity

intensity

intensity
Type
integer (0-100) / stdWrap

How "massive" the emboss is. This value can - if it has a high value combined with a blurred shadow - create a kind of soft-edged outline.

lowColor

lowColor

lowColor
Type
Colors in TypoScript GIFBUILDER / stdWrap

Lower border color.

opacity

opacity

opacity
Type
integer (1-100) / stdWrap

The degree to which the shadow conceals the background. Mathematically speaking: Opacity = Transparency^-1. For example, 100% opacity = 0% transparency.

Only active with a value for blur.

offset

offset

offset
Type
x,y / stdWrap

Offset of the emboss.

textObjNum

textObjNum

textObjNum
Type
positive integer / stdWrap

Must point to the TEXT object, if these EMBOSS properties are not properties to a TEXT object directly ("stand-alone emboss"). Then the emboss needs to know which TEXT object it should be an emboss of!

If - on the other hand - the EMBOSS object is a property to a TEXT object, this property is not needed.

IMAGE

Renders an image file.

Properties

align

align

align
Type
VHalign / stdWrap
Default
1,1

Pair of values, which defines the horizontal and vertical alignment of the image.

Values:

Horizontal alignment:

l
left
c
center
r
right

Vertical alignment:

t
top
c
center
b
bottom

Example:

Horizontally centered, vertically at the bottom:

EXT:site_package/Configuration/TypoScript/setup.typoscript
align = c, b
Copied!

file

file

file
Type
imgResource

The image file.

mask

mask

mask
Type
imgResource

Optional mask image for the image file.

offset

offset

offset
Type
x,y +calc / stdWrap
Default
0,0

Offset of the image.

tile

tile

tile
Type
x,y / stdWrap
Default
1,1

Repeat the image x,y times (which creates the look of tiles).

Maximum number of times in each direction is 20. If you need more, use a larger image.

OUTLINE

OUTLINE creates a colored contour line around the shapes of the associated text.

This outline normally renders quite ugly as it is done by printing 4 or 8 texts underneath the text in question. Try to use a shadow with a high intensity instead. That works better!

Properties

color

color

color
Type
Colors in TypoScript GIFBUILDER / stdWrap

Color of the outline.

textObjNum

textObjNum

textObjNum
Type
positive integer / stdWrap

Must point to the TEXT object, if these outline properties are not properties to a TEXT object directly ("stand-alone outline"). Then the outline needs to know which TEXT object it should be an outline of!

If - on the other hand - the outline is a property to a TEXT object, this property is not needed.

thickness

thickness

thickness
Type
x,y / stdWrap

Thickness in each direction, range 1-2.

SCALE

This scales the GIFBUILDER object to the provided dimensions.

Properties

height

height

height
Type
pixels +calc / stdWrap

Height of the scaled image.

params

params

params
Type
GraphicsMagick/ImageMagick parameters

Parameters to be used for the processing.

width

width

width
Type
pixels +calc / stdWrap

Width of the scaled image.

SHADOW

Creates a shadow under the associated text.

Properties

blur

blur

blur
Type
integer (1-99) / stdWrap

Blurring of the shadow. Above 40 only values of 40,50,60,70,80,90 are relevant.

color

color

color
Type
Colors in TypoScript GIFBUILDER / stdWrap

The color of the shadow.

intensity

intensity

intensity
Type
integer (1-100) / stdWrap

How "massive" the shadow is. This value can - if it has a high value combined with a blurred shadow - create a kind of soft-edged outline.

offset

offset

offset
Type
x,y / stdWrap

The offset of the shadow.

opacity

opacity

opacity
Type
integer (1-100) / stdWrap

The degree to which the shadow conceals the background. Mathematically speaking: Opacity = Transparency^-1. E.g. 100% opacity = 0% transparency.

Only active with a value for blur.

textObjNum

textObjNum

textObjNum
Type
positive integer / stdWrap

Must point to the TEXT object, if these shadow properties are not properties to a TEXT object directly ("stand-alone shadow"). Then the shadow needs to know which TEXT object it should be a shadow of!

If - on the other hand - the shadow is a property to a TEXT object, this property is not needed.

TEXT

Renders a text.

Properties

align

align

align
Type
align / stdWrap
Default
left

The alignment of the text.

Possible values:

  • left
  • center
  • right

angle

angle

angle
Type
integer
Default
0
Range
-90 to 90

The rotation degree of the text.

antiAlias

antiAlias

antiAlias
Type
boolean
Default
1 (true)

The FreeType antialiasing.

breakSpace

breakSpace

breakSpace
Type
float
Default
1.0

Defines a value that is multiplied by the line height of the current element.

breakWidth

breakWidth

breakWidth
Type
integer / stdWrap

Defines the maximum width for an object, overlapping elements will force an automatic line break.

doNotStripHTML

doNotStripHTML

doNotStripHTML
Type
boolean
Default
0 (false)

If set, HTML tags inserted in the text are not removed. Any other HTML code will be removed by default!

emboss

emboss

emboss
Type
GIFBUILDER object ->EMBOSS

fontColor

fontColor

fontColor
Type
Colors in TypoScript GIFBUILDER / stdWrap
Default
black

The font color.

fontFile

fontFile

fontFile
Type
resource / stdWrap
Default
Nimbus (Arial clone)

The font face (TrueType *.ttf and OpenType *.otf fonts can be used).

fontSize

fontSize

fontSize
Type
positive integer / stdWrap
Default
12

The font size.

hide

hide

hide
Type
boolean / stdWrap
Default
0 (false)

If this is true, the text is not printed.

This feature may be used, if you need a SHADOW object to base a shadow on the text, but do not want the text to be displayed.

iterations

iterations

iterations
Type
positive integer / stdWrap
Default
1

How many times the text should be "printed" onto it self. This will add the effect of bold text.

maxWidth

maxWidth

maxWidth
Type
positive integer / stdWrap

Sets the maximum width in pixels, the text must be. Reduces the fontSize, if the text does not fit within this width.

Does not support setting alternative font sizes in splitRendering options.

niceText

niceText

niceText
Type
boolean / stdWrap

This is a very popular feature that helps to render small letters much nicer than the FreeType library can normally do. But it also loads the system very much!

The principle of this function is to create a black/white image file in twice or more times the size of the actual image file and then print the text onto this in a scaled dimension. Afterwards GraphicsMagick/ImageMagick scales down the mask and masks the fontColor down on the original image file through the temporary mask.

The fact that the font is actually rendered in the double size and scaled down adds a more homogeneous shape to the letters. Some fonts are more critical than others though. If you do not need the quality, then do not use the function.

after

niceText.after

niceText.after

GraphicsMagick/ImageMagick parameters after scale.

before

niceText.before

niceText.before

GraphicsMagick/ImageMagick parameters before scale.

scaleFactor

niceText.scaleFactor

niceText.scaleFactor
Type
integer (2-5)

The scaling factor.

sharpen

niceText.sharpen

niceText.sharpen
Type
integer (0-99)

The sharpen value for the mask (after scaling). This enables you to make the text crisper, if it is too blurred!

offset

offset

offset
Type
x,y +calc / stdWrap
Default
0,0

The offset of the text.

outline

outline

outline
Type
GIFBUILDER object ->OUTLINE

shadow

shadow

shadow
Type
GIFBUILDER object ->SHADOW

spacing

spacing

spacing
Type
positive integer / stdWrap
Default
0

The pixel distance between letters. This may render ugly!

splitRendering

splitRendering

splitRendering
Type
integer / (array of keys)

Split the rendering of a string into separate processes with individual configurations. By this method a certain range of characters can be rendered with another font face or size. This is very useful if you want to use separate fonts for strings where you have latin characters combined with, for example, Japanese and there is a separate font file for each.

You can also render keywords in another font / size / color.

[array]

splitRendering.[array]

splitRendering.[array]
Type
integer

With keyword being [charRange, highlightWord].

  • splitRendering.[array] = keyword with keyword being [charRange, highlightWord]
  • splitRendering.[array] {

    • fontFile: Alternative font file for this rendering.
    • fontSize: Alternative font size for this rendering.
    • color: Alternative color for this rendering, works only without niceText.
    • xSpaceBefore: x space before this part.
    • xSpaceAfter: x space after this part.
    • ySpaceBefore: y space before this part.
    • ySpaceAfter: y space after this part.

    }

Keyword: charRange

splitRendering.[array].value = Comma-separated list of character ranges (for example, 100-200) given as Unicode character numbers. The list accepts optional starting and ending points, for example, - 200 or 200 - and single values, for example, 65, 66, 67.

Keyword: highlightWord

splitRendering.[array].value = Word to highlight, makes a case sensitive search for this.

Limitations:

  • The pixel compensation values are not corrected for scale factor used with niceText. Basically this means that when niceText is used, these values will have only the half effect.
  • When word spacing is used the highlightWord mode does not work.
  • The color override works only without niceText.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10.splitRendering.compX = 2
10.splitRendering.compY = -2
10.splitRendering.10 = charRange
10.splitRendering.10 {
  value = 200-380 , 65, 66
  fontSize = 50
  fontFile = EXT:core/Resources/Private/Font/nimbus.ttf
  xSpaceBefore = 30
}
10.splitRendering.20 = highlightWord
10.splitRendering.20 {
  value = TheWord
  color = red
}
Copied!

compX

splitRendering.compX

splitRendering.compX
Type
integer

Additional pixel space between parts, x direction.

compY

splitRendering.compY

splitRendering.compY
Type
integer

Additional pixel space between parts, y direction.

text

text

text
Type
string / stdWrap

This is text on the image file. The item is rendered only, if this string is not empty.

The $cObj->data array is loaded with the page record, if, for example, the GIFBUILDER object is used in TypoScript.

textMaxLength

textMaxLength

textMaxLength
Type
integer
Default
100

The maximum length of the text. This is just a natural break that prevents incidental rendering of very long texts!

wordSpacing

wordSpacing

wordSpacing
Type
positive integer / stdWrap
Default
spacing * 2

The pixel distance between words.

WORKAREA

Sets another work area.

Properties

clear

clear

clear
Type
string

Sets the current work area to the default work area.

The value is checked for using isset(): If isset() returns true, the work area is cleared, otherwise it is not.

set

set

set
Type
x,y,w,h +calc / stdWrap

Sets the dimensions of the work area.

x,y is the offset.

w,h are the dimensions.

IMG_RESOURCE

Objects of type IMG_RESOURCE returns a reference to an image, possibly wrapped with Properties. It can be used, for example, for putting background images in tables or table rows or to import an image in your own include scripts. Depending on your use case you might prefer using the cObject IMAGE, which creates a complete img tag.

Properties

cache

cache
Type
cache

See cache function description for details.

file

file
Type
->imgResource

stdWrap

stdWrap
Type
->stdWrap

LOAD_REGISTER

This provides a way to load the array $GLOBALS['TSFE']->register[] with values. It does not return anything!

The register is working like a stack: With each call new content can be put on top of the stack. RESTORE_REGISTER can be used to remove the element at the topmost position again. The registers are processed in the reverse order. The register with the highest number will be processed as the first, and the register with the lowest number will be processed as the last one. This corresponds to the stack principle Last In – First Out (LIFO).

With the advent of Fluid templating, registers are used less often than they used to be. In the Core they are not being used anymore.

Properties

array of field names

array of field names
Type
string / stdWrap

Example:

This sets contentWidth, label and head.

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.27 = LOAD_REGISTER
page.27 {
  contentWidth = 500

  label.field = header

  head = some text
  head.wrap = <b> | </b>
}
Copied!

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
1 = LOAD_REGISTER
1.param.cObject = TEXT
1.param.cObject.stdWrap.data = GP:the_id
# To avoid SQL injections we use intval - so the parameter
# will always be an integer.
1.param.cObject.stdWrap.intval = 1

10 = CONTENT
10.table = tx_my_table
10.select {
  pidInList = this
  orderBy = sorting
  # Now we use the registered parameter
  where = uid = {REGISTER:param}
  where.insertData = 1
}
10.renderObj = COA
10.renderObj {
  10 = TEXT
  10.stdWrap.field = tx_my_text_field
}
Copied!

In this example we first load a special value, which is given as a GET/POST parameter, into the register. Then we use a CONTENT object to render content based on this value. This CONTENT object loads data from a table tx_my_table and looks up the entry using the value from the register as a unique id. The field tx_my_text_field of this record will be rendered as output.

For an example in combination with RESTORE_REGISTER see the example on the page RESTORE_REGISTER.

PAGEVIEW

New in version 13.1

The content object PAGEVIEW can be used in stead of FLUIDTEMPLATE to configure the HTML body of a page using Fluid templates.

This content object has very specific conventions and defaults, that requires (and allows) less configuration as compared to using FLUIDTEMPLATE.

The benefit is that following these conventions means less boilerplate code to maintain.

If you follow these conventions, a few directories and files must follow the structure outlined below.

Example: Display a page with Fluid templates

EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths {
            100 = EXT:my_sitepackage/Resources/Private/PageView/
        }
        variables {
            parentPageTitle = TEXT
            parentPageTitle.data = levelfield:-1:title
        }
        dataProcessing {
            10 = page-content
            20 = menu
            20.as = mainMenu
        }
    }
}
Copied!

Default variables in Fluid templates

The following variables are available by default in the Fluid template.

Additional variables can be defined with property variables.

language

language
Type
\TYPO3\CMS\Core\Site\Entity\SiteLanguage
Example
Example: Display the site title in the current language

The current SiteLanguage object, see also the SiteLanguage object.

page

page
Type
\TYPO3\CMS\Frontend\Page\PageInformation
Example
Example: Display the title and abstract of the current page

The current PageInformation as object. See also Frontend page information.

settings

settings
Type
array
Example
Example: Use TypoScript constant in a Fluid template

The variable {settings} contains all TypoScript constants that are set on the current page. Settings from the site can be accessed via the site with {site.settings}

site

site
Type
\TYPO3\CMS\Core\Site\Entity\Site
Example
Example: Link to the root page of the current site

The current Site object. See also the Site object.

Examples for using default variables

Example: Display the site title in the current language

EXT:my_sitepackage/Resources/Private/PageView/Pages/Default.html
<f:layout name="Default" />
<f:section name="Main">
    <main role="main">
        <p>The site title in the current template is: {language.websiteTitle}</p>
    </main>
</f:section>
Copied!

Example: Display the title and abstract of the current page

EXT:my_sitepackage/Resources/Private/PageView/Pages/Default.html
<f:layout name="Default" />
<f:section name="Main">
    <main role="main">
        <p>The title of the page with id {page.id} is: {page.pageRecord.title}. It has the
            following abstract:</p>
        <p>{page.pageRecord.abstract}</p>
    </main>
</f:section>
Copied!

Example: Use TypoScript constant in a Fluid template

Let us assume, the current page loads the following TypoScript constants:

EXT:my_sitepackage/Configuration/TypoScript/constants.typoscript
page {
    uids {
        dataPrivacy = 42
        contact = 85
        imprint = 86
    }
}
Copied!
EXT:my_sitepackage/Resources/Private/PageView/Pages/Default.html
<f:layout name="Default" />
<f:section name="Main">
    <main role="main">
        <p>...</p>
    </main>
    <footer>
        See also our <f:page pageUid="{settings.page.uid.dataPrivacy}">data privacy policy</f:page>
    </footer>
</f:section>
Copied!

Properties

cache

cache
Type
cache

See cache function description for details.

dataProcessing.[key]

dataProcessing.[key]
Type
path with stdWrap
Example
Example: Display a main menu and a breadcrumb on the page

Add one or multiple data processors. The sub-property options can be used to pass parameters to the processor class.

It is recommended to use the PageContentFetchingProcessor to fetch the content elements from the page, respecting the backend layout.

paths.[priority]

paths.[priority]
Type
path with stdWrap
Example
Example: Define a path that contains all templates
Example 2
Example: Define fallbacks for a template paths

Sets an array of paths for the Fluid templates, usually EXT:my_extension/Resources/Private/PageView/ or a path like EXT:my_extension/Resources/Private/PageView/MyPage.

The templates are expected in a subfolder Pages.

Fluid partials are looked up in a sub-directory called Partials, layouts in Layouts.

The name of the used page layout (Backend layout) is resolved automatically.

The paths are evaluated from highest to lowest priority.

variables.[variable_name]

variables.[variable_name]
Type
Content Object
Example
Example: Make additional variables available in the Fluid template

Sets variables that should be available in Fluid.

Examples

Example: Display a main menu and a breadcrumb on the page

EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths {
            100 = EXT:my_sitepackage/Resources/Private/PageView/
        }
        dataProcessing {
            10 = menu
            10 {
                as = mainMenu
                titleField = nav_title // title
                expandAll = 1
            }
            20 = menu
            20 {
                as = breadcrumb
                special = rootline
                special.range = 0|-1
                includeNotInMenu = 0
            }
        }
    }
}
Copied!

The page template could look like this:

EXT:my_sitepackage/Resources/Private/PageView/Pages/Default.html
<f:layout name="Default" />
<f:section name="Main">
    <f:render partial="Navigation/MainNavigation.html" arguments="{mainMenu: mainMenu}"/>
    <main role="main">
        <f:render partial="Navigation/Breadcrumb.html" arguments="{breadcrumb: breadcrumb}"/>
        <p>...</p>
    </main>
</f:section>
Copied!

With the following partials:

EXT:my_sitepackage/Resources/Private/PageView/Partials/Navigation/Breadcrumb.html
<f:if condition="{breadcrumb}">
    <ol class="breadcrumb">
        <f:for each="{breadcrumb}" as="item">
            <li class="breadcrumb-item{f:if(condition: item.current, then: ' active')}" >
                <a class="breadcrumb-link" href="{item.link}" title="{item.title}">
                    <span class="breadcrumb-text">{item.title}</span>
                </a>
            </li>
        </f:for>
    </ol>
</f:if>
Copied!

And

EXT:my_sitepackage/Resources/Private/PageView/Partials/Navigation/MainNavigation.html
<ul class="nav nav-pills">
    <f:for each="{mainMenu}" as="menuItem">
        <li class="nav-item {f:if(condition: menuItem.hasSubpages, then: 'dropdown')}">
            <f:if condition="{menuItem.hasSubpages}">
                <f:then>
                    <!-- Item has children -->
                    <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">
                        {menuItem.title}
                    </a>
                    <div class="dropdown-menu">
                        <f:for each="{menuItem.children}" as="menuItemLevel2">
                            <f:link.page pageUid="{menuItemLevel2.data.uid}"
                                         class="dropdown-item {f:if(condition: menuItemLevel2.active, then: 'active')}">
                                {menuItemLevel2.title}
                            </f:link.page>
                        </f:for>
                    </div>
                </f:then>
                <f:else>
                    <!-- Item has no children -->
                    <f:link.page pageUid="{menuItem.data.uid}" class="nav-link {f:if(condition: menuItem.active, then:'active')}">
                        {menuItem.title}
                    </f:link.page>
                </f:else>
            </f:if>
        </li>
    </f:for>
</ul>
Copied!

Example: Define a path that contains all templates

This is a basic definition of a PAGEVIEW object with only one path to the templates:

EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = PAGEVIEW
page.10.paths.100 = EXT:my_sitepackage/Resources/Private/PageView/
Copied!

The content of the folder could look like this:

  • EXT:my_sitepackage/Resources/Private/PageView/

    • Layouts

      • Default.html
      • WithoutHeader.html
    • Pages

      • Default.html
      • StartPage.html
      • TwoColumns.html
      • With_sidebar.html
    • Partials

      • Footer.html
      • Sidebar.html
      • Menu.html

So for backend layout named "with_sidebar", the template file is then resolved to EXT:my_sitepackage/Resources/Private/PageView/Pages/With_sidebar.html.

If the backend layout is named "TwoColumns" it is resovled to EXT:my_sitepackage/Resources/Private/PageView/Pages/TwoColumns.html.

For all these templates partial are expected in folder EXT:my_sitepackage/Resources/Private/PageView/Pages/Partials and layouts in EXT:my_sitepackage/Resources/Private/PageView/Pages/Layouts.

Example: Define fallbacks for a template paths

You can use the directories defined in paths.[priority] to define fallback directories for the templates:

page = PAGE
page {
    10 = PAGEVIEW
    10.paths {
        100 = EXT:my_basic_sitepackage/Resources/Private/PageView/
        200 = EXT:my_general_sitepackage/Resources/Private/PageView/
        300 = EXT:my_special_sitepackage/Resources/Private/PageView/
    }
}
Copied!

The template for a page with a certain backend layout is first searched in EXT:my_special_sitepackage/Resources/Private/PageView/Pages/ then in EXT:my_general_sitepackage/Resources/Private/PageView/Pages/ and last in EXT:my_basic_sitepackage/Resources/Private/PageView/Pages/.

Example: Make additional variables available in the Fluid template

EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths {
            100 = EXT:my_sitepackage/Resources/Private/PageView/
        }
        variables {
            parentPageTitle = TEXT
            parentPageTitle.data = levelfield:-1:title
            another_variable =< lib.anotherVariable
        }
    }
}
Copied!

The following variables are now available in the Fluid template:

EXT:my_sitepackage/Resources/Private/PageView/Pages/Default.html
<f:layout name="Default" />
<f:section name="Main">
    <f:render partial="Navigation/MainNavigation.html" arguments="{_all}"/>

    <main role="main">
        <p>The current parent page has the title {parentPageTitle}</p>
        <p>Another variable is {another_variable}</p>
    </main>
</f:section>
Copied!

RECORDS

This object is meant for displaying lists of records from a variety of tables. Contrary to the CONTENT object, it does not allow very fine selections of records (as it has no select property).

The register key SYS_LASTCHANGED is updated with the tstamp field of the records selected which has a higher value than the current.

Properties

source

source
Type
records-list / stdWrap

List of record id's, optionally with prepended table names.

Example:

source = tt_content_34, 45, tt_links_56
Copied!

categories

categories
Type
categories-list / stdWrap

Comma-separated list of system categories uid's. Records related to these categories will be retrieved and made available for rendering.

Only records from the tables defined in the tables property will be retrieved.

categories.relation

categories.relation

Name of the categories relation field to use for building the list of categorized records, as there can be several such fields on a given table.

tables

tables
Type
list of tables / stdWrap

List of accepted tables. For items listed in the source property which are not prepended with a table name, the first table will be used.

Records from tables configured in conf are also allowed.

Example:

tables = tt_content, tt_address, tt_links
conf.tx_myexttable = TEXT
conf.tx_myexttable.value = Hello world
Copied!

This adds the tables tt_content, tt_address, tt_links and tx_myexttable.

conf.[*table name*]

conf.[*table name*]
Type
cObject

Configuration array, which defines the rendering for records from table table name.

If this is not defined, the rendering of the records is done with the top-level object [table name] - just like when .renderObj is not set for the cObject CONTENT!

dontCheckPid

dontCheckPid
Type
boolean / stdWrap
Default
0

Normally a record cannot be selected, if its parent page (pid) is not accessible for the website user. This option disables that check.

wrap

wrap
Type
wrap / stdWrap

Wraps the output. Executed before stdWrap.

stdWrap

stdWrap
Type
->stdWrap

Executed after wrap.

cache

cache
Type
cache

See cache function description for details.

Examples

Selection with source

The following example would display some related content referenced from the page properties.

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.42 = RECORDS
page.42 {
   source.field = tx_examples_related_content
   tables = tt_content
}
Copied!

Since no conf property is defined, the rendering will look for a top-level TypoScript object bearing the name of the table to be rendered (e.g. tt_content).

Selection with source II

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = RECORDS
20 {
	source = 10,12
	dontCheckPid = 1
	tables = tt_content
}
Copied!

This example loads the content elements with the UIDs 10 and 12 no matter where these elements are located and whether these pages are accessible for the current user.

Selection with categories

If you want to display categorized content with a RECORDS object you could do it like this:

EXT:site_package/Configuration/TypoScript/setup.typoscript
categorized_content = RECORDS
categorized_content {
	categories.field = selected_categories
	categories.relation.field = category_field
	tables = tt_content
	conf.tt_content = TEXT
	conf.tt_content {
		stdWrap.field = header
		stdWrap.typolink.parameter = {field:pid}#{field:uid}
		stdWrap.typolink.parameter.insertData = 1
		stdWrap.wrap = <li>|</li>
	}
	wrap = <ul>|</ul>
}
Copied!

Contrary to the previous example, in this case the conf property is present and defines a very simple rendering of each content element (i.e. the header with a direct link to the content element).

However, the same can be achieved with a FLUIDTEMPLATE and data processing. This way templating is much more flexible. See the following example from the system extension fluid_styled_content:

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.menu_categorized_content =< lib.contentElement
tt_content.menu_categorized_content {
   templateName = MenuCategorizedContent
   dataProcessing {
      10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
      10 {
         table = tt_content
         selectFields = tt_content.*
         groupBy = uid
         pidInList.data = leveluid : 0
         recursive = 99
         join.data = field:selected_categories
         join.wrap = sys_category_record_mm ON uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(|)
         where.data = field:category_field
         where.wrap = tablenames='tt_content' and fieldname='|'
         orderBy = tt_content.sorting
         as = content
      }
   }
}
Copied!

RESTORE_REGISTER

This unsets the latest changes in the register array as set by LOAD_REGISTER.

Internally registers work like a stack where the original register is saved when LOAD_REGISTER is called. When a RESTORE_REGISTER cObject is called, the last element is pulled off that stack and the register is replaced with the content of the previous element.

Example:

The following example shows how LOAD_REGISTER and RESTORE_REGISTER can be used to load values into the register and to restore previous values again.

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Put first block into the register
10 = LOAD_REGISTER
10 {
  myTextRegister.cObject = COA
  myTextRegister.cObject {
    10 = TEXT
    10.value = This is text in the first block.
    10.stdWrap.wrap = <p>|</p>
  }
}
# Put second block into the register
20 = LOAD_REGISTER
20 {
  myTextRegister.cObject = COA
  myTextRegister.cObject {
    10 = TEXT
    10.value = This is text originally used in the second block...
    10.stdWrap.wrap = <p>|</p>
  }
}
# Put third block into the register using text from the second block.
30 = LOAD_REGISTER
30 {
  myTextRegister.cObject = COA
  myTextRegister.cObject {
    # Get the current text from myTextRegister:
    # "This is text originally used in the second block..."
    10 = TEXT
    10.stdWrap.data = register:myTextRegister
    10.stdWrap.append = TEXT
    10.stdWrap.append.value = (but now used in the third block).
    20 = TEXT
    20.value = This is a second text in the third block.
    20.stdWrap.wrap = <p>|</p>
  }
}
# Up to this place no actual output has been produced.

# Outputs block 30 "This is text originally used in the second block...
# (but now used in the third block). This is a second text in the third block."
40 = TEXT
40.stdWrap.data = register:myTextRegister

# Outputs block 20 "This is text originally used in the second block..."
50 = RESTORE_REGISTER
60 = TEXT
60.stdWrap.data = register:myTextRegister

# Outputs block 10 "This is text in the first block."
70 = RESTORE_REGISTER
80 = TEXT
80.stdWrap.data = register:myTextRegister
Copied!

SVG

With this object type you can insert a SVG. You can use XML data directly or reference a file.

Properties

cache

cache
Type
cache

See cache function description for details.

width

width
Type
integer / stdWrap
Default
600

Width of the SVG.

height

height
Type
integer / stdWrap
Default
400

Height of the SVG.

src

src
Type
resource / stdWrap

SVG file resource, can also be referenced via EXT: prefix to point to files of extensions.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
src = fileadmin/svg/tiger.svg
Copied!

renderMode

renderMode
Type
string / stdWrap

Setting renderMode to inline will render an inline version of the SVG.

stdWrap

stdWrap
Type
->stdWrap

Example

Output the SVG with the defined dimensions:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = SVG
10 {
  width = 600
  height = 600
  src = EXT:my_ext/Resources/Public/Images/example.svg
}
Copied!

TEXT

A content object of the type "TEXT" can be used to output static text or HTML.

stdWrap properties are available under the property "value" and on the very rootlevel of the object.

Properties

value

value
Type
string / stdWrap

Text, which you want to output.

stdWrap

stdWrap
Type
stdWrap

stdWrap properties are available on the very root level of the object. This is non-standard! You should use these stdWrap properties consistently to those of the other cObjects by accessing them through the property "stdWrap".

cache

cache
Type
cache

See cache function description for details.

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = This is a text in uppercase
10.stdWrap.case = upper
Copied!

The above example uses the stdWrap property case. It returns "THIS IS A TEXT IN UPPERCASE".

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value.field = title
10.stdWrap.wrap = <strong>|</strong>
Copied!

The above example gets the header of the current page (which is stored in the database field title). The header is then wrapped in <strong> tags, before it is returned.

Now let us have a look at an extract from a more complex example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value.field = bodytext
10.stdWrap.parseFunc < lib.parseFunc_RTE
10.stdWrap.dataWrap = <div>|</div>
Copied!

The above example returns the content, which was found in the field bodytext of the current record from $cObj->data-array. Here that shall be the current record from the database table tt_content. This is useful inside COA objects.

Here is the same example in its context:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = CONTENT
10 {
  table = tt_content
  select {
    where.dataWrap = irre_parentid  = {field:uid}
    begin = 0
  }

  renderObj = COA
  renderObj {
    stdWrap.if.isTrue.data = field:bodytext
    10 = TEXT
    10.value.field = bodytext
    10.stdWrap.parseFunc < lib.parseFunc_RTE
    10.stdWrap.dataWrap = <div>|</div>
   }
}
Copied!

Here we use the cObject CONTENT to return all content elements (records from the database table "tt_content"), which are on the current page. (These content elements have the corresponding value in irre_parentid.) They are rendered using a COA cObject, which only processes them, if there is content in the field bodytext.

The resulting records are each rendered using a TEXT object:

The TEXT object returns the content of the field bodytext of the according tt_content record. (Note that the property "field" in this context gets content from the table tt_content and not - as in the example above - from pages. See the description for the data type getText/field!) The resulting content is then parsed with parseFunc and finally wrapped in <div> tags before it is returned.

USER and USER_INT

This calls either a PHP function or a method in a class. This is very useful if you want to incorporate your own data processing or content.

Basically USER and USER_INT are user defined cObjects, because they call a function or method, which you control!

If you call a method in a class (which is of course instantiated as an object), the internal variable $cObj of that class is set with a reference to the parent cObject. This offers you an API of functions, which might be more or less relevant for you. See ContentObjectRenderer.php in the TYPO3 source code; access to typolink or stdWrap are only two of the gimmicks you get.

If you create this object as USER_INT, it will be rendered non-cached, outside the main page-rendering.

Properties

userFunc

userFunc
Type
function name

The name of the function, which should be called. If you specify the name with a '->' in it, then it is interpreted as a call to a method in a class.

Three parameters are sent to the PHP function: First a string $content variable (which is empty for USER/USER_INT objects, but not when the user function is called from stdWrap functions .postUserFunc or .preUserFunc). The second parameter is an array ($configuration) with the properties of this cObject, if any. As third parameter, the current ServerRequestInterface $request is passed.

(properties you define)

(properties you define)
Type
(the data type you want)

Apart from the properties "userFunc" and "stdWrap", which are defined for all USER/USER_INT objects by default, you can add additional properties with any name and any data type to your USER/USER_INT object. These properties and their values will then be available in PHP; they will be passed to your function (in the second parameter). This allows you to process them further in any way you wish.

stdWrap

stdWrap
Type
stdWrap.

cache

cache
Type
cache

See cache function description for details.

Examples

Example 1

This example shows how to include your own PHP script and how to use it from TypoScript. Use this TypoScript configuration:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = USER_INT
page.10 {
    userFunc = MyVendor\SitePackage\UserFunctions\ExampleTime->printTime
}
Copied!

The file EXT:site_package/Classes/UserFunctions/ExampleTime.php might amongst other things contain:

EXT:site_package/Classes/UserFunctions/ExampleTime.php
<?php

declare(strict_types=1);

namespace MyVendor\SitePackage\UserFunctions;

use Psr\Http\Message\ServerRequestInterface;

final class ExampleTime
{
    /**
     * Output the current time in red letters
     *
     * @param string Empty string (no content to process)
     * @param array TypoScript configuration
     * @param ServerRequestInterface $request
     * @return string HTML output, showing the current server time.
     */
    public function printTime(string $content, array $conf, ServerRequestInterface $request): string
    {
        return '<p style="color: red;">Dynamic time: ' . date('H:i:s') . '</p><br />';
    }
}
Copied!

Here page.10 will give back what the PHP function printTime() returned. Since we did not use a USER object, but a USER_INT object, this function is executed on every page hit. Thus, in this example, the current time is displayed in red letters each time.

Example 2

Now let us have a look at another example:

We want to display all content element headers of a page in reversed order. For this we use the following TypoScript:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.typeNum = 0

page.30 = USER
page.30 {
    userFunc = MyVendor\SitePackage\UserFunctions\ExampleListRecords->listContentRecordsOnPage
    # reverseOrder is a boolean variable (see PHP code below)
    reverseOrder = 1
}
Copied!

The file EXT:site_package/Classes/UserFunctions/ExampleListRecords.php may contain amongst other things:

EXT:site_package/Classes/UserFunctions/ExampleListRecords.php
<?php

declare(strict_types=1);

namespace MyVendor\SitePackage\UserFunctions;

use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

/**
 * Example of a method in a PHP class to be called from TypoScript
 *
 * The class is defined as public as we use dependency injection in
 * this example. If you do not need dependency injection, the
 * "Autoconfigure" attribute should be omitted!
 */
#[Autoconfigure(public: true)]
final class ExampleListRecords
{
    public function __construct(
        private readonly ConnectionPool $connectionPool,
    ) {}

    /**
     * Reference to the parent (calling) cObject set from TypoScript
     */
    private ContentObjectRenderer $cObj;

    public function setContentObjectRenderer(ContentObjectRenderer $cObj): void
    {
        $this->cObj = $cObj;
    }

    /**
     * List the headers of the content elements on the page
     *
     * @param  string Empty string (no content to process)
     * @param  array  TypoScript configuration
     * @return string HTML output, showing content elements (in reverse order, if configured)
     */
    public function listContentRecordsOnPage(string $content, array $conf, ServerRequestInterface $request): string
    {
        $connection = $this->connectionPool->getConnectionForTable('tt_content');
        $result = $connection->select(
            ['header'],
            'tt_content',
            ['pid' => $request->getAttribute('frontend.page.information')->getId()],
            [],
            ['sorting' => $conf['reverseOrder'] ? 'DESC' : 'ASC'],
        );
        $output = [];
        foreach ($result as $row) {
            $output[] = $row['header'];
        }
        return implode('<br>', $output);
    }
}
Copied!

Since we need an instance of the ContentObjectRenderer class, we are using the setContentObjectRenderer() method to get it and store it in the cObj class property for later use.

page.30 will give back what the function listContentRecordsOnPage() of the class YourClass returned. This example returns some debug output at the beginning and then the headers of the content elements on the page in reversed order. Note how we defined the property "reverseOrder" for this USER object and how we used it in the PHP code.

Example 3

Another example can be found in the documentation of the stdWrap property There you can also see how to work with $cObj, the reference to the parent (calling) cObject.

Example 4

PHP has a function gethostname() to "get the standard host name for the local machine". You can make it available like this:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.20 = USER_INT
page.20 {
    userFunc = MyVendor\SitePackage\UserFunctions\Hostname->getHostname
}
Copied!

Contents of EXT:site_package/Classes/UserFunctions/Hostname.php:

EXT:site_package/Classes/UserFunctions/Hostname.php
<?php

declare(strict_types=1);

namespace Vendor\SitePackage\UserFunctions;

final class Hostname
{
    /**
     * Return standard host name for the local machine
     *
     * @param  string Empty string (no content to process)
     * @param  array  TypoScript configuration
     * @return string HTML result
     */
    public function getHostname(string $content, array $conf): string
    {
        return gethostname() ?: '';
    }
}
Copied!

Data processors

dataProcessing is a property of FLUIDTEMPLATE and PAGEVIEW.

The property adds one or multiple processors to manipulate the $data variable of the currently rendered content object, like tt_content or page. The sub-property dataProcessing.options can be used to pass parameters to the processor class.

There are several data processors available to allow flexible processing, for example for comma-separated values, related files or related records.

About the examples

All examples listed here can be found in the TYPO3 Documentation Team extension examples.

Once the extension t3docs/examples is installed the examples are available as content elements:

All examples listing here depend on Create a custom content element type. Data processors can also be used in rendering page templates. In this case TypoScript context would be the page record and all fields of the pages table are available.

All examples base on lib.contentElement, which is provided by the system extension fluid_styled_content.

In this system extension it is defined as follows:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.contentElement >
lib.contentElement = FLUIDTEMPLATE
lib.contentElement {
   templateName = Default
   // ...
}
Copied!

The extension examples also sets the paths to the additional templates:

EXT:examples/Configuration/TypoScript/DataProcessors/General.typoscript
lib.contentElement {
    templateRootPaths.200 = EXT:examples/Resources/Private/Templates/ContentElements/
    partialRootPaths.200 = EXT:examples/Resources/Private/Partials/ContentElements/
    layoutRootPaths.200 = EXT:examples/Resources/Private/Layout/
}
Copied!

comma-separated-value data processor

The \TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor , alias comma-separated-value, allows to split values into a two-dimensional array used for CSV files or tt_content records of CType table.

The table data is transformed to a multi-dimensional array, taking the delimiter and enclosure into account, before it is passed to the view.

Options:

Name Type Default
if condition ''
string / stdWrap ''
string defaults to the fieldName
integer / stdWrap 0
string / stdWrap ,
string / stdWrap "

if

if
Type
if condition
Required
false
Default
''

If the condition is met, the data processor is processed.

fieldName

fieldName
Type
string / stdWrap
Required
true
Default
''

Name of the field in the processed ContentObjectRenderer.

as

as
Type
string
Required
false
Default
defaults to the fieldName

The variable's name to be used in the Fluid template.

maximumColumns

maximumColumns
Type
integer / stdWrap
Required
false
Default
0

Maximal number of columns to be transformed. Surplus columns will be silently dropped. When set to 0 (default) all columns will be transformed.

fieldDelimiter

fieldDelimiter
Type
string / stdWrap
Required
false
Default
,

The field delimiter, a character separating the values.

fieldEnclosure

fieldEnclosure
Type
string / stdWrap
Required
false
Default
"

The field enclosure, a character surrounding the values.

Example: Transforming comma separated content into a html table

Please see also About the examples.

In this example, the bodytext field contains comma-separated values (CSV) data. To support different formats, the separator between the values can be specified.

This example is also described in-depth in TYPO3 Explained: Extended content element example.

Example data in the field bodytext

Field bodytext in table tt_content:

"This is row 1 column 1","This is row 1 column 2","This is row 1 column 3"
"This is row 2 column 1","This is row 2 column 2","This is row 2 column 3"
"This is row 3 column 1","This is row 3 column 2","This is row 3 column 3"
Copied!
TypoScript

We define the dataProcessing property to use the CommaSeparatedValueProcessor:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/CommaSeparatedValueProcessor.typoscript
tt_content {
    examples_newcontentcsv =< lib.contentElement
    examples_newcontentcsv {
        templateName = DataProcCsv
        dataProcessing.10 = comma-separated-value
        dataProcessing.10 {
            if.isTrue.field = bodytext
            fieldName = bodytext
            fieldDelimiter.field = tx_examples_separator
            fieldEnclosure = "
            maximumColumns.field = imagecols
            as = myTable
        }
    }
}
Copied!
The Fluid template

In the Fluid template, you can iterate over the processed data. "myContentTable" can be used as a variable {myContentTable} inside Fluid for iteration.

EXT:examples/Resources/Private/Templates/ContentElements/DataProcCsv.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
   <h2>Data in variable "myTable"</h2>
   <f:debug inline="true">{myTable}</f:debug>

   <h2>Output, {data.imagecols} columns separated by char {data.tx_examples_separator}</h2>
   <table class="table table-bordered">
      <f:for each="{myTable}" as="columns" iteration="i">
         <tr>
            <th scope="row">{i.cycle}</th>
            <f:for as="column" each="{columns}">
               <td>{column}</td>
            </f:for>
         <tr>
      </f:for>
   </table>
</html>
Copied!
Output

Using maximumColumns limits the amount of columns in the multi dimensional array. In this example, the field data of the last column will be stripped off. Therefore the output would be:

database-query data processor

The \TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor , alias database-query, fetches records from the database, using standard TypoScript select semantics. The result is then passed to the FLUIDTEMPLATE as an array.

This way a FLUIDTEMPLATE cObject can iterate over the array of records.

New in version 13.2

Options:

Name Type Default
if condition ''
string / stdWrap ''
string / stdWrap 'records'
array of Data processors []

if

if
Type
if condition
Required
false
Default
''

Only if the condition is met the data processor is executed.

table

table
Type
string / stdWrap
Required
true
Default
''

Name of the table from which the records should be fetched.

as

as
Type
string / stdWrap
Required
false
Default
'records'

The variable's name to be used in the Fluid template.

dataProcessing

dataProcessing
Type
array of Data processors
Required
false
Default
[]

Array of data processors to be applied to all fetched records.

Example: Usage in combination with the RecordTransformationProcessor

New in version 13.2

Example usage for the data processor in conjunction with the record-transformation data processor.

EXT:my_extension/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
  10 = PAGEVIEW
  10 {
    paths.10 = EXT:my_extension/Resources/Private/Templates/
    dataProcessing {
      10 = database-query
      10 {
        as = categories
        table = sys_category
        where = parent=0
        dataProcessing.10 = record-transformation
      }
    }
  }
}
Copied!

For usage of the variables within Fluid see Example: Usage with FLUIDTEMPLATE.

Example: Display haiku records

Please see also About the examples.

TypoScript

We define the dataProcessing property to use the DatabaseQueryProcessor:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/DatabaseQueryProcessor.typoscript
tt_content {
    examples_dataprocdb =< lib.contentElement
    examples_dataprocdb {
        templateName = DataProcDb
        dataProcessing.10 = database-query
        dataProcessing.10 {
            if.isTrue.field = pages
            table = tx_examples_haiku
            orderBy = title
            pidInList.field = pages
            as = myHaikus
            // recursively process the images in the records with the FilesProcessor
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = image
                }
            }
        }
    }
}
Copied!
The Fluid template

In the Fluid template then iterate over the records. As we used the recursive data processor files data processor on the image records, we can also output the images.

EXT:examples/Resources/Private/Templates/ContentElements/DataProcDb.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
   <h2>Data in variable myHaikus</h2>
   <f:debug inline="true">{myHaikus}</f:debug>

   <h2>Output</h2>
   <div class="row">
      <f:for each="{myHaikus}" as="haiku">
         <div class="col-12 col-md-3">
            <div class="card" style="backgorund-color: {haiku.color};">
               <f:if condition="{haiku.files.0}">
                  <f:image image="{haiku.files.0}" class="card-img-top" height="300"/>
               </f:if>
               <div class="card-body">
                  <h5 class="card-title">{haiku.data.title}</h5>
                  <div class="card-text"><f:format.html>{haiku.data.poem}</f:format.html></div>
               </div>
            </div>
         </div>
      </f:for>
   </div>

</html>
Copied!
Output

Each entry of the records array contains the data of the table in data and the data of the images in files.

Haiku record data dump and output

Haiku record data dump and output

files data processor

This data processor \TYPO3\CMS\Frontend\DataProcessing\FilesProcessor , alias files, can be used for processing file information:

  • relations to file records (sys_file_reference)
  • fetch files records by their uids in table (sys_file)
  • all files from a certain folder
  • all files from a collection

A FLUIDTEMPLATE can then iterate over processed data automatically.

Options:

Name Type Default
if condition ''
string (comma-separated integers) / stdWrap ''
string / stdWrap ''
string / stdWrap ''
string (comma-separated integers) / stdWrap ''
string (comma-separated integers) / stdWrap ''
string (comma-separated folders), stdWrap ""
string / stdWrap ""
string / stdWrap ""
string / stdWrap "ascending"
string / stdWrap "files"

if

if
Type
if condition
Required
false
Default
''

Only, if the condition is met the data processor is executed.

references

references
Type
string (comma-separated integers) / stdWrap
Required
false
Default
''
Example
'1,303,42'

If this option contains a comma-separated list of integers, these are treated as uids of file references (sys_file_reference).

The corresponding file records are added to the output array.

stdWrap properties can also be used, see Example 2: use stdWrap property on references.

references.fieldName

references.fieldName
Type
string / stdWrap
Required
false
Default
''
Example
'media'

If both references.fieldName and references.table are set, the file records are fetched from the referenced table and field, for example the media field of a tt_content record.

references.table

references.table
Type
string / stdWrap
Required
false
Default
''
Example
'tt_content'

If references should be interpreted as TypoScript select function, references.fieldName must be set to the desired field name of the table to be queried.

files

files
Type
string (comma-separated integers) / stdWrap
Required
false
Default
''
Example
'1,303,42'

If this option contains a comma-separated list of integers, these are treated as uids of files (sys_file).

collections

collections
Type
string (comma-separated integers) / stdWrap
Required
false
Default
''
Example
'1,303,42'

If this option contains a comma-separated list of integers, these are treated as uids of collections. The file records in each collection are then being added to the output array.

folders

folders
Type
string (comma-separated folders), stdWrap
Required
false
Default
""
Example
"23:/other/folder/"

Fetches all files from the referenced folders. The following syntax is possible:

t3://folder?storage=2&identifier=/my/folder/
Folder /my/folder/ from storage with uid 2
23:/other/folder/
Folder /other/folder/ from storage with uid 23
/folderInMyFileadmin/something/:
Folder /folderInMyFileadmin/something/ from the default storage 0 (fileadmin)

folders.recursive

folders.recursive
Type
string / stdWrap
Required
false
Default
""
Example
"1"

If set to a non-empty value file, records will be added from folders recursively.

sorting

sorting
Type
string / stdWrap
Required
false
Default
""
Example
"filesize"

The property of the file records by which they should be sorted. For example, filesize or title.

sorting.direction

sorting.direction
Type
string / stdWrap
Required
false
Default
"ascending"
Example
"descending"

The sorting direction (ascending or descending).

as

as
Type
string / stdWrap
Required
false
Default
"files"

The variable name to be used in the Fluid template.

Example 1: Render the images stored in field image

Please see also About the examples.

TypoScript

Using the FilesProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/FilesProcessor.typoscript
tt_content {
    examples_dataprocfiles =< lib.contentElement
    examples_dataprocfiles {
        templateName = DataProcFiles
        dataProcessing.10 = files
        dataProcessing.10 {
            as = images
            references.fieldName = image
            references.table = tt_content
            sorting = title
            sorting.direction = descending
        }
    }
}
Copied!
The Fluid template

Then iterate over the files in the Fluid template:

EXT:examples/Resources/Private/Templates/ContentElements/DataProcFiles.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
   <h2>Data in variable images</h2>
   <f:debug inline="true">{images}</f:debug>
   <h2>Data in variable images</h2>

   <div class="row">
      <div class="row">
         <f:for each="{images}" as="image">
            <div class="col-12 col-md-3">
               <div class="card">
                  <f:image image="{image}" class="card-img-top" height="250"/>
                  <div class="card-body">
                     <h5 class="card-title">{image.title}</h5>
                     <div class="card-text">{image.description}</div>
                  </div>
               </div>
            </div>
         </f:for>
      </div>
   </div>
</html>
Copied!
Output

The array images contains the data of the files now:

files dump and output

Example 2: use stdWrap property on references

The following example implements a slide functionality on root line for file resources:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    10 {
        references.data = levelmedia: -1, slide
        as = myfiles
    }
}
Copied!

The FilesProcessor can slide up the root line to collect images for Fluid templates. One usual feature is to take images attached to pages and use them on the page tree as header images in the frontend.

Example 3: files from a FlexForm

If the files are stored in a FlexForm, the entry in the table sys_file_reference uses the name of the main table, for example tt_content and the FlexForm key as fieldname.

Therefore, you can do the following:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    10 {
        references.table = tt_content
        references.field = settings.myImage
        as = myImageFromFlexForm
    }
}
Copied!

This assumes that the image was stored in a FlexForm in the table tt_content like this:

EXT:site_package/Configuration/FlexForm/MyFlexForm.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
    <sheets>
        <main>
            <ROOT type="array">
                <TCEforms><sheetTitle>Something</sheetTitle></TCEforms>
                <type>array</type>
                <el type="array">
                    <settings.myImage>
                        <TCEforms>
                            <label>My Images</label>
                            <config>
                                <type>file</type>
                                <maxitems>6</maxitems>
                                <allowed>common-image-types</allowed>
                            </config>
                        </TCEforms>
                    </settings.myImage>
                </el>
            </ROOT>
        </main>
    </sheets>
</T3DataStructure>
Copied!

Three images in the same content element (uid 15) having the FlexForm above would look like this in the the database table sys_file_reference:

uid pid uid_local uid_foreign tablenames fieldnames ...
42 120 12 15 tt_content settings.myImage ...
43 120 25 15 tt_content settings.myImage ...
44 120 128 15 tt_content settings.myImage ...

flex-form data processor

TYPO3 offers FlexForms which can be used to store data within an XML structure inside a single database column. The data processor \TYPO3\CMS\Frontend\DataProcessing\FlexFormProcessor , alias flex-form, converts the FlexForm data of a given field into a Fluid-readable array.

Options

Name Type Default
string 'pi_flexform'
string 'flexFormData'

fieldname

fieldname
Type
string
Required
false
Default
'pi_flexform'

Field name of the column the FlexForm data is stored in.

references

references

New in version 13.0

Required

false

type

array

Associative array of FlexForm fields (key) and the according database field (value).

Each FlexForm field, which should be resolved, needs a reference definition to the foreign_match_fields. This reference is used in the FilesProcessor to resolve the correct FAL resource.

See Example of resolving FAL references.

as

as
Type
string
Required
false
Default
'flexFormData'

Name for the variable in the Fluid template.

Examples

Example of a minimal TypoScript configuration

EXT:my_extension/Configuration/TypoScript/setup.typoscript
10 = flex-form
Copied!

The converted array can be accessed within the Fluid template with the {flexFormData} variable.

Example of an advanced TypoScript configuration

EXT:my_extension/Configuration/TypoScript/setup.typoscript
10 = flex-form
10 {
    fieldName = my_flexform_field
    as = myOutputVariable
}
Copied!

The converted array can be accessed within the Fluid template with the {myOutputVariable} variable.

Example with a custom sub-processor

EXT:my_extension/Configuration/TypoScript/setup.typoscript
10 = flex-form
10 {
    fieldName = my_flexform_field
    as = myOutputVariable
    dataProcessing {
        10 = Vendor\MyExtension\DataProcessing\CustomFlexFormProcessor
    }
}
Copied!

Example of resolving FAL references

New in version 13.0

Example of an advanced TypoScript configuration, which processes the field my_flexform_field, resolves its FAL references and assigns the array to the myOutputVariable variable:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
10 = flex-form
10 {
  fieldName = my_flexform_field
  references {
    my_flex_form_group.my_flex_form_field = my_field_reference
  }
  as = myOutputVariable
}
Copied!

The according FlexForm configuration:

Excerpt of a FlexForm configuration
<my_flex_form_group.my_flex_form_field>
    <label>LLL:EXT:sitepackage/Resources/Private/Language/locallang_be.xlf:my_flex_form_field</label>
    <config>
        <type>file</type>
        <maxitems>9</maxitems>
        <foreign_selector_fieldTcaOverride>
            <config>
                <appearance>
                    <elementBrowserType>file</elementBrowserType>
                    <elementBrowserAllowed>gif,jpg,jpeg,png,svg</elementBrowserAllowed>
                </appearance>
            </config>
        </foreign_selector_fieldTcaOverride>
        <foreign_types type="array">
            <numIndex index="0">
                <showitem>
                    --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
                </showitem>
            </numIndex>
            <numIndex index="1">
                <showitem>
                    --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
                </showitem>
            </numIndex>
        </foreign_types>
        <appearance type="array">
            <headerThumbnail>
                <height>64</height>
                <width>64</width>
            </headerThumbnail>
            <enabledControls>
                <info>1</info>
                <dragdrop>0</dragdrop>
                <sort>1</sort>
                <hide>0</hide>
                <delete>1</delete>
                <localize>1</localize>
            </enabledControls>
            <createNewRelationLinkTitle>
                LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference
            </createNewRelationLinkTitle>
        </appearance>
        <behaviour>
            <localizationMode>select</localizationMode>
            <localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
        </behaviour>
        <overrideChildTca>
            <types type="array">
                <numIndex index="2">
                    <showitem>
                        --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
                    </showitem>
                </numIndex>
            </types>
        </overrideChildTca>
        <allowed>jpg,png,svg,jpeg,gif</allowed>
    </config>
</my_flex_form_group.my_flex_form_field>
Copied!

language-menu data processor

The processor \TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor , alias language-menu, generates a list of language menu items which can be assigned to the FLUIDTEMPLATE as a variable.

Table of contents

Options:

Name Type Default
if condition
string / stdWrap "auto"
string / stdWrap ""
string defaults to the fieldName

if

if
Type
if condition
Required
false

Only if the condition is met the data processor is executed.

languages

languages
Type
string / stdWrap
Required
true
Default
"auto"
Example
"0,1,2"

A list of comma-separated language IDs (e.g. 0,1,2) to use for the menu creation or auto to load from the site configuration.

addQueryString.exclude

addQueryString.exclude
Type
string / stdWrap
Required
true
Default
""
Example
"gclid,contrast"

A list of comma-separated parameter names to be excluded from the language menu URLs.

as

as
Type
string
Required
false
Default
defaults to the fieldName

The variable name to be used in the Fluid template.

Example: Menu of all language from site configuration

Please see also About the examples.

TypoScript

Using the LanguageMenuProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/LanguageMenuProcessor.typoscript
tt_content {
    examples_dataproclang =< lib.contentElement
    examples_dataproclang {
        templateName = DataProcLangMenu
        dataProcessing.10 = language-menu
        dataProcessing.10 {
            languages = auto
            as = languageNavigation
        }
    }
}
Copied!
The Fluid template

This generated menu can be used in Fluid like this:

EXT:examples/Resources/Private/Templates/ContentElements/DataProcLangMenu.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
   <h2>Data in variable languageNavigation</h2>
   <f:debug inline="true">{languageNavigation}</f:debug>

   <h2>Output</h2>
   <f:if condition="{languageNavigation}">
      <ul id="language" class="language-menu">
         <f:for each="{languageNavigation}" as="item">
            <li class="{f:if(condition: item.active, then: 'active')}
                    {f:if(condition: item.available, else: ' text-muted')}">
               <f:if condition="{item.available}">
                  <f:then>
                     <a href="{item.link}" hreflang="{item.hreflang}"
                        title="{item.navigationTitle}">
                        <span>{item.navigationTitle}</span>
                     </a>
                  </f:then>
                  <f:else>
                     <span>{item.navigationTitle}</span>
                  </f:else>
               </f:if>
            </li>
         </f:for>
      </ul>
   </f:if>

</html>
Copied!
Output

The array now contains information on all languages as defined in the site configuration. As the current page is not translated into German, the German language has the item.available set to false. It therefore does not get linked in the template.

Categories

Makes a menu of pages belonging to one or more categories. If a page belongs to several of the selected categories, it will appear only once. By default pages are unsorted.

Each in the resulting array of pages gets an additional entry with key _categories containing the list of categories the page belongs to, as a comma-separated list of uid's. It can be accessed with or . like any other field.

Properties

Name Type Default
list of categories / stdWrap
string / stdWrap categories
string / stdWrap
asc or desc / stdWrap asc

special.value

special.value
Type
list of categories / stdWrap
Example
Example: List pages in categories with UID 1 and 2

Comma-separated list of categories UID's.

special.relation

special.relation
Type
string / stdWrap
Default
categories

Name of the categories-relation field to use for building the list of categorized pages, as there can be several such fields on a given table.

special.sorting

special.sorting
Type
string / stdWrap

Which field from the pages table should be used for sorting. Language overlays are taken into account, so alphabetical sorting on the "title" field, for example, will work.

If an unknown field is defined, the pages will not be sorted.

special.order

special.order
Type
asc or desc / stdWrap
Default
asc

Order in which the pages should be ordered, ascending or descending. Should be asc or desc, case-insensitive. Will default to asc in case of invalid value.

Examples

Example: Menu of pages in a certain category

The content element Menu > Categorized pages provided by the system extension EXT:fluid_styled_content is configured with a MenuProcessor which is based on the options of the HMENU and provides all its properties:

EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuCategorizedPages.typoscript
# Pages for selected categories:
# ...
#
# CType: menu_categorized_pages

tt_content.menu_categorized_pages =< lib.contentElement
tt_content.menu_categorized_pages {
    templateName = MenuCategorizedPages
    dataProcessing {
        10 = menu
        10 {
            special = categories
            special {
                value.field = selected_categories
                relation.field = category_field
                sorting = title
                order = asc
            }
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = media
                }
            }
        }
    }
}
Copied!

The following Fluid template can be used to style the menu:

EXT:fluid_styled_content/Resources/Private/Templates/MenuCategorizedPages.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">

    <f:if condition="{menu}">
        <ul>
            <f:for each="{menu}" as="page">
                <li>
                    <a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')}{f:if(condition: page.current, then: ' aria-current="page"')} title="{page.title}">
                        <span>{page.title}</span>
                    </a>
                </li>
            </f:for>
        </ul>
    </f:if>

</f:section>
</html>
Copied!

Example: List pages in categories with UID 1 and 2

20 = HMENU
20 {
    special = categories
    special.value = 1,2
    1 = TMENU
    1.NO {
        // ...
    }
}
Copied!

Directory menu - menu of subpages

A HMENU of type special = directory lets you create a menu listing the subpages of one or more parent pages.

The parent pages are defined in the property special.value.

This menu type can be used, for example, to display all subpages of a certain page as meta menu or footer menu.

Mount pages are supported.

Properties

Name Type Default
Comma separated list of page IDs /stdWrap current page ID

special.value

special.value
Type
Comma separated list of page IDs /stdWrap
Default
current page ID

This will generate a menu of all pages with pid = 35 and pid = 56.

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.metaMenu = HMENU
lib.metaMenu {
    special = directory
    special.value = 35, 56
    // render the menu
}
Copied!

Example: Menu of all subpages

The content element Menu > Subpages provided by the system extension EXT:fluid_styled_content is configured with a MenuProcessor which is based on the options of the HMENU and provides all its properties:

EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuSubpages.typoscript
# Menu of subpages of selected pages:
# ...
#
# CType: menu_subpages

tt_content.menu_subpages =< lib.contentElement
tt_content.menu_subpages {
    templateName = MenuSubpages
    dataProcessing {
        10 = menu
        10 {
            special = directory
            special.value.field = pages
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = media
                }
            }
        }
    }
}
Copied!

The following Fluid template can be used to style the menu:

EXT:fluid_styled_content/Resources/Private/Templates/MenuSubpages.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">

    <f:if condition="{menu}">
        <ul>
            <f:for each="{menu}" as="page">
                <li>
                    <a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')}{f:if(condition: page.current, then: ' aria-current="page"')} title="{page.title}">
                        <span>{page.title}</span>
                    </a>
                </li>
            </f:for>
        </ul>
    </f:if>

</f:section>
</html>
Copied!

Pure TypoScript language menu (For backward compatibility)

See TYPO3 11.5 - Language menu for examples how to use the language menu with the HMENU.

List menu

A HMENU of type special = list lets you create a menu that lists the pages you define in the property special.value.

Mount pages are supported.

Properties

Name Type
list of page IDs /stdWrap

special.value

special.value
Type
list of page IDs /stdWrap
Default
0

This will generate a menu with the two pages (uid=35 and uid=56) listed:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.listOfSelectedPages = HMENU
lib.listOfSelectedPages {
    special = list
    special.value = 35, 56
    // render the menu
}
Copied!

If special.value is not set, the default uid is 0, so that only your homepage will be listed.

Example: Menu of all subpages

The content element Menu > Pages provided by the system extension fluid_styled_content is configured with a MenuProcessor which is based on the options of the HMENU and provides all its properties:

EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuPages.typoscript
# Menu of selected pages:
# ...
#
# CType: menu_pages

tt_content.menu_pages =< lib.contentElement
tt_content.menu_pages {
    templateName = MenuPages
    dataProcessing {
        10 = menu
        10 {
            special = list
            special.value.field = pages
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = media
                }
            }
        }
    }
}
Copied!

The following Fluid template can be used to style the menu:

EXT:fluid_styled_content/Resources/Private/Templates/MenuPages.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">
    <f:if condition="{menu}">
        <ul>
            <f:for each="{menu}" as="page">
                <li>
                    <a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')}{f:if(condition: page.current, then: ' aria-current="page"')} title="{page.title}">
                        <span>{page.title}</span>
                    </a>
                </li>
            </f:for>
        </ul>
    </f:if>

</f:section>
</html>
Copied!

Rootline - breadcrumb menu

The path of pages from the current page to the root page of the page tree is called "rootline".

A root line menu is a menu which shows you these pages one by one in their hierarchical order.

An HMENU with the property special = rootline creates a root line menu (also known as "breadcrumb trail") that could look like this:

Page level 1 > Page level 2 > Page level 3 > Current page
Copied!

Such a click path facilitates the user's orientation on the website and makes navigation to a certain page level easier.

Properties

Name Type Default
string /stdWrap
boolean false
boolean false

special.range

special.range
Type
string /stdWrap
Syntax
[begin-level] | [end-level]
Example
Example: Skip the current page

[begin-level] | [end-level] are interpreted like the .entryLevel for an HMENU).

special.reverseOrder

special.reverseOrder
Type
boolean
Default
false

If set to true, the order of the root line menu elements will be reversed.

special.targets.[level number]

special.targets.[level number]
Type
boolean
Default
false
Example
Example: Set targets for levels

For framesets. You can set a default target and a target for each level by using the level number as sub-property.

Examples

Example: Skip the current page

The following example will start at level 1 and does not show the page the user is currently on:

EXT:site_package/Configuration/TypoScript/setup.typoscript
temp.breadcrumbs = HMENU
temp.breadcrumbs.special = rootline
temp.breadcrumbs.special.range = 1|-2
Copied!

Example: Set targets for levels

Here the links to pages on level 3 will have target="page", while all other levels will have target="_top" as defined for the TMENU property target.

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.2 = HMENU
page.2.special = rootline
page.2.special.range = 1|-2
page.2.special.targets.3 = page
page.2.1 = TMENU
page.2.1.target = _top
page.2.1.wrap = <ol> | <ol>
page.2.1.NO.linkWrap = <li> | </li>
Copied!

Updated HMENU

An HMENU with the property special = updated will create a menu of the most recently updated pages.

By default the most recently updated page is displayed on top.

Mount pages are supported.

Properties

Name Type Default
list of page IDs /stdWrap
string SYS_LASTCHANGED
integer 20
integer 0
integer +calc
integer 10
boolean false

special.value

special.value
Type
list of page IDs /stdWrap

This will generate a menu of the most recently updated pages from the branches in the tree starting with the UIDs (uid=35 and uid=56) listed.

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = HMENU
20.special = updated
20.special.value = 35, 56
Copied!

special.mode

special.mode
Type
string
Default
SYS_LASTCHANGED

The field in the database, which should be used to get the information about the last update from.

Possible values are:

SYS_LASTCHANGED
Is updated to the youngest time stamp of the records on the page when a page is generated.
crdate
Uses the crdate field of the page record. This field is set once on creation of the record and left unchanged afterwards.
tstamp
Uses the tstamp field of the page record, which is set automatically when the record is changed.
manual or lastUpdated
Uses the field lastUpdated, which can be set manually in the page record.
starttime
Uses the starttime field.

Fields with empty values are generally not selected.

special.depth

special.depth
Type
integer
Default
20

Defines the tree depth.

The allowed range is 1-20.

A depth of 1 means only the start ID, depth of 2 means start ID + first level.

Note: "depth" is relative to special.beginAtLevel.

special.beginAtLevel

special.beginAtLevel
Type
integer
Default
0

Determines starting level for the page trees generated based on .value and .depth.

0 is default and includes the start id.

1 starts with the first row of subpages,

2 starts with the second row of subpages.

Note: "depth" is relative to this property.

special.maxAge

special.maxAge
Type
integer +calc

Only show pages, whose update-date at most lies this number of seconds in the past. Or with other words: Pages with update-dates older than the current time minus this number of seconds will not be shown in the menu no matter what.

By default all pages are shown. You may use +-*/ for calculations.

special.limit

special.limit
Type
integer
Default
10

Maximal number of items in the menu. Default is 10, max is 100.

special.excludeNoSearchPages

special.excludeNoSearchPages
Type
boolean
Default
false

If set, pages marked No search are not included.

Example: Recently updated pages styled with Fluid

The content element Recently Updated Pages provided by the system extension EXT:fluid_styled_content is configured with a MenuProcessor which is based on the options of the HMENU and provides all its properties:

EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuRecentlyUpdated.typoscript
# Recently updated pages:
# ...
#
# CType: menu_recently_updated

tt_content.menu_recently_updated =< lib.contentElement
tt_content.menu_recently_updated {
    templateName = MenuRecentlyUpdated
    dataProcessing {
        10 = menu
        10 {
            special = updated
            special {
                value.field = pages
                maxAge = 3600*24*7
                excludeNoSearchPages = 1
            }
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = media
                }
            }
        }
    }
}
Copied!

The following Fluid template can be used to style the menu:

EXT:fluid_styled_content/Resources/Private/Templates/MenuRecentlyUpdated.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">

    <f:if condition="{menu}">
        <ul>
            <f:for each="{menu}" as="page">
                <li>
                    <a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')}{f:if(condition: page.current, then: ' aria-current="page"')} title="{page.title}">
                        <span>{page.title}</span>
                    </a>
                </li>
            </f:for>
        </ul>
    </f:if>

</f:section>
</html>
Copied!

Userfunction menu (For backward compability)

See TYPO3 11.5 -Userfunction menu for examples how to use the language menu with the HMENU.

page-content data processor

New in version 13.2

This data processor \TYPO3\CMS\Frontend\DataProcessing\PageContentFetchingProcessor , alias page-content, loads all tt_content records from the current backend layout into the template with a given identifier for each colPos, also respecting slideMode or collect options based on the page layouts content columns.

An array of Record objects will be passed to the Fluid template. You can use the CObject ViewHelper <f:cObject> to display the content elements.

Options

Name Type Default
string "content"
if condition ''

as

as
Type
string
Required
false
Default
"content"

Name for the variable in the Fluid template.

if

if
Type
if condition
Required
false
Default
''

Only if the condition is met the data processor is executed.

Example: Use the page-content data processor to display the content

config/sites/my-site/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths.10 = EXT:my_sitepackage/Resources/Private/Templates/
        dataProcessing.10 = page-content
        dataProcessing.10.as = myContent
    }
}
Copied!

Use the identifiers of the columns in the Fluid template:

EXT:my_sitepackage/Resources/Private/Templates/Pages/Default.html
<main>
    <f:for each="{myContent.jumbotron.records}" as="contentElement">
        <f:if condition="{contentElement.fullType} = 'tt_content.my_extension_jumbotron'">
            <h2>{contentElement.header}</h2>
            <f:format.html>{contentElement.bodytext}</f:format.html>
        </f:if>
    </f:for>
    <f:for each="{myContent.left.records}" as="contentElement">
        <f:cObject
            typoscriptObjectPath="{contentElement.mainType}"
            table="{contentElement.mainType}"
            data="{contentElement}"
        />
    </f:for>
</main>
<aside>
    <f:for each="{myContent.right.records}" as="contentElement">
        <f:if condition="{contentElement.fullType} = 'tt_content.header'">
            <h2>{contentElement.header}</h2>
        </f:if>
    </f:for>
</aside>
Copied!

You can use the CObject ViewHelper <f:cObject> to render the content element using typo3/cms-fluid-styled-content or render it your self.

{contentElement.mainType}
Is always "tt_content" for content elements.
{contentElement.fullType}
Is composed of "tt_content.[CType]". For a content element of type text it contains "tt_content.text".

The backend layout is defined like this:

config/sites/my-site/page.tsconfig
mod.web_layout.BackendLayouts {
    default {
        title = Default
        config {
            backend_layout {
                colCount = 2
                rowCount = 2
                rows {
                    1 {
                        columns {
                            1 {
                                name = Jumbotron
                                colPos = 1
                                identifier = jumbotron
                                slideMode = slide
                                colspan = 2
                            }
                        }
                    }

                    2 {
                        columns {
                            1 {
                                name = Left
                                colPos = 0
                                identifier = left
                            }

                            2 {
                                name = Right
                                colPos = 2
                                identifier = right
                                slideMode = collectReverse
                            }
                        }
                    }
                }
            }
        }
    }
}
Copied!

Modify the result via AfterContentHasBeenFetchedEvent

New in version 13.4.2 | 14.0

The event AfterContentHasBeenFetchedEvent can be used to modify the content elements fetched by the page-content data processor.

See the following example: Filter content elements provided by the page-content data processor.

record-transformation data processor

New in version 13.2

A new TypoScript data processor for FLUIDTEMPLATE and PAGEVIEW has been added.

The \TYPO3\CMS\Frontend\DataProcessing\RecordTransformationProcessor , alias record-transformation, can typically be used in conjunction with the DatabaseQuery Data Processor. The DatabaseQuery Data Processor typically fetches records from the database, and the record-transformation will take the result, and transforms the objects into Record objects, which contain only relevant data from the TCA table, which has been configured in the TCA columns fields for this record.

This is especially useful for TCA tables, which contain "types" (such as pages or tt_content database tables), where only relevant fields are added to the record object. In addition, special fields from "enableColumns" or deleted fields, next to language and version information are extracted so they can be addressed in a unified way.

The type property contains the database table name and the actual type based on the record, such tt_content.textmedia for Content Elements.

Example: Usage with the DatabaseQueryProcessor

Example usage for the Data Processor in conjunction with the database-query data processor.

EXT:my_extension/Configuration/TypoScript/setup.typoscript
page = PAGE
page {
  10 = PAGEVIEW
  10 {
    paths.10 = EXT:my_extension/Resources/Private/Templates/
    dataProcessing {
      10 = database-query
      10 {
        as = categories
        table = sys_category
        where = parent=0
        dataProcessing.10 = record-transformation
      }
    }
  }
}
Copied!

Example: Usage with FLUIDTEMPLATE

Transform the current data array of FLUIDTEMPLATE to a record object. This can be used for Content Elements of Fluid Styled Content or custom ones. In this example the Fluid Styled Content element "Text" has its data transformed for easier and enhanced usage.

EXT:my_extension/Configuration/TypoScript/setup.typoscript
# tt_content.text = FLUIDTEMPLATE
tt_content.text {
  templateName = Text
  dataProcessing {
    10 = record-transformation
    10 {
      as = data
    }
  }
}
Copied!

Usage in Fluid

The f:debug output of the Record object is misleading for integrators, as most properties are accessed differently as one would assume. The debug view is most of all a better organized overview of all available information. E.g. the property properties lists all relevant fields for the current Content Type.

We are dealing with an object here. You however can access your record properties as you are used to with {record.title} or {record.uid}. In addition, you gain special, context-aware properties like the language {record.languageId} or workspace {data.versionInfo.workspaceId}.

Overview of all possibilities:

Demonstration of available variables in Fluid
<!-- Any property, which is available in the Record (like normal) -->
{record.title}
{record.uid}
{record.pid}

<!-- Language related properties -->
{record.languageId}
{record.languageInfo.translationParent}
{record.languageInfo.translationSource}

<!-- The overlaid uid -->
{record.overlaidUid}

<!-- Types are a combination of the table name and the Content Type name. -->
<!-- Example for table "tt_content" and CType "textpic": -->

<!-- "tt_content" (this is basically the table name) -->
{record.mainType}

<!-- "textpic" (this is the CType) -->
{record.recordType}

<!-- "tt_content.textpic" (Combination of mainType and record type, separated by a dot) -->
{record.fullType}

<!-- System related properties -->
{data.systemProperties.isDeleted}
{data.systemProperties.isDisabled}
{data.systemProperties.isLockedForEditing}
{data.systemProperties.createdAt}
{data.systemProperties.lastUpdatedAt}
{data.systemProperties.publishAt}
{data.systemProperties.publishUntil}
{data.systemProperties.userGroupRestriction}
{data.systemProperties.sorting}
{data.systemProperties.description}

<!-- Computed properties depending on the request context -->
{data.computedProperties.versionedUid}
{data.computedProperties.localizedUid}
{data.computedProperties.requestedOverlayLanguageId}
{data.computedProperties.translationSource} <!-- Only for pages, contains the Page model -->

<!-- Workspace related properties -->
{data.versionInfo.workspaceId}
{data.versionInfo.liveId}
{data.versionInfo.state.name}
{data.versionInfo.state.value}
{data.versionInfo.stageId}
Copied!

Options:

Name Type Default
string / stdWrap 'record' or 'records'
if condition ''
string auto-resolved
string 'data'

as

as
Type
string / stdWrap
Default
'record' or 'records'

The target variable containing the resolved record objects. If empty, 'record' or 'records' (if multiple records are given) is used.

if

if
Type
if condition
Default
''

Only if the condition is met the Data Processor is executed.

table

table
Type
string
Default
auto-resolved

The name of the database table of the records. Leave empty to auto-resolve the table from context.

If you are dealing with a custom data source you can adjust it here.

variableName

variableName
Type
string
Default
'data'

The variable that contains the record(s) from a previous Data Processor, or from a FLUIDTEMPLATE view.

If you are dealing with a custom data source you can adjust it here.

site data processor

The \TYPO3\CMS\Frontend\DataProcessing\SiteProcessor , alias site, fetches data from the site configuration.

Table of contents

Options

Name Type Default
string "site"

as

as
Type
string
Required
false
Default
"site"

The variable name to be used in the Fluid template.

Example: Output some data from the site configuration

Please see also About the examples.

TypoScript

Using the SiteProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/SiteProcessor.typoscript
tt_content {
    examples_dataprocsite =< lib.contentElement
    examples_dataprocsite {
        templateName = DataProcSite
        dataProcessing.10 = site
        dataProcessing.10 {
            as = site
        }
    }
}
Copied!
The Fluid templat

In the Fluid template the properties of the site configuration can be accessed:

EXT:examples/Resources/Private/Templates/ContentElements/DataProcSite.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
   <h2>Data in variable site</h2>
   <f:debug inline="true">{site}</f:debug>

   <h2>Output</h2>

   <p>Base url: <f:link.page pageUid="{site.rootPageId}">{site.configuration.base}</f:link.page></p>

</html>
Copied!
Output

The array now contains the information from the site configuration:

site-language data processor

The \TYPO3\CMS\Frontend\DataProcessing\SiteLanguageProcessor , alias site-language, fetches language-related data from the site configuration.

Options

Name Type Default
string "site"

as

as
Type
string
Required
false
Default
"site"

The variable name to be used in the Fluid template.

Example: Output some data from the site language configuration

Please see also About the examples.

TypoScript

Using the SiteLanguageProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/SiteLanguageProcessor.typoscript
tt_content {
    examples_dataprocsitelanguage =< lib.contentElement
    examples_dataprocsitelanguage {
        templateName = DataProcSiteLanguage
        dataProcessing.10 = site-language
        dataProcessing.10 {
            as = language
        }
    }
}
Copied!
The Fluid template

In the Fluid template the properties of the site language configuration can be accessed:

EXT:examples/Resources/Private/Templates/ContentElements/DataProcSiteLanguage.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
<h2>Data in variable site</h2>
<f:debug inline="true">{language}</f:debug>

<h2>Output</h2>

<p>language id: {language.languageId}</p>

</html>
Copied!
Output

The array now contains the information from the site language configuration:

split data processor

The \TYPO3\CMS\Frontend\DataProcessing\SplitProcessor , alias split, allows to split values separated with a delimiter from a single database field. The result is an array that can be iterated over. Whitespaces are automatically trimmed.

Table of contents

Options

Name Type Default
if condition ''
string / stdWrap ''
string defaults to the fieldName
string / stdWrap Line Feed
boolean / stdWrap 0
boolean / stdWrap 0
boolean / stdWrap 0

if

if
Type
if condition
Required
false
Default
''

Only if the condition is met the data processor is executed.

fieldName

fieldName
Type
string / stdWrap
Required
true
Default
''

Name of the field to be used.

as

as
Type
string
Required
false
Default
defaults to the fieldName

The variable name to be used in the Fluid template.

delimiter

delimiter
Type
string / stdWrap
Required
false
Default
Line Feed
Example
","

The field delimiter, a character separating the values.

filterIntegers

filterIntegers
Type
boolean / stdWrap
Required
false
Default
0
Example
1

If set to 1, all values are being cast to int.

filterUnique

filterUnique
Type
boolean / stdWrap
Required
false
Default
0
Example
1

If set to 1, all duplicates will be removed.

removeEmptyEntries

removeEmptyEntries
Type
boolean / stdWrap
Required
false
Default
0
Example
1

If set to 1, all empty values will be removed.

Example: Splitting a URL

Please see also About the examples.

TypoScript

With the help of the SplitProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/SplitProcessor.typoscript
tt_content {
    examples_dataprocsplit =< lib.contentElement
    examples_dataprocsplit {
        templateName = DataProcSplit
        dataProcessing.10 = split
        dataProcessing.10 {
            as = urlParts
            delimiter = /
            fieldName = header_link
            removeEmptyEntries = 0
            filterIntegers = 0
            filterUnique = 0
        }
    }
}
Copied!
The Fluid template

In the Fluid template then iterate over the split data:

EXT:examples/Resources/Private/Templates/ContentElements/DataProcSplit.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
   <h2>Data in variable urlParts</h2>
   <f:debug inline="true">{urlParts}</f:debug>

   <h2>Output</h2>
   <f:for each="{urlParts}" as="part" iteration="i">
      <span class="text-primary">{part}</span>
      <f:if condition="{i.isLast} == false">/</f:if>
   </f:for>

</html>
Copied!
Output

The array now contains the split strings:

Custom data processors

Implementing a custom data processor is out of scope in this reference. You can find information on the implementation in TYPO3 Explained.

Custom data processors can be used in TypoScript just like any other data processor:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/CustomCategoryProcessor.typoscript
tt_content {
    examples_dataproccustom =< lib.contentElement
    examples_dataproccustom {
        templateName = DataProcCustom
        dataProcessing.10 = custom-category
        dataProcessing.10 {
            as = categories
            categoryList.field = categories
        }
    }
}
Copied!

The available configuration depends on the implementation of the specific custom data processor, of course.

Example output

Top-level objects

As described in the TypoScript syntax introduction TypoScript templates are converted into a multidimensional PHP array. You can view this in the TypoScript object browser. Top level objects are located on the top level. Top level objects are for example config or plugin.

  • Some have an explicit object type, such as PAGE for page or CONFIG for config, some may be filled arbitrarily by extensions.
  • Some of these are already initialized by TYPO3, such as config or plugin, some must be initialized explicitly, such as page.
Top-level object Top-level object type
page | ... PAGE
config CONFIG
plugin  
module  
styles  
lib  
tt_*  
resources readonly
sitetitle readonly

CONFIG & config

Table of content

The 'config' top-level-object

Internally TYPO3 always creates an array config with various configuration values which are evaluated during the rendering process and treated in some special, predefined and predictive way. This is what we mean when we say the property config, actually the array 'config' is of type CONFIG. It is a "top-level-object" because it is not subordinate to any other configuration setting.

In PHP you can refer to the array within typo3/sysext/frontend/Classes/ files by writing $GLOBALS['TSFE']->config['config'] .

This typoscript "top level object" config provides access to the internal array. This means, that configuration settings can be made easily. For example:

# TypoScript
config.debug = 1

# will produce, in php
$GLOBALS['TSFE']->config['config']['debug'] // with value 1
Copied!

Properties of 'config'

Properties of the CONFIG object
Name Type
string
numerically indexed array of "HTTP header entries".
boolean
<A>-params
array
boolean
integer
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
string
boolean
target
target
boolean
boolean
string
array
string
stdWrap
integer
boolean
boolean
boolean
boolean
target
list
string
string
boolean
string
boolean
list of PIDs / string
string :Example:setup-config-namespaces
boolean
integer
string
stdWrap
boolean
array
array
array of link configurations
boolean
boolean / string
boolean
auto, force, or empty
boolean
-10 to 10
string
string
array
integer (page id) / keyword "NONE"
string
string
string

absRefPrefix

absRefPrefix
Type
string
Special value
"auto"

If set, the string is prepended to all relative links that TYPO3 generates.

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

If the option config.forceAbsoluteUrls is enabled, absRefPrefix is overridden.

Using an URI in absRefPrefix will require additional conditions if you use different domains for your deployment stages in CI environments.

If you are 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 may do yourself a favor and set absRefPrefix to the URL and path of your site, e.g. https://example.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

additionalHeaders
Type
numerically indexed array of "HTTP header entries".
Example
set additional headers data

By means of config.additionalHeaders as series of additional HTTP headers can be configured. An entry has the following structure:

10.header = the header string
This value is required.
10.replace = 0 | 1
Optional, boolean, default is 1. If 1, the header will replace an existing one that has the same name.
10.httpResponseCode = 201
Optional, integer, a http status code that the page should return.

By default TYPO3 sends a "Content-Type" header with the defined encoding. It then sends cache headers, if configured via Properties of 'config'. Then additional headers are send, plus finally a "Content-Length" header, if enabled via Properties of 'config'.

admPanel

admPanel
Type
boolean

config.admPanel = 1 can be used to enable the admin panel. See Configuration in the Admin Panel manual.

ATagParams

ATagParams
Type
<A>-params

Additional parameters to all links in TYPO3 (excluding menu-links).

cache

cache
Type
array
Example
config cache examples

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.cache.<page-id> = <table name>:<storage-pid>
Copied!

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.

You can use the keyword "current" instead of a <storage-pid> to consider records on the current page for the cache life of itself.

cache_clearAtMidnight

cache_clearAtMidnight
Type
boolean
Default
0

With this setting the cache always expires at midnight of the day, the page is scheduled to expire.

cache_period

cache_period
Type
integer
Default
86400 (= 24 hours)

The number of second a page may remain in cache.

This value is overridden by the value set in the page-record field="cache_timeout" if this value is greater than zero.

compressCss

compressCss
Type
boolean
Default
0
Example
Config compress CSS example

If set, CSS files referenced in page.includeCSS and the like will be minified and compressed. Does not work on files, which are referenced in page.headerData.

Minification will remove all excess space. The more significant compression step (using gzip compression) requires $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] to be enabled in the Install Tool. For this to work you also need to activate the gzip- related compressionLevel options in .htaccess, as otherwise the compressed files will not be readable by the user agent.

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

$GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'] =
   \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('my_extension') .
   'Classes/CssCompressHandler.php:MyVendor\MyExtensionen\CssCompressHandler->compressCss';
Copied!

compressJs

compressJs
Type
boolean
Default
0
Example
Config compress JavaScript

Enabling this option together with $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] in the Install Tool delivers Frontend JavaScript files referenced in page.includeJS and the like using GZIP compression. Does not work on files, which are referenced in page.headerData.

Please note that this requires .htaccess to be adjusted, as otherwise the files will not be readable by the user agent. Please see the description of $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] in the Install Tool.

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

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'] =
    \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('my_extension') .
    'Classes/JsCompressHandler.php:MyVendor\MyExtension\JsCompressHandler->compressJs';
Copied!

concatenateCss

concatenateCss
Type
boolean
Default
0
Example
Concatenate CSS Example

Setting config.concatenateCss merges Stylesheet files referenced in the Frontend in page.includeCSS and the like together. Files are merged only, if their media attribute has the same value, e.g. if it is "all" for several files. Does not work on files, which are referenced in page.headerData.

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

$GLOBALS['TYPO3_CONF_VARS']['FE']['cssCompressHandler'] =
    \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('my_extension') .
    'Classes/CssCompressHandler.php:MyVendor\MyExtension\CssCompressHandler->compressCss';
Copied!

concatenateJs

concatenateJs
Type
boolean
Default
0
Example
concatenateJs

Setting config.concatenateJs merges JavaScript files referenced in the Frontend in page.includeJS and the like together. Does not work on files, which are referenced in page.headerData.

If all files to be concatenated are marked with the async flag, the async attribute is assigned to the script tag.

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

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsConcatenateHandler'] =
       \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('my_extension') .
       'Classes/JsConcatenateHandler.php:MyVendor\MyExtension\JsConcatenateHandler->concatenateJs';
Copied!

contentObjectExceptionHandler

contentObjectExceptionHandler
Type
boolean
Default
0
Example
:ref: setup-config-contentObjectExceptionHandler

Exceptions which occur during rendering of content objects (typically plugins) will 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.

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

debug
Type
boolean

If set, then debug information in the TypoScript code is sent. This applies e.g. to menu objects and the parsetime output. The parsetime will be sent as HTTP response header X-TYPO3-Parsetime.

disableAllHeaderCode

disableAllHeaderCode
Type
boolean
Default
0
Example
Provide JSON and disable HTML headers

If this is not set or set to 0, the PAGE object automatically outputs a HTML skeleton, see Output of the PAGE object.

To disable this default behaviour set disableAllHeaderCode = 1. The page outputs only the result of the cObject array (1,2,3,4...) of the PAGE object.

Use this feature in templates supplying other content-types than HTML. That could be an image, a RSS-feed, an ajax request in a format like XML or JSON.

This property can also be used to generate the complete HTML page, including the <html> and <body> tags manually.

disableBodyTag

disableBodyTag
Type
boolean
Default
0

If this option is set, the TYPO3 core will not generate the opening <body ...> part of the body tag. The closing </body> is not affected and will still be issued.

disableBodyTag takes precedence over the PAGE properties bodyTagCObject, bodyTag and bodyTagAdd. With config.disableBodyTag = 1 the others are ignored and don't have any effect.

disableCanonical

disableCanonical
Type
boolean

When the system extension SEO is installed, canonical tags are generated automatically to prevent duplicate content. A good canonical is added in many cases by default. For edge cases, you might want to disable the rendering of this tag. You can do this by setting this property to 1.

disableHrefLang

disableHrefLang
Type
boolean

When the system extension SEO is installed, hreflang tags are generated automatically in multi-language setups. By settings this option to 1 the rendering of those tags will be skipped.

disablePrefixComment

disablePrefixComment
Type
boolean

If set, the stdWrap property will be disabled, thus preventing any revealing and space-consuming comments in the HTML source code.

disablePreviewNotification

disablePreviewNotification
Type
boolean
Default
0

Disables the "preview" notification box completely.

disableLanguageHeader

disableLanguageHeader
Type
boolean
Default
0

TYPO3 by default sends a Content-language: XX HTTP header, where "XX" is the ISO code of the according language. The value is based on the language defined in the Site Configuration.

If config.disableLanguageHeader is set, this header will not be sent.

doctype

doctype
Type
string

If set, then a document type declaration (and an XML prologue) will be generated. The value can either be a complete doctype or one of the following keywords:

xhtml_trans
for the XHTML 1.0 Transitional doctype.
xhtml_strict
for the XHTML 1.0 Strict doctype.
xhtml_basic
for the XHTML basic doctype.
xhtml_11
for the XHTML 1.1 doctype.
xhtml+rdfa_10
for the XHTML+RDFa 1.0 doctype.
html5
for the HTML5 doctype.
none
for no doctype at all.

See config.htmlTag_setParams for more details on the effect on the HTML tag.

Default is the HTML 5 doctype:

<!DOCTYPE html>
Copied!

enableContentLengthHeader

enableContentLengthHeader
Type
boolean
Default
1

If set, a header "content-length: [bytes of content]" is sent.

If a 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

extTarget
Type
target
Default
_top

Default external target. Used by typolink if no extTarget is set.

fileTarget

fileTarget
Type
target

Default file link target. Used by typolink if no fileTarget is set.

forceAbsoluteUrls

forceAbsoluteUrls
Type
boolean
Default
0

If this option is set, all links, reference to images or assets previously built with a relative or absolute path (for example, /fileadmin/my-pdf.pdf) will be rendered as absolute URLs with the site prefix / current domain.

Examples for such use cases are the generation of a complete static version of a TYPO3 site for sending a page via email.

forceTypeValue

forceTypeValue
Type
boolean

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.

headerComment

headerComment
Type
string

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

htmlTag.attributes
Type
array
Example
setup-config-htmltag-attributes

Sets the attributes for the <html> tag on the page. Allows to override and add custom attributes via TypoScript without having to re-add the existing attributes generated by SiteHandling.

This property supersedes the previous config.htmlTag_setParams option by providing a more flexible API to add attributes.

htmlTag_setParams

htmlTag_setParams
Type
string
Example
htmlTag_setParams example

Sets the attributes for the <html> tag on the page. If you set Properties of 'config' 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.

If you are using htmlTag.attributes this property (htmlTag_setParams) will not have any effect.

htmlTag_stdWrap

htmlTag_stdWrap
Type
stdWrap

Modify the whole <html> tag with stdWrap functionality. This can be used to extend or override this tag.

index_descrLgd

index_descrLgd
Type
integer
Default
200

This indicates how many chars to preserve as description for an indexed page. This may be used in the search result display.

index_enable

index_enable
Type
boolean

Enables cached pages to be indexed.

Automatically enabled when indexed_search is enabled.

index_externals

index_externals
Type
boolean

If set, external media linked to on the pages is indexed as well.

Automatically enabled when indexed_search is enabled.

index_metatags

index_metatags
Type
boolean
Default
1

This allows to turn on or off the indexing of metatags. It is turned on by default.

inlineStyle2TempFile

inlineStyle2TempFile
Type
boolean
Default
1
Example
inlineStyle2TempFile example

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.

intTarget

intTarget
Type
target

Default internal target. Used by typolink if no target is set.

linkVars

linkVars
Type
list
Example
Add &print parameter to all links

HTTP_GET_VARS, which should be passed on with links in TYPO3. This is compiled into a string stored in $GLOBALS['TSFE']->linkVars

The values are rawurlencoded in PHP.

You can specify a range of valid values by appending a () after each value. If this range does not match, the variable won't be appended to links. This is very important to prevent that the cache system gets flooded with forged values.

The range may contain one of these values:

[a]-[b]
A range of allowed integer values
int
Only integer values are allowed
[a]\|[b]\|[c]
A list of allowed strings (whitespaces will be removed)
/[regex]/
Match against a regular expression (PCRE style)

You can use the pipe character (|) to access nested properties.

message_preview

message_preview
Type
string

Alternative message in HTML that appears when the preview function is active.

message_preview_workspace

message_preview_workspace
Type
string
Example
Customize workspace display box

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

moveJsFromHeaderToFooter

moveJsFromHeaderToFooter
Type
boolean

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

MP_defaults
Type
string
Syntax
[id],[id],... : [MP-var] \| [id],[id],... : [MP-var] \| ...
Example
Define mounting point defaults for certain pages

Allows you to set a list of page id numbers which will always have a certain "&MP=..." parameter added.

Imagine you have a TYPO3 site with several mount points, and you need certain pages to always include a specific mount point parameter for correct content rendering. By configuring :typoscriptMP_defaults, you ensure consistency and reduce the risk of broken links or incorrect content being displayed due to missing parameters.

MP_disableTypolinkClosestMPvalue

MP_disableTypolinkClosestMPvalue
Type
boolean

If set, the typolink function will not try to find the closest MP value for the id.

MP_mapRootPoints

MP_mapRootPoints
Type
list of PIDs / string

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\Frontend\Typolink\PageLinkBuilder.

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.

namespaces.[identifier]

namespaces.[identifier]
Type
string :Example:setup-config-namespaces

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.

no_cache

no_cache
Type
boolean
Default
0

If this is set to 1, it disables the pages cache, meaning that the rendered result/response will not be saved to cache.

If set to 0, it's ignored. Rendered result (e.g. full html of a page) is stored in the pages cache.

Other parameters may have set it to true for other reasons. Note that setting this to 1 doesn't disable other TYPO3 caches. Instead of setting config.no_cache you might consider changing dynamic (non-cacheable) content from USER to USER_INT (COA to COA_INT).

For more information about cache types see cache types chapter.

noPageTitle

noPageTitle
Type
integer
Default
0
Example
Set a custom page renderer template

If you only want to have the site name (from the template record) in your <title> tag, set this to 1. If the value is 2 then the <title> tag is not printed at all.

Please take note that this tag is required for (X)HTML compliant output, so you should only disable this tag if you generate it manually already.

pageRendererTemplateFile

pageRendererTemplateFile
Type
string
Default
file:EXT:core/Resources/Private/Templates/PageRenderer.html

Sets the template for page renderer class \TYPO3\CMS\Core\Page\PageRenderer .

pageTitle

pageTitle
Type
stdWrap

stdWrap for the page title. This option will be executed after all other processing options like Properties of 'config'.

pageTitleFirst

pageTitleFirst
Type
boolean
Default
0
Example
Reorder the default page title providers

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

pageTitleProviders

pageTitleProviders
Type
array

In order to keep setting the titles in control, an API to set the page title is available. The API uses PageTitleProviders to define the page title based on page record and the content on the page.

Based on the priority of the providers, the PageTitleProviderManager will check the providers if a title is given by the provider. It will start with the highest priority PageTitleProviders and will end with the lowest in priority.

pageTitleSeparator

pageTitleSeparator
Type
array
Default
: (colon with following space)
Example
Use custom separators between page title parts

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.

recordLinks

Type
array of link configurations
Frontend TypoScript definition for identifier my_content
config.recordLinks.my_content {
    // Do not force link generation when the record is hidden
    forceLink = 0

    typolink {
        // pages.uid to be used to render result (basically it contains the rendering plugin)
        parameter = 234
        // field values of tx_myextension_content record with uid 123
        additionalParams.data = field:uid
        additionalParams.wrap = &tx_myextension[uid]= | &tx_myextension[action]=show
    }
}
Copied!

removeDefaultCss

removeDefaultCss
Type
boolean
Example
Remove default external JavaScript and all default CSS

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

removeDefaultJS
Type
boolean / string
Example
Remove default external JavaScript and all default CSS

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 the string external, then the default JavaScript is written to a temporary file and included from that file. See inlineStyle2TempFile example.

sendCacheHeaders

sendCacheHeaders
Type
boolean

If set, TYPO3 will output cache-control headers to the client based mainly on whether the page was cached internally. This feature allows client browsers and/or reverse proxies to take load off TYPO3 websites.

The conditions for allowing client caching are:

  • page was cached
  • No *_INT or *_EXT objects were on the page (e.g. USER and USER_INT)
  • No frontend user is logged in
  • No backend user is logged in

If these conditions are met, the headers sent are:

  • Last-Modified [SYS_LASTCHANGED of page id]
  • Expires [expire time of page cache]
  • ETag [md5 of content]
  • Cache-Control: max-age: [seconds til expiretime]
  • Pragma: public

In case caching is not allowed, these headers are sent to avoid client caching:

  • Cache-Control: private, no-store

Notice that enabling the browser caches means you have to consider how log files are written. Because when a page is cached on the client it will not invoke a request to the webserver, thus not writing the request to the log. There should be ways to circumvent these problems but they are outside the domain of TYPO3 in any case.

Tip: Enabling cache-control headers might confuse editors seeing old content served from the browser cache. "Shift-Reload" will bypass both browser- and reverse-proxy caches and even make TYPO3 regenerate the page. Teach them that trick!

sendCacheHeadersForSharedCaches

sendCacheHeadersForSharedCaches
Type
auto, force, or empty

New in version 13.3

When working with proxies, it is much helpful to take load off of TYPO3 / the webserver by keeping a cached version for a period of time and answering requests from the client, while still telling the client to not cache the response inside the browser cache.

This is achieved by setting config.sendCacheHeadersForSharedCaches = auto.

With this option enabled, TYPO3 evaluates if the current TYPO3 Frontend request is executed behind a reverse proxy, and if so, TYPO3 sends the following HTTP Response Headers at a cached response:

Expires: Thu, 26 Aug 2024 08:52:00 GMT
ETag: "d41d8cd98f00b204ecs00998ecf8427e"
Cache-Control: max-age=0, s-maxage=86400
Pragma: public
Copied!

With config.sendCacheHeadersForSharedCaches = force the reverse proxy evaluation can be omitted, which can be used for local webserver internal caches.

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control for details and if your reverse proxy supports this directive.

showWebsiteTitle

showWebsiteTitle
Type
boolean
Default
1

The option can be used to specify whether the website title defined in the site configuration should be added to the page title (used for the <title> tag, for example).

By default, the website title is added. To omit the website title, the option has to be set to 0.

spamProtectEmailAddresses

spamProtectEmailAddresses
Type
-10 to 10
Example
Spam protect email addresses automatically

If set, then all email addresses in typolinks will be encrypted so that it is harder for spam bots to detect them.

If you set this value to a number, then the encryption is 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.)

It is required to enable the default JavaScript and not disable it. (see removeDefaultJS)

spamProtectEmailAddresses_atSubst

spamProtectEmailAddresses_atSubst
Type
string
Default
(at)
Example
Spam protect email addresses automatically

Substitute label for the at-sign (@).

spamProtectEmailAddresses_lastDotSubst

spamProtectEmailAddresses_lastDotSubst
Type
string
Default
. (just a simple dot)
Example
Spam protect email addresses automatically

Substitute label for the last dot in the email address.

tx_[extension key with no underscores]_[*]

tx_[extension key with no underscores]_[*]
Type
array
Example
Define configuration for custom namespaces

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

typolinkLinkAccessRestrictedPages

typolinkLinkAccessRestrictedPages
Type
integer (page id) / keyword "NONE"
Example
Define custom styling for access restricted page links

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)

typolinkLinkAccessRestrictedPages.ATagParams

typolinkLinkAccessRestrictedPages.ATagParams
Type
string
Example
Define custom styling for access restricted page links

typolinkLinkAccessRestrictedPages.ATagParams Add custom attributes to the anchor tag.

typolinkLinkAccessRestrictedPages_addParams

typolinkLinkAccessRestrictedPages_addParams
Type
string
Example
Define custom styling for access restricted page links

typolinkLinkAccessRestrictedPages_xmlprologue

typolinkLinkAccessRestrictedPages_xmlprologue
Type
string

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

Output
<?xml version="1.0" encoding="utf-8">
Copied!

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.

Examples

Example: prefix absolute paths

Demonstrates:
  1. Prefixing all links with a "/" results in absolute link paths:

    EXT:site_package/Configuration/TypoScript/setup.typoscript
    config.absRefPrefix = /
    Copied!
  2. Prefixing all links with the path to a subdirectory:

    EXT:site_package/Configuration/TypoScript/setup.typoscript
    config.absRefPrefix = /some-subsite/
    Copied!
  3. Prefixing all links with a URI scheme:

    EXT:site_package/Configuration/TypoScript/setup.typoscript
    config.absRefPrefix = https://example.org/
    Copied!

set additional headers data

Demonstrates:
  1. General usage

    EXT:site_package/Configuration/TypoScript/setup.typoscript
    config.additionalHeaders {
      10 {
        # The header string
        header = foo
    
        # 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
    }
    Copied!
  2. General usage, same usage, alternate notation

    EXT:site_package/Configuration/TypoScript/setup.typoscript
    config.additionalHeaders.10.header = foo
    config.additionalHeaders.10.replace = 0
    config.additionalHeaders.10.httpResponseCode = 401
    config.additionalHeaders.20.header = Cache-control: Private
    Copied!
  3. Set content type for a page returning JSON

    EXT:site_package/Configuration/TypoScript/setup.typoscript
    json = PAGE
    json {
      typeNum = 1617455215
      10 =< tt_content.list.20.tx_myextension_myjsonplugin
      config {
        disableAllHeaderCode = 1
        additionalHeaders.10.header = Content-type:application/json
      }
    }
    Copied!

config cache examples

Demonstrates:

This includes the fe_users records on page 2 in the cache lifetime calculation for page 10:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.cache.10 = fe_users:2
Copied!

This includes records from multiple sources, namely the fe_users records on page 2 and the tt_new records on page 11:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.cache.10 = fe_users:2,tt_news:11
Copied!

Consider the fe_users records on the storage page 2 for the cache lifetime of all pages:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.cache.all = fe_users:2
Copied!

Each pages cache lifetime is influenced if fe_users stored on the page itself get changed:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.cache.all = fe_users:current
Copied!

Config compress CSS example

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.compressCss = 1
Copied!

Config compress JavaScript

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.compressJs = 1
Copied!

Concatenate CSS Example

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.concatenateCss = 1
Copied!

concatenateJs

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.concatenateJs = 1

page = PAGE
page.includeJSFooter {
    test = fileadmin/user_upload/test.js
    test.async = 1

    test2 = fileadmin/user_upload/test2.js
    test2.async = 1
}
Copied!

contentObjectExceptionHandler example

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
# 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
Copied!

Provide JSON and disable HTML headers

A page type providing JSON:

EXT:site_package/Configuration/TypoScript/setup.typoscript
json = PAGE
json {
    typeNum = 1617455215
    10 =< tt_content.list.20.tx_myextension_myjsonplugin
    config {
        disableAllHeaderCode = 1
        additionalHeaders.10.header = Content-type:application/json
    }
}
Copied!

HTML tag attributes example

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.htmlTag.attributes.class = no-js
Copied!

Results in :

Example output
<html lang="fr" class="no-js">
Copied!
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.htmlTag.attributes.amp =
Copied!

Results in :

Example output
<html lang="fr" amp>
Copied!

htmlTag_setParams example

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
Copied!

inlineStyle2TempFile example

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.inlineStyle2TempFile = 0
Copied!

Customize workspace display box

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
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>
Copied!

Define mounting point defaults for certain pages

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.MP_defaults = 36,37,48 : 2-207
Copied!

This will by default add &MP=2-207 to all links pointing to pages 36,37 and 48.

Define Dublin Core Metadata Element Set (dc) xmlns namespace

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.namespaces.dc = http://purl.org/dc/elements/1.1/
config.namespaces.foaf = http://xmlns.com/foaf/0.1/
Copied!

This configuration will result in an <html> tag like:

EXT:site_package/Configuration/TypoScript/setup.typoscript
<html xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:foaf="http://xmlns.com/foaf/0.1/">
Copied!

Set a custom page renderer template

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.pageRendererTemplateFile = EXT:my_extension/Resources/Private/Templates/TestPagerender.html
Copied!

Reorder the default page title providers

Demonstrates:

By default, TYPO3 ships with two providers:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.pageTitleProviders {
    record {
        provider = TYPO3\CMS\Core\PageTitle\RecordPageTitleProvider
    }
    seo {
        provider = TYPO3\CMS\Seo\PageTitle\SeoTitlePageTitleProvider
        before = record
    }
}
Copied!

The ordering of the providers is based on the before and after parameters. If you want a provider to be handled before a specific other provider, set that provider in the before, do the same with after.

You can find information about creating own PageTitleProviders in the section PageTitle API.

Use custom separators between page title parts

Demonstrates:

This produces a title tag with the content "website . page title":

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.pageTitleSeparator = .
Copied!

This produces a title tag with the content "website - page title":

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.pageTitleSeparator = -
config.pageTitleSeparator.noTrimWrap = | | |
Copied!

This produces a title tag with the content "website*page title":

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.pageTitleSeparator = *
config.pageTitleSeparator.noTrimWrap = |||
Copied!

If you want to remove the web page title from the displayed title, choose a separator that is not included in the web page title. Then split the title from that character and return the second part only:

EXT:site_package/Configuration/TypoScript/setup.typoscript
config.pageTitleSeparator = *
config.pageTitle.stdWrap {
    split {
        token = *
        returnKey = 1
    }
}
Copied!

Remove default external JavaScript and all default CSS

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config  {
    removeDefaultJS = external
    removeDefaultCss = 1
}
Copied!

Spam protect email addresses automatically

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config {
    spamProtectEmailAddresses = -2
    spamProtectEmailAddresses_atSubst = (at)
    spamProtectEmailAddresses_lastDotSubst = (dot)
}
Copied!

Define configuration for custom namespaces

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
config.tx_realurl_enable = 1
config.tx_myextension.width  = 10
config.tx_myextension.length = 20
Copied!

module

The backend module of an extension can be configured via TypoScript. The configuration is done in module.tx_<lowercaseextensionname>_<lowercasepluginname>. _<lowercasepluginname> can be omitted then the setting is used for all backend modules of that extension.

Even though we are in the backend context here we use TypoScript setup. The settings should be done globally and not changed on a per-page basis. Therefore they are usually done in the file EXT:my_extension/ext_typoscript_setup.typoscript.

Options for simple backend modules

The configuring backend modules via frontend TypoScript is flawed by design: It on one hand forces backend modules to parse the full frontend TypoScript, which is a general performance penalty in the backend - the backend then scales with the amount of frontend TypoScript. Also, the implementation is based on the Extbase ConfigurationManager, which leads to the situation that casual non-Extbase backend modules have an indirect dependency to lots of Extbase code.

In simple backend modules extension authors can decide how to use this namespace. By convention settings should go in the subsection settings.

EXT:my_extension/ext_typoscript_setup.typoscript
module.tx_myextension_somemodule {
    settings {
        enablesomething = 1
    }
}
Copied!

Options for Extbase backend modules

Most configuration options that can be done for Extbase frontend plugins can also be done for Extbase backend modules:

view.templateRootPaths

view.templateRootPaths.[array]

view.templateRootPaths.[array]
Type
file path with stdWrap

Used to define several paths for templates, which are executed in reverse order (the paths are searched from bottom to top). The first folder where the desired layout is found is immediately used. If the array keys are numeric, they are first sorted and then executed in reverse order.

Example: Set the template root paths

EXT:my_extension/ext_typoscript_setup.typoscript
module.tx_somebackend_module {
    view {
        templateRootPaths {
            100 = EXT:my_extension/Resources/Private/Templates/Backend
        }
    }
}
Copied!

view.partialRootPaths

view.partialRootPaths.[array]

view.partialRootPaths.[array]
Type
file path with stdWrap

Used to define several paths for partials, which will be executed in reverse order. The first folder where the desired partial is found, is used. The keys of the array define the order.

Example: Set the partial root paths

EXT:my_extension/ext_typoscript_setup.typoscript
module.tx_somebackend_module {
    view {
        partialRootPaths {
            100 = EXT:my_extension/Resources/Private/Partials/Backend
        }
    }
}
Copied!

settings

settings

settings
Type
array<string, mixed>

Here resides all of the settings. These settings are available in the controller of the backend module as the array variable $this->settings.

Example: Limit pagination in the backend

Show 25 news records in the backend module of the news extension:

EXT:my_extension/ext_typoscript_setup.typoscript
module.tx_news {
   settings.list.paginate.itemsPerPage = 25
}
Copied!

Example: Register YAML file

Register your TYPO3 Form configuration for the backend via TypoScript.

EXT:my_extension/ext_typoscript_setup.typoscript
module.tx_form {
    settings {
        yamlConfigurations {
            # Use the current timestamp as key to avoid accidental overwriting
            1712163960 = EXT:my_extension/Configuration/Form/CustomFormSetup.yaml
        }
    }
}
Copied!

PAGE

This defines what is rendered in the frontend.

PAGE is an object type. A good habit is to use page as the top-level object name for the main PAGE object of a website.

TYPO3 does not initialize page by default. You must initialize this explicitly, for example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
Copied!

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.

Most of this code is executed in the PHP script \TYPO3\CMS\Frontend\Http\RequestHandler .

Getting started with the PAGE object

See PAGE in TypoScript (Getting started), for an introduction into this object.

If no PAGE object is found, the error "No page configured for type=0." is displayed. See chapter Troubleshooting.

Output of the PAGE object

An empty PAGE object without further configuration renders a HTML page like the following:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--
    This website is powered by TYPO3 - inspiring people to share!
    TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
    TYPO3 is copyright 1998-2019 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
    Information and contribution at https://typo3.org/
-->
<title>Page title</title>
<meta name="generator" content="TYPO3 CMS">
</head>
<body>
</body>
</html>
Copied!

This default behaviour can be changed by setting the property Provide JSON and disable HTML headers:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.config.disableAllHeaderCode = 1
Copied!

If the output represents another format different from HTML the HTTP header should also be set, for example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.config.additionalHeaders.10.header = Content-type:application/json
Copied!

Multiple pages

When rendering pages in the frontend, TYPO3 uses the GET parameter "type" 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 (which is the default) while a JSON stream with the same content could go with type 1.

The property typeNum defines for which type, the page will be used.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.typeNum = 0
page {
   # set properties ...
}

json = PAGE
json.typeNum = 1
# ...
Copied!

See An example page type used for JSON data about an example for the latter page.

In the frontend, the original URLs that are generated will include the type and an id parameter (for the page id), example (for json and page id 22):

/index.php?id=22&type=1

Guidelines

Good, general PAGE object names to use are:

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

Properties

1,2,3,4...

1,2,3,4...
Type
cObject
Examples

These properties can be used to define any number of objects, just like you can do with a COA content object.

The content of these objects will be rendered on the page in the order of the numbers, not in the order they get defined in the TypoScript definition.

It is considered best practice to leave space between the numbers such that it will be possible to place objects before and after other objects in the future. Therefore you will often see that people use the number 10 and no number 1 is found.

bodyTag

bodyTag
Type
string
Default
<body>
Example
Set a class on the body tag

Body tag on the page

bodyTagAdd

bodyTagAdd
Type
string
Example
Add a parameter to the body tag

This content is added inside of the opening <body> tag right before the > character. This is mostly useful for adding attributes to the <body> tag.

bodyTagCObject

bodyTagCObject
Type
cObject

This is the default body tag. It is overridden by Properties, if that is set.

config

config
Type
->CONFIG
Examples
Configuration for the page. Any entries made here override the same
entries in the top-level object CONFIG & config.

cssInline.[array]

cssInline.[array]
Type
cObject
Example
Add inline styles for the h1 tag

Allows to add inline CSS to the page <head> section. The cssInline property contains any number of numeric keys, each representing one cObject. Internally handled as PHP integer, maximum number is therefore restricted to PHP_INT_MAX.

footerData.[array]

footerData.[array]
Type
cObject
Example
Add a script and a comment to the page footer

Same as Properties, except that this block gets included at the bottom of the page (just before the closing </body> tag).

The footerData property contains any number of numeric keys, each representing one cObject. Internally handled as PHP integer, maximum number is therefore restricted to PHP_INT_MAX.

headerData.[array]

headerData.[array]
Type
cObject

Inserts custom content in the head section of the website.

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.

For meta tags, use the dedicated configuration page.meta.

By default, gets inserted after all the style definitions.

The headerData property contains any number of numeric keys, each representing one cObject. Internally handled as PHP integer, maximum number is therefore restricted to PHP_INT_MAX.

headTag

headTag
Type
string / stdWrap
Default
<head>

Head-tag if alternatives are wanted

includeCSS.[array]

includeCSS.[array]
Type
resource
Example
Include additional css files

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 function if for details.
inline
If set, the content of the CSS file is inlined using <style> tags. Note that external files are not inlined.
media
Setting the media attribute of the <style> tag.
title
Setting the title of the <style> tag.

Additional data attributes can be configured using a key-value list.

includeCSSLibs.[array]

includeCSSLibs.[array]
Type
resource
Example
Include CSS libraries

Adds CSS library files to head of page.

The file definition must be a valid resource data type, otherwise nothing is inserted. This means that remote files cannot be referenced (i.e. using https://...), except by using the .external property.

Each file has optional properties:

allWrap
Wraps the complete tag, useful for conditional comments.
allWrap.splitChar
Defines an alternative splitting character (default is "|" - the vertical line).
alternate
If set (boolean) then the rel-attribute will be "alternate stylesheet".
disableCompression
If config.compressCss is enabled, this disables the compression of this file.
excludeFromConcatenation
If config.concatenateCss is enabled, this prevents the file from being concatenated.
external
If set, there is no file existence check. Useful for inclusion of external files.
forceOnTop
Boolean flag. If set, this file will be added on top of all other files.
if
Allows to define conditions, which must evaluate to TRUE for the file to be included. If they do not evaluate to TRUE, the file will not be included. Extensive usage might cause huge numbers of temporary files to be created. See ->if for details.
media
Setting the media attribute of the <style> tag.
title
Setting the title of the <style> tag.

Additional data attributes can be configured using a key-value list.

includeJS.[array]

includeJS.[array]
Type
resource
Example
Include JavaScript in the header

Inserts one or more (Java)Scripts in <script> tags. With Properties of 'config' set to TRUE all files will be moved to the footer. The file definition must be a valid resource data type, otherwise nothing is inserted. This means that remote files cannot be referenced (i.e. using https://...), except by using the .external property.

Each file has optional properties:

allWrap
Wraps the complete tag, useful for conditional comments.
allWrap.splitChar
Defines an alternative splitting character (default is "|" - the vertical line).
async
Allows the file to be loaded asynchronously.
crossorigin
Allows to set the cross-origin attribute in script tags. It is automatically set to anonymous for external JavaScript files if an .integrity is set.
defer
Allows to set the HTML5 attribute defer.
disableCompression
If config.compressJs is enabled, this disables the compression of this file.
excludeFromConcatenation
If config.concatenateJs is enabled, this prevents the file from being concatenated.
external
If set, there is no file existence check. Useful for inclusion of external files.
forceOnTop
Boolean flag. If set, this file will be added on top of all other files.
if
Allows to define conditions, which must evaluate to TRUE for the file to be included. If they do not evaluate to TRUE, the file will not be included. Extensive usage might cause huge numbers of temporary files to be created. See ->if for details.
type
Setting the MIME type of the script. Default: The attribute is omitted for frontend rendering when config.doctype is not set or set to html5. Otherwise text/javascript is used as type.
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/.
data
Array with key/value for additional attributes to be added to the script tag.

includeJSFooter.[array]

includeJSFooter.[array]
Type
resource

Add JavaScript files to footer (after files set in includeJSFooterlibs)

Same as includeJS above, except that this block gets included at the bottom of the page (just before the closing </body> tag).

includeJSFooterlibs.[array]

includeJSFooterlibs.[array]
Type
resource

Add JavaScript library files to footer.

Same as includeJSLibs, except that this block gets included at the bottom of the page (just before the closing </body> tag).

The optional properties from includeJS can be applied.

Currently one difference between includeJS and includeJSFooterlibs exists: There is no data-array as optional parameter but all keys not explicitly mentioned as parameters are used as additional attributes - behaviour is the same as in includeCSS.

EXT:site_package/Configuration/TypoScript/setup.typoscript
# This will lead to <script src="/_assets/.../Frontend/JavaScript/somefile.js?123456" data-foo="data-bar" foo="bar"></script>
page.includeJSFooterlibs {
    somefile = EXT:site_package/Resources/Public/JavaScript/somefile.js
    somefile.data-foo = data-bar
    somefile.foo = bar
}
Copied!

includeJSLibs.[array]

includeJSLibs.[array]
Type
resource

Adds JavaScript library files to head of page.

Same as includeJSFooterlibs, except that this block gets included inside <head>. tag).

The optional properties from includeJS can be applied.

Currently one difference between includeJS and includeJSLibs exists: There is no data-array as optional parameter but all keys not explicitly mentioned as parameters are used as additional attributes - behaviour is the same as in includeCSS.

EXT:site_package/Configuration/TypoScript/setup.typoscript
# This will lead to <script src="/_assets/.../Frontend/JavaScript/somefile.js?123456" data-foo="data-bar" foo="bar"></script>
page.includeJSLibs {
    somefile = EXT:site_package/Resources/Public/JavaScript/somefile.js
    somefile.data-foo = data-bar
    somefile.foo = bar
}
Copied!

inlineLanguageLabelFiles

inlineLanguageLabelFiles
Type
(array of strings)
Example
Make a language file available in JavaScript

Adds language labels to the page. All labels will be then be available in the JavaScript object TYPO3.lang.

Available sub-properties:
selectionPrefix
Only label keys that start with this prefix will be included. Default: ''.
stripFromSelectionName
A string that will be removed from any included label key. Default: ''.
errorMode
Error mode if the file could not be found: 0 - syslog entry, 1 - do nothing, 2 - throw an exception. Default: 0

inlineSettings

inlineSettings
Type
(array of strings)
Example
Make some values available in JavaScript

Adds settings to the page as inline javascript, which is accessible within the JavaScript object TYPO3.settings.

jsFooterInline.[array]

jsFooterInline.[array]
Type
cObject
Example
Add some inline JavaScript to the page footer

Same as jsInline, except that the JavaScript gets inserted at the bottom of the page (just before the closing </body> tag).

The jsFooterInline property contains any number of numeric keys, each representing one cObject. Internally handled as PHP integer, maximum number is therefore restricted to PHP_INT_MAX.

jsInline.[array]

jsInline.[array]
Type
cObject
Example
Make a cObject available in JavaScript

Use array of cObjects for creating inline JavaScript.

The jsInline property contains any number of numeric keys, each representing one cObject. Internally handled as PHP integer, maximum number is therefore restricted to PHP_INT_MAX.

meta

meta
Type
array of key names (string / stdWrap)
Examples

Use the scheme meta.key = value to define any HTML meta tag.

value is the content of the meta tag. If the value is empty (after trimming), the meta tag is not generated.

The key can be the name of any meta tag, for example description or keywords. If the key is refresh (case insensitive), then the http-equiv attribute is used in the meta tag instead of the name attribute.

For each key the following sub-properties are available:

attribute
Sets the attribute for the meta tag. If it is not defined, the default name is used.
httpEquivalent
If set to 1, the http-equiv attribute is used in the meta tag instead of the name attribute. Default: 0.
replace
If set to 1, the tag will replace the one set earlier by a plugin. If set to 0 (default), the meta tag generated by the plugin will be used. If there is none yet, the one from TypoScript is set.

shortcutIcon

shortcutIcon
Type
resource
Example
Add a favicon to the page

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.

If the file is missing no tag will be rendered.

stdWrap

stdWrap
Type
stdWrap

Wraps the content of the cObject array with stdWrap options.

typeNum

typeNum
Type
integer
Default
0
Examples

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.

wrap

wrap
Type
Wrap

Wraps the content of the cObject array.

Page property examples

Also see the dedicated chapter of how to use the PAGE object: PAGE Examples

Example: Render "Hello World"

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.20 = TEXT
page.20.value = World
page.10 = TEXT
page.10.value = Hello

This renders to :html:`HelloWorld`.
Copied!

Example: Set a class on the body tag

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
# This will lead to <body class="example"> if constant "bodyClass" is set accordingly.
page.bodyTag = <body class="{$bodyClass}">
Copied!

Example: Add a parameter to the body tag

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
# This will lead to <body class="example">
page.bodyTagAdd = class="example"
Copied!

Example: Add inline styles for the h1 tag

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.cssInline {
    10 = TEXT
    10.value = h1 {margin:15px;}

    20 = TEXT
    20.value = h1 span {color: blue;}
}
Copied!

Example: Add a script tag and a comment to the head tag

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.headerData {
    3 = TEXT
    3.value = <script src="...."></script>

    50 = TEXT
    50.value = <!-- Hello from the comment! -->
}
Copied!

Example: Include additional css files

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.includeCSS {
    styles = EXT:site_package/Resources/Public/Css/styles.css

    print = EXT:site_package/Resources/Public/Css/print.css
    print.title = High contrast
    print.media = print

    additional = EXT:site_package/Resources/Public/Css/additional_styles.css
    additional.data-foo = bar

    ie6 = EXT:site_package/Resources/Public/Css/ie6.css
    ie6.allWrap = <!--[if lte IE 7]>|<![endif]-->

    example = https://example.org/some_external_styles.css
    example.external = 1
}
Copied!

Example: Include CSS libraries

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.includeCSSLibs {
    bootstrap = https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css
    bootstrap.external = 1

    additional = EXT:site_package/Resources/Public/Css/additional_styles.css
    additional.data-foo = bar
}
Copied!

Example: Include JavaScript in the header

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.includeJS {
    helloworld = EXT:site_package/Resources/Public/JavaScript/helloworld.js
    helloworld.type = application/x-javascript

    # Include the file only if myConstant is set in the TS constants field.
    conditional = EXT:site_package/Resources/Public/JavaScript/conditional.js
    conditional.if.isTrue = {$myConstant}

    # Include another file for consent management
    # A data attribute enriches the tag with additional information
    # which can be used in the according JavaScript.
    # This results in "<script data-consent-type="essential" ...></script>"
    consent = EXT:site_package/Resources/Public/JavaScript/consent.js
    consent.data.data-consent-type = essential

    # Another attribute can also be defined also with the "data" key.
    # This results in "<script other-attribute="value" ...></script>"
    consent.data.other-attribute = value

    jquery = https://code.jquery.com/jquery-3.4.1.min.js
    jquery.external = 1
    jquery.integrity = sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh
}
Copied!

Example: Make a language file available in JavaScript

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.inlineLanguageLabelFiles {
    someLabels = EXT:my_extension/Resources/Private/Language/locallang.xlf
    someLabels.selectionPrefix = idPrefix
    someLabels.stripFromSelectionName = strip_me
    someLabels.errorMode = 2
}
Copied!

Example: Make some values available in JavaScript

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.inlineSettings {
    setting1 = Hello
    setting2 = GoOnTop
}
Copied!

Will produce following source

TYPO3.settings = {"TS":{"setting1":"Hello","setting2":"GoOnTop"}};
Copied!

Example: Make a cObject available in JavaScript

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

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

Example: Define meta tags for description and keywords

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.meta {
    description = This is the description of the content in this document.
    keywords = These are the keywords.
}
Copied!

Example: Fetch data for the keyword meta tag from the page record

Demonstrates:

If the page record is not set search up the root line of pages.

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.meta {
    keywords.data = levelfield:-1, keywords, slide
}
Copied!

Example: Make a meta.refresh entry

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.meta.refresh = 5; url=https://example.org/
page.meta.refresh.attribute = http-equiv
Copied!

Example set Open graph meta tags

Demonstrates:

Meta tags with a different attribute name are supported like the Open Graph meta tags:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
# [...]

page.meta {
    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
        }
    }
    article:modified_time {
        attribute = property
        if.isTrue.field = lastUpdated
        field = lastUpdated
        formattedDate = Y-MM-dd'T'HH:mm:ssZ
    }
}
Copied!

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]" />
Copied!

See https://ogp.me/ for more information about the Open Graph protocol and its properties.

Example: Add a favicon to the page

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.shortcutIcon = EXT:site_package/Resources/Public/Images/favicon.ico
Copied!

PAGE Examples

A simple "Hello World" Example

Demonstrates:
# Default PAGE object:
page = PAGE
page.10 = TEXT
page.10.value = HELLO WORLD!
Copied!

A page using a Fluid template

Demonstrates:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
   templateName = Default
   layoutRootPaths {
      10 = EXT:sitepackage/Resources/Private/Layouts
   }
   partialRootPaths {
      10 = EXT:sitepackage/Resources/Private/Partials
   }
   templateRootPaths {
      10 = EXT:sitepackage/Resources/Private/Templates
   }
   variables {
      foo = TEXT
      foo.value = bar
   }
}
Copied!

A page type used for ajax requests

Demonstrates:

While many examples found in the internet promote to set config.no_cache = 1 it is better to only disable the cache for objects where it absolutely needs to be disabled, leaving all other caches untouched. This can be achieved for example by using a non-cacheable array, the COA_INT.

myAjax = PAGE
myAjax {
   typeNum = 1617455214
   config {
      disableAllHeaderCode = 1
      admPanel = 0
      debug = 0
   }
   # Prevent caching if necessary
   10 = COA_INT
   10 < plugin.tx_myextension_myajaxplugin
}
Copied!

A page type used for JSON data

To create a page type in the format json an additional header with Content-type:application/json has to be set:

json = PAGE
json {
   typeNum = 1617455215
   10 =< tt_content.list.20.tx_myextension_myjsonplugin
   config {
      disableAllHeaderCode = 1
      additionalHeaders.10.header = Content-type:application/json
      admPanel = 0
   }
}
Copied!

The built-in JsonView can be used to create the content via Extbase.

plugin

This is used for extensions in TYPO3 set up as frontend plugins. Typically you can set configuration properties of the plugin here. Say you have an extension with the key "myext" and it has a frontend plugin named "tx_myext_pi1" then you would find the TypoScript configuration at the position plugin.tx_myext_pi1 in the object tree!

Most plugins are USER and USER_INT objects which means that they have at least 1 or 2 reserved properties. Furthermore this table outlines some other default properties. Generally system properties are prefixed with an underscore:

Properties for all frontend plugin types

Name Type
(array of keys)
string / stdWrap

userFunc

userFunc
Type
(array of keys)

Property setting up the USER and USER_INT object of the plugin.

_CSS_DEFAULT_STYLE

_CSS_DEFAULT_STYLE
Type
string / stdWrap

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 read by the frontend RequestHandler script when collecting the CSS of the document to be rendered.

This is for example used by frontend and indexed_search. Their default styles can be removed with:

EXT:site_package/Configuration/TypoScript/setup.typoscript
plugin.tx_frontend._CSS_DEFAULT_STYLE >
plugin.tx_indexedsearch._CSS_DEFAULT_STYLE >
Copied!

However, you will then have to define according styles yourself.

Properties for all frontend plugins based on Extbase

Extbase is an extension framework to create frontend plugins.

ignoreFlexFormSettingsIfEmpty

ignoreFlexFormSettingsIfEmpty
Type
string
Example
Ignore certain FlexForm settings if empty

Define FlexForm settings that will be ignored in the extension settings merge process, if their value is considered empty (either an empty string or a string containing 0).

Additionally, there is the PSR-14 event BeforeFlexFormConfigurationOverrideEvent available to further manipulate the merged configuration after standard override logic is applied.

persistence

persistence
Type
array of settings
Example
Set recursive storage PID for Extbase plugin

Settings, relevant to the persistence layer of Extbase.

persistence.enableAutomaticCacheClearing

persistence.enableAutomaticCacheClearing
Type
boolean
Default
true

Only for Extbase plugins. Enables the automatic cache clearing when changing data sets (see also Caching).

persistence.storagePid

persistence.storagePid
Type
string (comma separated list of integers)
Example
Set recursive storage PID for Extbase plugin

Only for Extbase plugins. List of page IDs, from which all records are read.

persistence.classes.[classname].newRecordStoragePid

persistence.classes.[classname].newRecordStoragePid
Type
integer
Example
Set storage PID for new records of Extbase plugin

Only for Extbase plugins. Page ID, where new records for objects of the class [classname] are stored.

persistence.recursive

persistence.recursive
Type
integer
Example
Set recursive storage PID for Extbase plugin

Only for Extbase plugins. Number of sub-levels of the storagePid are read.

view.[settings]

view.[settings]
Type
settings
Example
Set template paths for Extbase plugin

View and template settings.

All root paths are defined as an array which enables you to define multiple root paths that will be used by Extbase to find the desired template files.

The root paths work just like the one in the FLUIDTEMPLATE.

view.layoutRootPaths.[array]

view.layoutRootPaths.[array]
Type
string
Example
Set template paths for Extbase plugin

Only for Extbase plugins. This can be used to specify the root paths for all Fluid layouts. If nothing is specified, the path EXT:my_extension/Resources/Private/Layouts is used.

view.partialRootPaths.[array]

view.partialRootPaths.[array]
Type
string
Example
Set template paths for Extbase plugin

Only for Extbase plugins. This can be used to specify the root paths for all Fluid partials. If nothing is specified, the path EXT:my_extension/Resources/Private/Partials is used.

view.templateRootPaths.[array]

view.templateRootPaths.[array]
Type
string
Example
Set template paths for Extbase plugin

Only for Extbase plugins. This can be used to specify the root paths for all Fluid templates in this plugin. If nothing is specified, the path EXT:my_extension/Resources/Private/Templates is used.

view.pluginNamespace.[array]

view.pluginNamespace.[array]
Type
string
Example
Set template paths for Extbase plugin

This can be used to specify an alternative namespace for the plugin. Use this to shorten the Extbase default plugin namespace or to access arguments from other extensions by setting this option to their namespace.

mvc.[setting]

mvc.[setting]
Type
array of settings

Only for Extbase plugins. These are useful MVC settings about error handling:

mvc.callDefaultActionIfActionCantBeResolved

mvc.callDefaultActionIfActionCantBeResolved
Type
boolean
Default
false
Example
Call default action if action cannot be resolved

Only for Extbase plugins. If set, causes the controller to show its default action if the called action is not allowed by the controller.

mvc.throwPageNotFoundExceptionIfActionCantBeResolved

mvc.throwPageNotFoundExceptionIfActionCantBeResolved
Type
boolean
Default
false
Example
Show 404 (page not found) page if action cannot be resolved

Same as Properties for all frontend plugins based on Extbase but this will raise a "page not found" error.

format

format
Type
string
Default
html
Example
Define alternative output formats for RSS feeds

Define the default file ending of the template files. The template files have to take care of creating the desired format output.

_LOCAL_LANG.[lang-key].[label-key]

_LOCAL_LANG.[lang-key].[label-key]
Type
string
Example
Override a language key in an Extbase plugin

Can be used to override the default language labels for Extbase plugins. The lang-key setup part is default for the default language of the website or the 2-letter (ISO 639-1) code for the language. label-key is the 'trans-unit id' XML value in the XLF language file which resides in the path Resources/Private/Language of the extension or in the typo3conf/l10n/[lang-key] (var/labels/[lang-key] in composer mode) subfolder of the TYPO3 root folder. And on the right side of the equation sign '=' you put the new value string for the language key which you want to override.

All variables, which are used inside an Extbase extension with the ViewHelper <f:translate> 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.

settings.[setting]

settings.[setting]
Type
array of custom settings

Here all the settings, both extension-wide and plugin-specific, reside. These settings are available in the controllers as the array variable $this->settings and in any Fluid template with {settings}.

The settings for a specific plugin can be overridden by FlexForm values of the same name.

Extbase plugin TypoScript examples

Plugin general examples

Examples: Ignore certain FlexForm settings if empty

Demonstrates:

Definition for all plugins of an extension:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
plugin.tx_myextension.ignoreFlexFormSettingsIfEmpty = field1,field2
Copied!

Definition for one plugin of an extension:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
plugin.tx_myextension_myplugin.ignoreFlexFormSettingsIfEmpty = field1,field2
Copied!

If an extension already defined ignoreFlexFormSettingsIfEmpty, integrators are advised to use addToList or removeFromList to modify existing settings:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
plugin.tx_myextension_myplugin.ignoreFlexFormSettingsIfEmpty := removeFromList(field1)
plugin.tx_myextension_myplugin.ignoreFlexFormSettingsIfEmpty := addToList(field3)
Copied!

Plugin persistence Examples

Example: Disable automatic cache clearing for an Extbase plugin

Demonstrates:
EXT:blog_example/Configuration/TypoScript/setup.typoscript
plugin.tx_blogexample_admin {
    persistence {
        enableAutomaticCacheClearing = 0
    }
}
Copied!

Example: Set recursive storage PID for Extbase plugin

Demonstrates:
EXT:blog_example/Configuration/TypoScript/setup.typoscript
plugin.tx_blogexample {
    persistence {
        storagePid = 42
        # Includes 4 sub-levels of the storagePid
        recursive = 4

        T3docs\BlogExample\Domain\Model\Post {
            newRecordStoragePid = 43
        }
        T3docs\BlogExample\Domain\Model\Comment {
            newRecordStoragePid = 44
        }
    }
}
Copied!

Plugin view Examples

Example: Set template paths for Extbase plugin

Demonstrates:
EXT:blog_example/Configuration/TypoScript/setup.typoscript
plugin.tx_blogexample {
    view {
        layoutRootPaths {
            0 = EXT:blog_example/Resources/Private/Layouts/
            10 = EXT:my_extension/Resources/Private/Layouts/
        }
        partialRootPaths {
            0 = EXT:blog_example/Resources/Private/Partials/
            10 = EXT:my_extension/Resources/Private/Partials/
        }
        templateRootPaths {
            0 = EXT:blog_example/Resources/Private/Templates/
            10 = EXT:my_extension/Resources/Private/Templates/
        }
    }
}
Copied!

Plugin MVC Examples

Example: Call default action if action cannot be resolved

Demonstrates:
EXT:blog_example/Configuration/TypoScript/setup.typoscript
plugin.tx_blogexample {
    mvc {
        callDefaultActionIfActionCantBeResolved = 1
    }
}
Copied!

Example: Show 404 (page not found) page if action cannot be resolved

Demonstrates:
EXT:blog_example/Configuration/TypoScript/setup.typoscript
plugin.tx_blogexample {
    mvc {
        throwPageNotFoundExceptionIfActionCantBeResolved = 1
    }
}
Copied!

Plugin format examples

Example: Define alternative output formats for RSS feeds

Demonstrates:
EXT:blog_example/Configuration/TypoScript/setup.typoscript
plugin.tx_blogexample_rssfeedxml {
    // Use template List.xml
    format = xml
}
plugin.tx_blogexample_rssfeedatom {
    // Use template List.atom
    format = atom
}
Copied!

Plugin localization examples

Example: Override a language key in an Extbase plugin

Demonstrates:
EXT:site_package/Configuration/TypoScript/setup.typoscript
plugin.tx_myext_pi1._LOCAL_LANG.de.list_mode_1 = Der erste Modus
Copied!

Reserved top-level objects

List of the reserved top-level objects

lib

lib

lib

This top-level object name is reserved.

The top-level object lib is used to store, copy and reference TypoScript code.

This top-level object is available after the template is cached, objects in it can therefore be referenced and copied by using the reference operator =<.

EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
lib.some_content = TEXT
lib.some_content.value = Hello World!

// Output
// <p>Hello World!</p><p>Hello World!</p>
page = PAGE
page {
    10 =< lib.some_content
    10.wrap = <h1>|</h1>

    20 =< lib.some_content
    20.wrap = <p>|</p>
}
Copied!

styles

styles

styles

This top-level object name is reserved.

tt_content

The top-level keyword tt_content is used to render content from the table tt_content.

resources

resources

resources
Type
readonly

Resources in list (internal)

sitetitle

sitetitle

sitetitle
Type
readonly

SiteTitle (internal)

Functions

Sometimes a data type is defined as having a modifier. This is typically a function that can be used additionally.

The complex data type TEXT has a property "value" which is defined as having a simple data type "string" with the optional type modifier "stdWrap".

The data type would then be written as "string /stdWrap".

The following functions are defined in TypoScript:

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.

Properties

key

key

key
Type
string / stdWrap

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

lifetime

lifetime

lifetime
Type
mixed / stdWrap
Default
default

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.

tags

tags

tags
Type
string / stdWrap

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

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
5 = TEXT
5 {
    stdWrap {
        cache {
            key = mycurrenttimestamp
            tags = tag_a,tag_b,tag_c
            lifetime = 3600
        }
        data = date : U
        strftime = %H:%M:%S
    }
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
5 = TEXT
5 {
    stdWrap.cache {
        key = mycurrenttimestamp_{page:uid}_{siteLanguage:languageId}
        key.insertData = 1
    }
}
Copied!

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
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: | |
    }
}
Copied!

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 Content Objects (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.

Calc

Calculating values (+calc)

Sometimes a data type is set to someType +calc. The +calc indicates that the value is calculated with +-/\* operators. Be aware that the operators have no "weight". The calculation is done from left to right instead of order of operations (multiplication and division before addition and subtraction).

How value is calculated

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

calc usage example

The HMENU maxAge property is of a type integer +calc, it's value in this example equals to 259200.

EXT:site_package/Configuration/TypoScript/setup.typoscript
20 = HMENU
20.special = updated
20.special.value = 35, 56
20.special {
  mode = tstamp
  depth = 2
  maxAge = 3600*24*3
  limit = 8
}
Copied!

Data / getText

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

The general syntax is as follows:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = <key> : <code>
Copied!

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

The code can contain pipe characters | to separate keys in a multidimensional array. This, for example, works with TSFE:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = TSFE : fe_user | user | username
Copied!

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

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

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = field : header // field : title // field : uid
Copied!

Properties

applicationcontext

New in version 13.0

applicationcontext

applicationcontext

Returns the current application context as string.

Example: Evaluate the current application context

Evaluate if the current application context is "Production":

EXT:site_package/Configuration/TypoScript/setup.typoscript
if {
    value.data = applicationcontext
    equals = Production
}
Copied!

asset

asset

asset

New in version 13.2

Local resources can be cache-busted. It is not necessary anymore to rename the asset when it is exchanged, forcing browsers to relod the file.

The getText asset function includes assets like images, CSS or JavaScript in a cache-busted way.

Depending on $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] the cache buster is applied as query string or embedded in the filename.

The result is the same like using argument useCacheBusting="true" in Uri.resource ViewHelper <f:uri.resource>.

Example: Display extension icon with cache buster

EXT:my_extension/Configuration/TypoScript/setup.typoscript
page.20 = TEXT
page.20 {
    value.stdWrap.data = asset: EXT:core/Resources/Public/Icons/Extension.svg
}
Copied!

cObj

cObj

cObj

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

parentRecordNumber is the only key available.

Example: Get the number of the current cObject record

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = cObj : parentRecordNumber
Copied!

context

context

context

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

Syntax:

TypoScript Syntax
lib.foo.data = context:<aspectName>:<propertyName>
Copied!

Example: Retrieve current workspace ID

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.data = context:workspace:id
page.10.wrap = You are in workspace: |
Copied!

current

current

current

current (gets the "current" value)

Example: Get the current value

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = current
Copied!

date

date

date
Default
d/m Y

Can be used with a colon and date-conf.

Example: Get the current time formatted dd-mm-yy

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = date : d-m-y
Copied!

DB

DB

DB
Syntax
DB : [table name] : [uid] : [field]

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

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

Example: Get a header field value of a record

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = DB : tt_content:234:header
Copied!

Get the value of the header field of a record, whose uid is stored in a GET parameter myContentId:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data.dataWrap = DB : tt_content:{GP : myContentId}:header
Copied!

debug

debug

debug

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

Example: Debug the current root-line

Outputs the current root-line visually in HTML:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = debug : rootLine
Copied!

field

field

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

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

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

Example: Get header data

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = field : header
Copied!

Example: Get data of a field

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = field : fieldname | level1 | level2
Copied!

file

file

file
Syntax
file : [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, it is also possible to reference the current file with current as UID like file : current : size.

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

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

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

See the FILES cObject for usage examples.

Example: Get the size of a file

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = file : 17 : size
Copied!

flexform

flexform

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

Access values from FlexForms, for example inside of tt_content record. In contrast to most parts, deeper levels are accessed through dots, not pipes.

Example: Get a FlexForm value

Return the FlexForm value of given name:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = flexform : pi_flexform:settings.categories
Copied!

fullRootLine

fullRootLine

fullRootLine
Syntax
fullRootLine : [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 property, it is possible to go up only to the page "Site root", because it is the root of a new (sub-)site. With fullRootLine it is possible to go all the way up to page tree root. The numbers between square brackets indicate to which page each value of pointer would point to:

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

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

Example: Get the title of the previous page

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = fullRootLine : -1, title
Copied!

getenv

getenv

getenv

Value from PHP environment variables.

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

Example: Get the HTTP referer

Get the environment variable HTTP_REFERER:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = getenv : HTTP_REFERER
Copied!

getIndpEnv

getIndpEnv

getIndpEnv
Syntax
getIndpEnv : <name>

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

Available names:

Name Definition Example or result
_ARRAY Return an array with all available key-value pairs for debugging purposes  
HTTP_ACCEPT_LANGUAGE language(s) accepted by client  
HTTP_HOST [host][:[port]] example.org:8080
HTTP_REFERER [scheme]://[host][:[port]][path] https://example.org: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] example.org
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)  

Example: Get the remote address

EXT:site_package/Configuration/TypoScript/setup.typoscript
# get and output the client IP
page = PAGE
page.10 = TEXT
page.10.stdWrap.data = getIndpEnv : REMOTE_ADDR
page.10.stdWrap.htmlSpecialChars = 1
Copied!

global

global

global
Syntax
global : [variable]

Deprecated, use GP, TSFE or getenv.

GP

GP

GP
Syntax
GP : [Value from GET or POST method]

Get a variable from $_GET or $_POST where a variable, which exists in both arrays, is returned from $_POST.

Example: Get the input value from query string

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = GP : stuff
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = GP : stuff | bar
Copied!

level

level

level

Get the root line level of the current page.

Example: Get the root line level of the current page

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = level
Copied!

levelfield

levelfield

levelfield
Syntax
levelfield : [pointer, integer], [field name], ["slide"]

Like leveltitle but the field do be fetched from the record is configurable.

Example: Get a field from a page up in the root-line

Get the value of the user-defined field tx_myextension_myfield in the root line.

EXT:my_extension/Configuration/TypoScript/setup.typoscript
lib.foo.data = levelfield : -1, tx_myextension_myfield, slide
Copied!

Changed in version 13.2

Until TYPO3 v13 it was required to do additional configuration in $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] to use custom fields.

To stay compatible with both TYPO3 v12 and v13, add the following to your extensions ext_localconf.php:

EXT:my_extension/ext_localconf.php
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;

defined('TYPO3') or die();

$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
// TODO: Remove when dropping TYPO3 v12 support
if ($versionInformation->getMajorVersion() < 13) {
    $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_myextension_myfield';
}
Copied!

levelmedia

levelmedia

levelmedia
Syntax
levelmedia : [pointer, integer], ["slide"]

Get the media field of a page in the root-line.

  • Use an absolute level with 0 or a positive integer.
  • With a negative integer got x levels up
  • The slide parameter slides until there is a non-empty value found.

leveltitle

leveltitle

leveltitle
Syntax
leveltitle : [pointer, integer], ["slide"]

Get the title of a page in the root-line.

  • Use an absolute level with 0 or a positive integer.
  • With a negative integer got x levels up
  • The slide parameter slides until there is a non-empty value found.

Example: Get the title of a page up in the root line

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = leveltitle : 1
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = leveltitle : -2, slide
Copied!

leveluid

leveluid

leveluid
Syntax
leveluid : [pointer, integer]

Get the UID of a page in the root line.

  • Use an absolute level with 0 or a positive integer.
  • With a negative integer got x levels up

Example: Get the ID of the root page of the page tree

Get the ID of the root page of the website (level zero):

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = leveluid : 0
Copied!

LLL

LLL

LLL
Syntax
LLL: [fileref]:[labelkey]

Reference to a locallang label (XLIFF). Reference consists of [fileref]:[labelkey]

Example: Get a localized label

Get the localized label for the logout button:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = LLL : EXT:felogin/Resources/Private/Language/locallang.xlf:logout
Copied!

page

page

page
Syntax
page: [field in the current page record]

Get the specified field from the current page

Example: Get the current page title

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = page : title
Copied!

pagelayout

pagelayout

pagelayout

Get the current backend layout

Example: Get the current backend layout

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = pagelayout
Copied!

parameters

parameters

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

Get the content of a key in parameters array of the current cObject.

Example: Get the parameter color

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = parameters : color
Copied!

path

path

path

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

Example: Resolve the path to a file

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = path : EXT:rsaauth/resources/rsaauth.js
Copied!

It can also be helpful in combination with the stdWrap function :

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.headerData.10 = TEXT
page.headerData.10 {
    data = path : EXT:site/Resources/Public/Images/logo.png
    wrap = <a href="|">
}
Copied!

register

register

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

Example: Get the content of a register

Get content from the register:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = register : color
Copied!

request

request

request
Syntax
request : [attribute] | [property] ( | [subproperty] | ... )

Retrieve the property of a PSR-7 request attribute.

Note that only scalar properties can be retrieved: int, float, string or bool as value. If the property is an object or an array, a subproperty can be given which then calls the getter method of the object or retrieves the key of the array.

Example: Get the page type

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = request : routing | pageType
Copied!

Example: Get a query argument

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Retrieve the value of the query parameter ?myParam=<value>
lib.foo.data = request : routing | queryArguments | myParam

# Retrieve the value of the query parameter ?tx_myext[key]=<value>
lib.foo.data = request : routing | queryArguments | tx_myext | key
Copied!

Example: Get the nonce

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = request : nonce | value
Copied!

session

session

session
Syntax
session : [key]

The key refers to the session key used to store the value.

Example: Get a value stored in the current session

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = session : shop_cart | itemCount
Copied!

site

site

site
Syntax
site : [key]

Accessing the current site configuration.

Possible keys:
attributes
Additional parameters configured for this site.
base
The base URL for this site.
baseVariants
The base variants for this site.
rootPageId
The root page ID of this site.
identifier
The identifier (name) of this site configuration.
websiteTitle
The website title of this site.

Example: Get values from the current site

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.data = site:base
page.10.wrap = This is your base URL: |
Copied!

Where site is the keyword for accessing an aspect, and the following parts are the configuration key(s) to access.

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.data = site:customConfigKey.nested.value
Copied!

siteLanguage

siteLanguage

siteLanguage
Syntax
siteLanguage : [key]

Accessing the current site language configuration.

Possible keys:
attributes
Additional parameters configured for this site language.
base
The base URL for this language.
flagIdentifier

The flag key (like gb or fr) used in the TYPO3 backend.

You can also use flag to match the corresponding site configuration setting.

hreflang

The language tag for this language defined by RFC 1766 / 3066 for hreflang attributes.

This option is not relevant for regular websites without rendering hreflang tag.

languageId
The language mapped to the ID of the site language.
locale

Changed in version 12.3

The locale property in typoscript can be subdivided into more specific details using subkeys separated by a colon :. The subkeys languageCode, countryCode, and full allow access to the individual components of the locale value. For instance, a locale value of "en_US.UTF-8" can be broken down into "en", "US", and for the full subkey, "en-US".

  • languageCode: this contains the two-letter language code (previously siteLanguage:twoLetterIsoCode)
  • countryCode: contains the uppercase country code part of the locale
  • full: contains the entire locale (also the default if no subkey is specified)

The locale property represents the language, country, and character encoding settings for TYPO3. It is a composite value, such as "en_US.UTF-8", which can be dissected into different components via subkeys for more precise language and location specifications.

navigationTitle
The label to be used within language menus.
title
The label to be used within TYPO3 to identify the language.
typo3Language
The prefix for TYPO3's language files (default for English), otherwise one of TYPO3's internal language keys. Previously configured via TypoScript config.language = fr.
websiteTitle
The website title for this language. No automatic fallback to the site:websiteTitle!

Example: Get values from the current site language

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.data = siteLanguage:navigationTitle
page.10.wrap = This is the title of the current site language: |

page.20 = TEXT
page.20.dataWrap = The current site language's locale is {siteLanguage:locale}

# Website title for the current language with fallback
# to the website title of the site configuration.
page.30 = TEXT
page.30.data = siteLanguage:websiteTitle // site:websiteTitle
Copied!

siteSettings

siteSettings

siteSettings

Access the site settings for the current site.

Example: Access the redirects HTTP status code

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.data = siteSettings:redirects.httpStatusCode
Copied!

TSFE

TSFE

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

Changed in version 13.0

The following properties within TypoScriptFrontendController (TSFE) have been removed:

  • spamProtectEmailAddresses
  • intTarget
  • extTarget
  • fileTarget
  • baseUrl

Migrate these properties to use the config property. You can access the TypoScript properties directly, for example, via lib.something.data = TSFE : config | config | fileTarget

Example: Get the username field of the current frontend user

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.foo.data = TSFE : fe_user | user | username
Copied!

encapsLines

This function is a sub-function of stdWrap and can be used like this:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
page.20 = TEXT
page.20 {
    value (
        First line of text
        Some <div>text</div>
        <p>Some text</p>
        <div>Some text</div>
        <B>Some text</B>
    )
    stdWrap.encapsLines {
        encapsTagList = div, p
        remapTag.P=DIV
    }
}
Copied!

Properties

encapsTagList

encapsTagList

encapsTagList
Type
list of string

List of tags which qualify as encapsulating tags. Must be lowercase.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
encapsTagList = div, p
Copied!

This setting will recognize the highlighted lines below as encapsulated lines:

Example Output
First line of text
Some <div>text</div>
<p>Some text</p>
<div>Some text</div>
<B>Some text</B>
Copied!

remapTag.[tagname]

remapTag

remapTag
Type
array of string

Enter a new tag name here if you wish the tag name 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>
Copied!

to :

<div>Some text</div>
<div>Some text</div>
Copied!

([tagname] is in uppercase.)

addAttributes.[tagname]

addAttributes

addAttributes
Type
array of string
Default
Always override/set the value of the attributes.

Attributes to set in the encapsulation tag.

([tagname] is in uppercase.)

EXT:site_package/Configuration/TypoScript/setup.typoscript
addAttributes.P.setOnly = exists
Copied!
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 ("").
Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
addAttributes.P {
    style = padding-bottom: 0px; margin-top: 1px; margin-bottom: 1px;
    align = center
}
Copied!

removeWrapping

removeWrapping

removeWrapping
Type
boolean

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

becomes this:

First line of text
Some <div>text</div>
Some text
Some text
<b>Some text</b>
Copied!

wrapNonWrappedLines

wrapNonWrappedLines

wrapNonWrappedLines
Type

Wrapping for non-encapsulated lines

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
wrapNonWrappedLines = <p>|</p>
Copied!

This:

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

becomes this:

<P>First line of text</P>
<p>Some text</p>
Copied!

innerStdWrap_all

innerStdWrap_all

innerStdWrap_all
Type
stdWrap

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

encapsLinesStdWrap.[tagname]

encapsLinesStdWrap

encapsLinesStdWrap
Type
array of string / stdWrap

Wraps the content inside all encapsulated lines.

([tagname] is in uppercase.)

defaultAlign

defaultAlign

defaultAlign
Type
string / stdWrap

If set, this value is set as the default "align" value of the wrapping tags, both from encapsTagList and nonWrappedTag

nonWrappedTag

nonWrappedTag

nonWrappedTag
Type
tagname

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.

Examples

<p> tag is used to encapsulate each line

EXT:site_package/Configuration/TypoScript/setup.typoscript
encapsLines {
    encapsTagList = div,p
    remapTag.DIV = P
    wrapNonWrappedLines = <p>|</p>
    innerStdWrap_all.ifEmpty = &nbsp;
}
Copied!

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:

Example input
This is line # 1

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

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

Example output
<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>
Copied!

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

Advanced example

EXT:site_package/Configuration/TypoScript/setup.typoscript
# 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 >
Copied!

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

getEnv

Allows to override static values with environment variables.

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

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

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

Example

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Define default value
myConstant = defaultValue
# Enable overriding by environment variable
myConstant := getEnv(TS_MYCONSTANT)
Copied!

HTMLparser

Properties

allowTags

allowTags

allowTags
Type
list of tags

Default allowed tags.

stripEmptyTags

stripEmptyTags

stripEmptyTags
Type
boolean

Passes the content to PHPs strip_tags().

stripEmptyTags.keepTags

stripEmptyTags.keepTags

stripEmptyTags.keepTags
Type
string

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

tags.[tagname]

tags

tags
Type
boolean / string of HTMLparser_tags

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

[tagname] in lowercase.

localNesting

localNesting

localNesting
Type
list of tags, must be among preserved tags

List of tags (among the already set tags), which will be forced to have the nesting-flag set to true.

globalNesting

globalNesting

globalNesting
Type
(ibid)

List of tags (among the already set tags), which will be forced to have the nesting-flag set to "global".

rmTagIfNoAttrib

rmTagIfNoAttrib

rmTagIfNoAttrib
Type
(ibid)

List of tags (among the already set tags), which will be forced to have the rmTagIfNoAttrib set to true.

noAttrib

noAttrib

noAttrib
Type
(ibid)

List of tags (among the already set tags), which will be forced to have the allowedAttribs value set to zero (which means, all attributes will be removed.

removeTags

removeTags

removeTags
Type
(ibid)

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

keepNonMatchedTags

keepNonMatchedTags

keepNonMatchedTags
Type
boolean / "protect"

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

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

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

htmlSpecialChars

htmlSpecialChars

htmlSpecialChars
Type
-1 / 0 / 1 / 2

This regards all content which is not tags:

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

HTMLparser_tags

Properties

overrideAttribs

overrideAttribs

overrideAttribs
Type
string

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

allowedAttribs

allowedAttribs

allowedAttribs
Type
mixed

Defines the allowed attributes.

Possible values:

0
No attributes allowed.
(comma-separated list of attributes)
Only attributes in this list are allowed.
(blank/not set)
All attributes are allowed.

fixAttrib.[attribute].set

fixAttrib.[attribute].set

fixAttrib.[attribute].set
Type
string

Force the attribute value to this value.

fixAttrib.[attribute].unset

fixAttrib.[attribute].unset

fixAttrib.[attribute].unset
Type
boolean

If set, the attribute is unset.

fixAttrib.[attribute].default

fixAttrib.[attribute].default

fixAttrib.[attribute].default
Type
string

If no attribute exists by this name, this value is set as default value (if this value is not blank)

fixAttrib.[attribute].always

fixAttrib.[attribute].always

fixAttrib.[attribute].always
Type
boolean

If set, the attribute is always processed. Normally an attribute is processed only if it exists

fixAttrib.[attribute].trim

fixAttrib.[attribute].trim

fixAttrib.[attribute].trim
Type
boolean

If true, the value is passed through the respective PHP-function.

fixAttrib.[attribute].intval

fixAttrib.[attribute].intval

fixAttrib.[attribute].intval
Type
boolean

If true, the value is passed through the respective PHP-function.

fixAttrib.[attribute].upper

fixAttrib.[attribute].upper

fixAttrib.[attribute].upper
Type
boolean

If true, the value is passed through the PHP function strtoupper().

fixAttrib.[attribute].lower

fixAttrib.[attribute].lower

fixAttrib.[attribute].lower
Type
boolean

If true, the value is passed through the PHP function strtolower().

fixAttrib.[attribute].range

fixAttrib.[attribute].range

fixAttrib.[attribute].range
Type
[low],[high]

Setting integer range.

fixAttrib.[attribute].list

fixAttrib.[attribute].list

fixAttrib.[attribute].list
Type
list of values, trimmed

Attribute value must be in this list. If not, the value is set to the first element.

fixAttrib.[attribute].removeIfFalse

fixAttrib.[attribute].removeIfFalse

fixAttrib.[attribute].removeIfFalse
Type
boolean / blank string

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

fixAttrib.[attribute].removeIfEquals

fixAttrib.[attribute].removeIfEquals

fixAttrib.[attribute].removeIfEquals
Type
string

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

fixAttrib.[attribute].casesensitiveComp

fixAttrib.[attribute].casesensitiveComp

fixAttrib.[attribute].casesensitiveComp
Type
boolean

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

fixAttrib.[attribute].prefixRelPathWith

fixAttrib.[attribute].prefixRelPathWith

fixAttrib.[attribute].prefixRelPathWith
Type
string

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.parser.fixAttrib.src.prefixRelPathWith = https://example.org/typo3/32/dummy/
Copied!

fixAttrib.[attribute].userFunc

fixAttrib.[attribute].userFunc

fixAttrib.[attribute].userFunc
Type
function name

User function for processing of the attribute. The return value of this function will be used as the new tag value.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.parser.fixAttrib.href.userFunc = \Vendor\ExtName\ClassName->function
Copied!

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.parser.fixAttrib.href.userFunc.myCustomParm = myCustomValue
Copied!

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

protect

protect

protect
Type
boolean

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

remap

remap

remap
Type
string

If set, the tagname is remapped to this tagname

rmTagIfNoAttrib

rmTagIfNoAttrib

rmTagIfNoAttrib
Type
boolean

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

nesting

nesting

nesting
Type
mixed

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

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

if

Allows you to check multiple conditions.

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

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

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

Simple "if empty use different value" conditions for record data can be built with the TypoScript // (double slash) fallback operator.

Also check the explanations and the examples further below!

Properties

bitAnd

bitAnd

bitAnd
Type
value / stdWrap

Returns true, if the value is part of the bit set.

Example

TYPO3 uses bits to store radio and checkboxes via TCA, bitAnd can be used to test against these fields.

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.hideDefaultLanguageOfPage = TEXT
lib.hideDefaultLanguageOfPage {
    value = 0
    value {
        override = 1
        override.if {
            bitAnd.field = l18n_cfg
            value = 1
        }
    }
}
Copied!

contains

contains

contains
Type
value / stdWrap

Returns true, if the content contains value.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
# Add a span tag before the page title if the page title
# contains the string "media"
page.10 = TEXT
page.10 {
    data = page:title
    htmlSpecialChars = 1
    prepend = TEXT
    prepend {
        value = <span class="icon-video"></span>
        if.value.data = page:title
        if.contains = Media
    }
    outerWrap = <h1>|</h1>
}
Copied!

directReturn

directReturn

directReturn
Type
boolean

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.

endsWith

endsWith

endsWith
Type
value / stdWrap

Returns true, if the content ends with value.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
# Add a footer note, if the page author ends with "Kott"
page.100 = TEXT
page.100 {
    value = This is an article from Benji
    htmlSpecialChars = 1
    if.value.data = page:author
    if.endsWith = Kott
    wrap = <footer>|</footer>
}
Copied!

equals

equals

equals
Type
value / stdWrap

Returns true, if the content is equal to value.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
if.equals = POST
if.value.data = GETENV:REQUEST_METHOD
Copied!

isFalse

isFalse

isFalse
Type
string / stdWrap

If the content is "false", which is empty or zero.

isGreaterThan

isGreaterThan

isGreaterThan
Type
value / stdWrap

Returns true, if the content is greater than value.

isInList

isInList

isInList
Type
value / stdWrap

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

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

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
if.isInList.field = uid
if.value = 1,2,34,50,87
Copied!

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

isLessThan

isLessThan

isLessThan
Type
value / stdWrap

Returns true, if the content is less than value.

isNull

isNull

isNull
Type
stdWrap

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
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = COA_INT
page.10.10 = TEXT
page.10.10 {
      stdWrap.if.isNull.field = description
      value = No description available.
}
Copied!

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

isPositive

isPositive

isPositive
Type
integer / stdWrap + Calc

Returns true, if the content is positive.

isTrue

isTrue

isTrue
Type
string / stdWrap

If the content is "true", which is not empty string and not zero.

negate

negate

negate
Type
boolean
Default
0

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.

startsWith

startsWith

startsWith
Type
value / stdWrap

Returns true, if the content starts with value.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10 {
    value = Your editor added the magic word in the header field
    htmlSpecialChars = 1
    if.value.data = DB:tt_content:1234:header
    if.startsWith = Bazinga
}
Copied!

value

value

value
Type
value / stdWrap

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

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 Content Objects (cObject) and stdWrap).

Here is how it works:

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

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.if.value = 10
page.10.if.isGreaterThan = 11
Copied!

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

More complex is this:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.if {
  value = 10
  isGreaterThan = 11
  isTrue.field = header
  negate = 1
}
Copied!

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!

EXT:site_package/Configuration/TypoScript/setup.typoscript
30 = TEXT
30.text = NEW!
30.offset = 10,10
30.if {
  value.data = date: U
  isLessThan.field = newUntil
  negate = 1
}
Copied!

imageLinkWrap

Properties

enable

imageLinkWrap.enable

imageLinkWrap.enable
Type
boolean / stdWrap
Default
0

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

file

imageLinkWrap.file

imageLinkWrap.file
Type
stdWrap

Apply stdWrap functionality to the file path.

width

imageLinkWrap.width

imageLinkWrap.width
Type
integer / stdWrap
Default
0

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

imageLinkWrap.height
Type
integer / stdWrap
Default
0

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

imageLinkWrap.effects
Type
like EFFECT of GIFBUILDER
Default
0

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

sample

imageLinkWrap.sample

imageLinkWrap.sample
Type
integer / stdWrap
Default
0

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.

title

imageLinkWrap.title

imageLinkWrap.title
Type
string / stdWrap

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

bodyTag

imageLinkWrap.bodyTag

imageLinkWrap.bodyTag
Type
string / stdWrap

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

Example setting a bodytag for the preview window

# "onBlur" closes the window automatically if it looses focus
imageLinkWrap.JSwindow = 1
imageLinkWrap.bodyTag (
    <body class="jsWindow someOtherClass"
          onBlur="self.close()">
)
Copied!

wrap

imageLinkWrap.wrap

imageLinkWrap.wrap
Type
Wrap

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

target

imageLinkWrap.target

imageLinkWrap.target
Type
string / stdWrap
Default
thePicture

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

Example: Use an alternative target for the JavaScript Window

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

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

JSwindow

imageLinkWrap.JSwindow

imageLinkWrap.JSwindow
Type
boolean / stdWrap
Default
0

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

imageLinkWrap.JSwindow.expand
Type
x, y / stdWrap
Default
0

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

JSwindow.newWindow

JSwindow.newWindow
Type
boolean / stdWrap
Default
0

If the Doctype allows the string 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 string attribute is to be shown then it will appear in the same preview window. If JSwindow.newWindow is set to True, then a unique hash value is used as target value for each image. This guarantees that each image is opened in a new window.

JSwindow.altUrl

imageLinkWrap.JSwindow.altUrl

imageLinkWrap.JSwindow.altUrl
Type
string / stdWrap

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

imageLinkWrap.JSwindow.altUrl_noDefaultParams
Type
boolean / stdWrap
Default
0

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

imageLinkWrap.linkParams
Type
typolink / stdWrap

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: Use alternative parameters for the a-tag

This way it is possible 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".

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

stdWrap

imageLinkWrap.stdWrap

imageLinkWrap.stdWrap
Type
stdWrap

This adds stdWrap functionality to the almost final result.

What it does

imageLinkWrap = 1

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

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

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

Implementation

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

Examples for imageLinkWrap

Example: Larger display in a popup window

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

Example: Images in lightbox "fancybox"

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

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

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

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

imgResource

An imgResource one of the following:

  1. A resource plus imgResource properties.

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

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

Here "file" is an imgResource:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = IMAGE
10 {
    file = fileadmin/toplogo.gif
    file.width = 200
}
Copied!

GIFBUILDER:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = IMAGE
10.file = GIFBUILDER
10.file {
    # GIFBUILDER properties here...
}
Copied!

Properties

ext

ext

ext
Type
string / stdWrap
Default
web

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

Standard is gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg,webp.

width

width

width
Type
integer / stdWrap

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

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

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

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

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.image {
    width = 120c
    height = 80c
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.image {
    width = 100c-100
    height = 100c
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.image {
    width = 100c+30
    height = 100c-25
}
Copied!

height

height

height
Type
integer / stdWrap

See width.

params

params

params
Type
string / stdWrap

GraphicsMagick/ImageMagick command line:

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

sample

sample

sample
Type
boolean
Default
0

If set, -sample is used to scale images instead of -geometry. Sample does not use anti-aliasing and is therefore much faster.

noScale

noScale

noScale
Type
boolean / stdWrap
Default
0

If set, the image itself will never be scaled. Only width and height are calculated according to the other properties, so that the image is displayed resized, but the original file is used. Can be used for creating PDFs or printing of pages, where the original file could provide much better quality than a rescaled one.

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
file = fileadmin/test.jpg
file.width = 240m
file.height = 240m
file.noScale = 1
Copied!

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

crop

crop

crop
Type
string / stdWrap
Default
not-set (when file/image is a file_reference the crop value of

Changed in version 13.2

SVG images are now processed natively in SVG during cropping. To keep the old behaviour of transferring them into PNG, you can set ext to png explicitly.

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

the file reference is used)

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.image.20.1.file.crop =
Copied!

Overrule/set cropping for all images:

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.image.20.1.file.crop = 50,50,100,100
Copied!

Natively crop a SVG image:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = IMAGE
page.10.file = 2:/myfile.svg
page.10.file.crop = 20,20,500,500
Copied!

cropVariant

cropVariant

cropVariant
Type
string
Default
default

Since it's possible to define certain crop variants you can specify which one to use here.

Examples

Use 'desktop' crop variant:

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.image.20.1.file {
    crop.data = file:current:crop
    cropVariant = desktop
}
Copied!

frame

frame

frame
Type
integer / stdWrap

Chooses the frame in a PDF or GIF file.

"" = first frame (zero)

import

import

import
Type
path / stdWrap

value should be set to the path of the file

with stdWrap you get the filename from the data-array

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.image.20.1.file {
    import = uploads/pics/
    import.field = image
    import.listNum = 0
}
Copied!

treatIdAsReference

treatIdAsReference

treatIdAsReference
Type
boolean / stdWrap
Default
0

If set, given UIDs are interpreted as UIDs to sys_file_reference instead of to sys_file. This allows using file references, for example with import.data = levelmedia: ....

maxW

maxW

maxW
Type
integer / stdWrap

Maximum width

maxH

maxH

maxH
Type
integer / stdWrap

Maximum height

minW

minW

minW
Type
integer / stdWrap

Minimum width (overrules maxW/maxH)

minH

minH

minH
Type
integer / stdWrap

Minimum height (overrules maxW/maxH)

stripProfile

stripProfile

stripProfile
Type
boolean
Default
0

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.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = IMAGE
10.file = fileadmin/images/image1.jpg
10.file.stripProfile = 1
Copied!

Masking (m)

Masking:

Masking:

(Black hides, white shows)

m.mask

m.mask

m.mask
Type
imgResource

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.

m.bgImg

m.bgImg

m.bgImg
Type
imgResource

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

m.bottomImg

m.bottomImg

m.bottomImg
Type
imgResource

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.

m.bottomImg_mask

m.bottomImg_mask

m.bottomImg_mask
Type
imgResource

(optional)

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

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
file = fileadmin/toplogo.png
file.width = 200
Copied!

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.

Properties

decimals

decimals

decimals
Type
integer / stdWrap
Default
0

Number of decimals the formatted number will have.

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

dec_point

dec_point

dec_point
Type
string / stdWrap
Default
.

Character that divides the decimals from the rest of the number.

thousands_sep

thousands_sep

thousands_sep
Type
string / stdWrap
Default
,

Character that divides the thousands of the number. Set an empty value to have no thousands separator.

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
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".
Copied!

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.

Properties

table

table

table
Type
Table name

Name of the database table to query.

select

select

select
Type
select

Select query for the operation.

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

Example

Get the number of content elements within certain colPos of the current page.

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = FLUIDTEMPLATE
10 {
    variables {
        numberOfContentElementsInColPosOne = TEXT
        numberOfContentElementsInColPosOne.numRows {
            table = tt_content
            select.where = {#colPos}=1
        }
    }
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
topmenu.1.NO {
    ATagParams = class="z"
}
Copied!

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 a solution for this task as well. We can specify more than just one shaping of a value for a property. Let's describe this as: We have an input sequence M items.

Now we can precisely define what optionSplit is.

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

In other words:

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

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

PHP-Code

Lookout for usages of the function \TYPO3\CMS\Core\TypoScript\TypoScriptService::explodeConfigurationForOptionSplit().

Terminology

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

Mainparts

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
Copied!
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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
Copied!

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
wrap = a || b || c  |*|  r || s || t  |*|  x || y || z
Copied!

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
wrap = a || b || c  |*|  r || s || t  |*|  x || y || z
Copied!
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
Copied!

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.
  8. If mainpart R is empty the last subpart of A is repeated.

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

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

Two by three items

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

According to rules 1 to 7 we get:

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

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

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

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

One by one items

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

input:
   wrap = a

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

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

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

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

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

`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
Copied!

One item A, one (unexpected!?) item R, one item Z

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

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

Test Code 1 (TypoScript)

EXT:site_package/Configuration/TypoScript/constants.typoscript
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
Copied!
EXT:site_package/Configuration/TypoScript/setup.typoscript
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}
    }
  }
}
Copied!

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_]
Copied!

Test Code 2 (TypoScript)

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

EXT:site_package/Configuration/TypoScript/constants.typoscript
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
Copied!
EXT:site_package/Configuration/TypoScript/setup.typoscript
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}
        #}
    }
}
Copied!

Test Code 2 Result

Result
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
Copied!

parseFunc

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

Properties

externalBlocks

externalBlocks

externalBlocks
Type
list of tagnames / +properties

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
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;"
      }
}
Copied!

short

short

short
Type
(array of strings)

If this property is set, you can replace a char or word in your text with the value of the according constant.

Example

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.value = Learn more about T3, look here: T3web
page.10.parseFunc.short {
      T3 = TYPO3 CMS
      T3web = <a href="https://typo3.org">typo3.org</a>
}
# Output: Learn more about TYPO3 CMS, look here: <a href="https://typo3.org">typo3.org</a>
Copied!

plainTextStdWrap

plainTextStdWrap

plainTextStdWrap
Type
stdWrap

This is stdWrap properties for all non-tag content.

userFunc

userFunc

userFunc
Type
function name

This passes the non-tag content to a function of your own choice. Similar to, for example, in stdWrap, or typolink.userFunc.

Remember the function name must possibly be prepended user_.

nonTypoTagStdWrap

nonTypoTagStdWrap

nonTypoTagStdWrap
Type
stdWrap

Like plainTextStdWrap. Difference:

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

nonTypoTagUserFunc

nonTypoTagUserFunc

nonTypoTagUserFunc
Type
function name

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

tags

tags

tags
Type
tags

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

allowTags

allowTags

allowTags
Type
list of strings or "*"

Changed in version 13.2

Defining the TypoScript properties allowTags or denyTags for the HTML processing via stdWrap.parseFunc is now optional.

Besides that, it is now possible to use allowTags = *.

List of tags, which are allowed to exist in code, use "*" for all. Security aspects are considered automatically by the HTML sanitizer, unless htmlSanitize is disabled explicitly.

If a tag is found in allowTags, the corresponding tag in denyTags is ignored!

Example

The example allows any tag, except <u> which will be encoded:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = <p><em>Example</em> <u>underlined</u> text</p>
10.parseFunc = 1
10.parseFunc {
  allowTags = *
  denyTags = u
}
Copied!

denyTags

denyTags

denyTags
Type
list of strings

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
tt_content.text.20.parseFunc {
    allowTags = b,i,a,img
    denyTags = *
}
Copied!

if

if

if
Type
if

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

Example

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
        }
    }
Copied!

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.

Properties

replace

replace

replace
Type
string / stdWrap

Defines the string to be used for the replacement.

useRegExp

useRegExp

useRegExp
Type
boolean / stdWrap
Default
0

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

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
10 {
    search = #(a )CAT#i
    replace = \1cat
    useRegExp = 1
}
Copied!

useOptionSplitReplace

useOptionSplitReplace

useOptionSplitReplace
Type
boolean / stdWrap
Default
0

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.

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
        }
    }
}
Copied!

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

The following examples demonstrate the use of optionSplit:

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
}
Copied!

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

round

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

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

Properties

roundType

roundType

roundType
Type
string / stdWrap
Default
round

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.

decimals

decimals

decimals
Type
integer / stdWrap
Default
0

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.

round

round

round
Type
boolean
Default
0

Set round = 1 to enable rounding.

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.number = TEXT
lib.number {
    value = 3.14159
    stdWrap.round = 1
    stdWrap.round.roundType = round
    stdWrap.round.decimals = 2
}
Copied!

This returns 3.14.

select

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

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

Properties

uidInList

uidInList

uidInList
Type
list of record uids / stdWrap

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

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

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
select {
   uidInList = 1,2,3
   pidInList = 0
}

select.uidInList = this
Copied!

pidInList

pidInList

pidInList
Type
list of page uids / stdWrap
Default
this

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

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

Special keyword: this
Is replaced with the id of the current page.
Special keyword: root
Allows to select records from the root-page level (records with pid=0, e.g. useful for the table "sys_category" and others).
Special value: -1
Allows to select versioned records in workspaces directly.
Special value: 0
Allows to disable the pid constraint completely. Requirements: uidInList must be set or the table must have the prefix "static_*".
Example

Fetch related sys_category records stored in the MM intermediate table:

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
   }
}
Copied!

recursive

recursive

recursive
Type
integer / stdWrap
Default
0

Number of recursive levels for the pidInList.

orderBy

orderBy

orderBy
Type
SQL-orderBy / stdWrap

ORDER BY clause without the words "ORDER BY".

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
orderBy = sorting, title
Copied!

groupBy

groupBy

groupBy
Type
SQL-groupBy / stdWrap

GROUP BY clause without the words "GROUP BY".

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
groupBy = CType
Copied!

max

max

max
Type
integer + Calc +"total" / stdWrap

Max records

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

begin

begin

begin
Type
integer + Calc +"total" / stdWrap

Begin with record number value.

Special keyword: total
Is substituted with count(*).

where

where

where
Type
SQL-where / stdWrap

WHERE clause without the word "WHERE".

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
where = (title LIKE '%SOMETHING%' AND NOT doktype)
Copied!

Use {#fieldname} to make the database framework quote these fields:

EXT:site_package/Configuration/TypoScript/setup.typoscript
where = ({#title} LIKE {#%SOMETHING%} AND NOT {#doktype})
Copied!

languageField

languageField

languageField
Type
string / stdWrap

This defaults to whatever is defined in TCA "ctrl"-section in the "languageField". Change it to overwrite the behaviour in your query.

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

This behaviour can be disabled by setting languageField = 0.

includeRecordsWithoutDefaultTranslation

includeRecordsWithoutDefaultTranslation

includeRecordsWithoutDefaultTranslation
Type
boolean / stdWrap
Default
0

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.

selectFields

selectFields

selectFields
Type
string / stdWrap
Default
*

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.

join, leftjoin, rightjoin

join, leftjoin, rightjoin

join, leftjoin, rightjoin
Type
string / stdWrap

Enter the JOIN clause without JOIN, LEFT OUTER JOIN and RIGHT OUTER JOIN respectively.

Example

Fetch related sys_category records stored in the MM intermediate table:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = CONTENT
10 {
   table = sys_category
   select {
      pidInList = root,-1
      selectFields = sys_category.*
      join = sys_category_record_mm mm ON mm.uid_local = sys_category.uid
      # ....
    }
}
Copied!

See pidInList for more examples.

markers

markers

markers
Type
(array of markers)

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
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.60 = CONTENT
page.60 {
    table = tt_content
    select {
        pidInList = 73
        where = header != ###whatever###
        markers {
            whatever.data = GP:first
        }
    }
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.60 = CONTENT
page.60 {
    table = tt_content
    select {
        pidInList = 73
        where = header != ###whatever###
        markers {
            whatever.value = some
            whatever.wrap = |thing
        }
    }
}
Copied!

This examples selects all records from the table tt_content which are on page 73 and which don't have a header set to a value constructed by whatever.value and whatever.wrap ('something').

Quoting of fields

It is possible to use {#fieldname} to make the database framework quote these fields (see Important: #80506 - Dbal compatible field quoting in TypoScript):

EXT:site_package/Configuration/TypoScript/setup.typoscript
select.where = ({#title} LIKE {#%SOMETHING%} AND NOT {#doktype})
Copied!

This applies to:

  • select.where

but not to:

  • select.groupBy
  • select.orderBy

as these parameters already follow a stricter syntax that allow automatic parsing and quoting.

Example

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

Condensed form:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = CONTENT
10 {
   table =
   select {
      uidInList =
      pidInList =
      recursive =
      orderBy =
      groupBy =
      max =
      begin =
      where =
      languageField =
      includeRecordsWithoutDefaultTranslation =
      selectFields =
      join =
      leftjoin =
      rightjoin =
   }
}
Copied!

See also:

  • CONTENT: for more complete examples with select and rendering the output with renderObj
  • Wrap: enclosing results within text, used in some of the examples above
  • stdWrap: for more functionality, can be used in some of the properties, such as pidInList, selectFields etc.

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.

Properties

token

token

token
Type
string / stdWrap

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

max

max

max
Type
integer / stdWrap

Maximum number of splits.

min

min

min
Type
integer / stdWrap

Minimum number of splits.

returnKey

returnKey

returnKey
Type
integer / stdWrap

Instead of parsing the split result, return the element of the index with this number immediately and stop processing of the split function.

returnCount

returnCount

returnCount
Type
boolean / stdWrap

Counts all elements resulting from the split, returns their number and stops processing of the split function.

Example
EXT:site_package/Configuration/TypoScript/setup.typoscript
# returns 9
1 = TEXT
1 {
    value = x,y,z,1,2,3,a,b,c
    split.token = ,
    split.returnCount = 1
}
Copied!

cObjNum

cObjNum

cObjNum
Type
cObjNum + optionSplit / stdWrap

This is a pointer the array of this object ("1,2,3,4"), that should treat the items, resulting from the split.

1,2,3,4

1,2,3,4,...

1,2,3,4,...
Type
cObject / stdWrap

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
EXT:site_package/Configuration/TypoScript/setup.typoscript
1.current = 1
1.wrap = <b> | </b>
Copied!
Example for stdWrap
EXT:site_package/Configuration/TypoScript/setup.typoscript
1 {
    10 = TEXT
    10.stdWrap.current = 1
    10.stdWrap.wrap = <b> | </b>
}
Copied!

wrap

wrap

wrap
Type
wrap + optionSplit / stdWrap

Defines a wrap for each item.

Example

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

20 = TEXT
20.stdWrap {
    field = bodytext
    split {
        token.char = 10
        cObjNum = 1
        1.current = 1
        1.wrap = <tr><td><img src="dot.gif"></td><td> | </td></tr>
    }
    stdWrap.wrap = <table style="width: 368px;"> | </table><br>
}
Copied!

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.

Content-supplying properties of stdWrap

stdWrap contains properties which determine what is applied. The properties are listed below.

If you want to study this further please refer to EXT:frontend/Classes/ContentObject/ContentObjectRenderer.php (GitHub), 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.

The above example could be rewritten to this:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = some text
10.stdWrap.case = upper
10.stdWrap.field = header
Copied!

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.

Properties

Properties for getting data

setContentToCurrent

setContentToCurrent
Type
boolean / stdWrap

Sets the current value to the incoming content of the function.

addPageCacheTags

addPageCacheTags
Type
string / stdWrap

Comma-separated list of cache tags, which should be added to the page cache.

Examples
addPageCacheTags = pagetag1,pagetag2,pagetag3
Copied!

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.

setCurrent

setCurrent
Type
string / stdWrap

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

lang
Type
Array of language keys / stdWrap

This is used to define optional language specific values based on the current site language.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.value = I am a Berliner!
page.10.stdWrap.lang.de = Ich bin ein Berliner!
Copied!

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

data

data
Type
Data / getText / stdWrap

field

field
Type
Field name / stdWrap

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

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.field = title
Copied!

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

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.field = nav_title // title
Copied!

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

current

current
Type
boolean / stdWrap

Sets the content to the "current" value (see ->split)

cObject

cObject
Type
Content Objects (cObject)

Loads content from a content object.

numRows

numRows
Type
->numRows / stdWrap

Returns the number of rows resulting from the supplied SELECT query.

preUserFunc

preUserFunc
Type
function name

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 .

Properties for overriding and conditions

override

override
Type
string / stdWrap

If override returns something else than "" or zero (trimmed), the content is loaded with this!

preIfEmptyListNum

preIfEmptyListNum
Type
(as "" below)

ifNull

ifNull
Type
string / stdWrap

If the content is null (NULL type in PHP), the content is overridden with the value defined here.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = COA_INT
page.10 {
   10 = TEXT
   10 {
      stdWrap.field = description
      stdWrap.ifNull = No description defined.
   }
}
Copied!

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

ifEmpty

ifEmpty
Type
string / stdWrap

If the trimmed content is empty at this point, the content is loaded with ifEmpty. Zeros are treated as empty values!

ifBlank

ifBlank
Type
string / stdWrap

Same as ifEmpty but the check is done against ''. Zeros are not treated as blank values!

listNum

listNum
Type
string / stdWrap

Explodes the current content (Default: ,) and returns the object specified by listNum.

Possible values:

last
The special keyword last is replaced with the index of the last element in the exploded content.
rand
The special keyword rand is replaced with the index of a random element in the exploded content.
Calc
After the special keywords are replaced with their according numeric values the
0 - last
If the content of listNum can be interpreted as integer the according index of the exploded content is returned. Counting starts with 0.
Examples

This would return "item 1":

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.value = item 1, item 2, item 3, item 4
page.10.listNum = 0
Copied!

This would return "item 3"

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.value = item 1, item 2, item 3, item 4
page.10.listNum = last – 1
Copied!

listNum.splitChar

listNum.splitChar
Type
string
Default
, (comma)
Examples

Splits the content of the field subtitle by the pipe character and returns a random element

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.5 = COA_INT
page.5 {
   10 = TEXT
   10 {
      stdWrap.field = subtitle
      stdWrap.listNum = rand
      stdWrap.listNum.splitChar = |
   }
}
Copied!

trim

trim
Type
boolean / stdWrap

If set, the PHP-function trim() will be used to remove whitespaces around the value.

strPad

strPad
Type
strPad

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

stdWrap
Type
stdWrap

Recursive call to the stdWrap function.

required

required
Type
boolean / stdWrap

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

if
Type
if

If the if-object returns false, stdWrap returns "" immediately.

fieldRequired

fieldRequired
Type
Field name / stdWrap

The value in this field must be set.

Properties for parsing data

csConv

csConv
Type
string / stdWrap

Convert the charset of the string from the charset given as value to the current rendering charset of the frontend (UTF-8).

parseFunc

parseFunc
Type
object path reference / parseFunc / stdWrap

Processing instructions for the content.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 {
    parseFunc = < lib.parseFunc_RTE
    parseFunc.tags.myTag = TEXT
    parseFunc.tags.myTag.value = This will be inserted when &lt;myTag&gt; is found!
}
Copied!

is enabled by default when is invoked. This also includes the Fluid Viewhelper <f:format.html>, since it invokes directly using lib.parseFunc_RTE.

The following example shows how to disable the sanitization behavior that is enabled by default. This is not recommended, but it can be disabled when required.

EXT:site_package/Configuration/TypoScript/setup.typoscript
// either disable globally
lib.parseFunc.htmlSanitize = 0
lib.parseFunc_RTE.htmlSanitize = 0

// or disable individually per use case
10 = TEXT
10 {
    value = <div><img src="invalid.file" onerror="alert(1)"></div>
    parseFunc =< lib.parseFunc_RTE
    parseFunc.htmlSanitize = 0
}
Copied!

Since any invocation of stdWrap.parseFunc triggers HTML sanitization automatically; unless explicitly disabled the following example causes a lot of generated markup to be sanitized and can be solved by explicitly disabling it with htmlSanitize = 0.

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = FLUIDTEMPLATE
10 {
    templateRootPaths {
        // ...
    }
    variables {
        // ...
    }
    stdWrap.parseFunc {
        // replace --- with soft-hyphen
        short.--- = &shy;
        // sanitization of ALL MARKUP is NOT DESIRED here
        htmlSanitize = 0
    }
}
Copied!

HTMLparser

HTMLparser
Type
boolean / HTMLparser / stdWrap

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

Value must be set and properties are those of HTMLparser.

(See Rich text editors (RTE) for more information about RTE transformations)

split

split
Type
split / stdWrap

replacement

replacement
Type
replacement / stdWrap

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

prioriCalc
Type
boolean / stdWrap

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
Example Output for different calculations
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
Copied!

char

char
Type
integer / stdWrap

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']);
Copied!

intval

intval
Type
boolean / stdWrap

PHP function intval() returns an integer:

$content = intval($content);
Copied!

hash

hash
Type
string / stdWrap

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 https://www.php.net/manual/en/function.hash-algos.php.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10 {
   value = test@example.org
   stdWrap.hash = md5
   stdWrap.wrap = <img src="https://www.gravatar.com/avatar/|" />
}
Copied!

round

round
Type
round / stdWrap

Round the value with the selected method to the given number of decimals.

numberFormat

numberFormat
Type
numberFormat

Format a float value to any number format you need (e.g. useful for prices).

date

date
Type
date-conf / stdWrap

The content should be data-type "UNIX-time". Returns the content formatted as a date. See the PHP manual (datetime.format) for the format codes.

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

Properties:

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

Examples

Render in human readable form:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 = TEXT
page.10.value {
   # format like 2017-05-31 09:08
   field = tstamp
   date = Y-m-d H:i
}
Copied!

strtotime

strtotime
Type
string

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.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.date_as_timestamp = TEXT
lib.date_as_timestamp {
   value = 2015-04-15
   strtotime = 1
}
Copied!
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.next_weekday = TEXT
lib.next_weekday {
   data = GP:selected_date
   strtotime = + 2 weekdays
   strftime = %Y-%m-%d
}
Copied!

strftime

strftime
Type
/ stdWrap

Very similar to "date", but using a different format. See the PHP manual (strftime) for the format codes.

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

Properties:

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

formattedDate

formattedDate
Type
string

The function renders date and time based on formats/patterns defined by the International Components for Unicode standard (ICU). ICU-based date and time formatting is much more flexible in rendering as or , as it ships with default patterns for date and time based on the given locale (given examples for locale en-US and timezone America/Los_Angeles):

  • FULL, for example: Friday, March 17, 2023 at 3:00:00 AM Pacific Daylight Time
  • LONG, for example: March 17, 2023 at 3:00:00 AM PDT
  • MEDIUM, for example: Mar 17, 2023, 3:00:00 AM
  • SHORT, for example: 3/17/23, 3:00 AM

TYPO3 also adds prepared custom patterns:

  • FULLDATE, for example: Friday, March 17, 2023
  • FULLTIME, for example: 3:00:00 AM Pacific Daylight Time
  • LONGDATE, for example: March 17, 2023
  • LONGTIME, for example: 3:00:00 AM PDT
  • MEDIUMDATE, for example: Mar 17, 2023
  • MEDIUMTIME, for example: 3:00:00 AM
  • SHORTDATE, for example: 3/17/23
  • SHORTTIME, for example: 3:00 AM

The locale is typically fetched from the locale setting in the site configuration.

Properties:

.locale
A locale other than the locale of the site language.
Example: Full German output from a date/time value
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.my_formatted_date = TEXT
lib.my_formatted_date {
    value = 2023-03-17 3:00:00
    formattedDate = FULL
    # Optional, if a different locale is wanted other than the site language's locale
    formattedDate.locale = de-DE
}
Copied!

will result in "Freitag, 17. März 2023 um 03:00:00 Nordamerikanische Westküsten-Sommerzeit".

Example: Full French output from a relative date value
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.my_formatted_date = TEXT
lib.my_formatted_date {
    value = -5 days
    formattedDate = FULL
    formattedDate.locale = fr-FR
}
Copied!

will result in "dimanche 12 mars 2023 à 11:16:44 heure d’été du Pacifique".

Example: Custom format from a timestamp
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.my_formatted_date = TEXT
lib.my_formatted_date {
    value = 1679022000
    formattedDate = Y-MM-dd'T'HH:mm:ssZ
}
Copied!

will return the date in the ISO 8601 format: "2023-03-17T03:00:00+00:00"

age

age
Type
boolean or string / stdWrap

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:

Default string for age format
min| hrs| days| yrs| min| hour| day| year
Copied!

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.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.ageFormat = TEXT
lib.ageFormat.stdWrap.data = page:tstamp
lib.ageFormat.stdWrap.age = " Minuten | Stunden | Tage | Jahre | Minute | Stunde | Tag | Jahr"
Copied!

case

case
Type
string / stdWrap

Converts case

Uses "UTF-8" for the operation.

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:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = Hello world!
10.case = upper
Copied!

Result:

Example Output
HELLO WORLD!
Copied!

bytes

bytes
Type
boolean / stdWrap
Default
iec, 1024

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

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

will show `0` but may raise a warning or an exception.
Copied!
Examples

Output value 1000 without special formatting. Shows 1000:

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   noTrimWrap = ||B|
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = si
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = si
   noTrimWrap = ||b|
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = " x 1 Byte| x 1000 Bytes"
   bytes.base = 1000
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = " byte (B)| kilobyte (kB)| megabyte (MB)| gigabyte (GB)| terabyte (TB)| petabyte (PB)| exabyte (EB)| zettabyte (ZB)| yottabyte YB"
   bytes.base = 1000
}
Copied!

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.10 = TEXT
page.10 {
   value = 1000
   bytes = 1
   bytes.labels = " byte (B)| kibibyte (KiB)| mebibyte (MiB)| gibibyte (GiB)| tebibyte (TiB)| pepibyte (PiB)| exbibyte (EiB)| zebibyte (ZiB)| yobibyte YiB"
   bytes.base = 1024
}
Copied!

substring

substring
Type
[p1], [p2] / stdWrap

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

Uses "UTF-8" for the operation.

cropHTML

cropHTML
Type
string / stdWrap

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

stripHtml
Type
boolean / stdWrap

Strips all HTML tags.

crop

crop
Type
string / stdWrap

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

rawUrlEncode
Type
boolean / stdWrap

Passes the content through the PHP function rawurlencode().

htmlSpecialChars

htmlSpecialChars
Type
boolean / stdWrap

Passes the content through the PHP function htmlspecialchars().

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

encodeForJavaScriptValue

encodeForJavaScriptValue
Type
boolean / stdWrap

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 already quoted with single quotes.

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

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.stdWrap {
      data = GP:sWord
      encodeForJavaScriptValue = 1
      wrap = setSearchWord(|);
}
Copied!

doubleBrTag

doubleBrTag
Type
string / stdWrap

All double line breaks are substituted with this value.

br

br
Type
boolean / stdWrap

Pass the value through the PHP function nl2br(). This converts each line break to a <br /> or a <br> tag depending on doctype.

brTag

brTag
Type
string / stdWrap

All ASCII codes of "10" (line feed, LF) are substituted with the value, which has been provided in this property.

encapsLines

encapsLines
Type
encapsLines / stdWrap

Lets you split the content by chr(10) and process each line independently. Used to format content made with the RTE.

keywords

keywords
Type
boolean / stdWrap

Splits the content by characters "," ";" and php:chr(10) (return), trims each value and returns a comma-separated list of the values.

Properties for wrapping data

innerWrap

innerWrap
Type
wrap / stdWrap

Wraps the content.

innerWrap2

innerWrap2
Type
wrap / stdWrap

Same as innerWrap (but watch the order in which they are executed).

preCObject

preCObject
Type
Content Objects (cObject)

prepended the content.

postCObject

postCObject
Type
Content Objects (cObject)

appended the content.

wrapAlign

wrapAlign
Type
string / stdWrap
Allowed values
left, center, right

Wraps content with <div style=text-align:[*value*];"> | </div> if align is set.

typolink

Type
typolink / stdWrap

Wraps the content with a link tag.

wrap

wrap
Type
wrap /+.splitChar / stdWrap

splitChar defines an alternative splitting character (default is "|" - the vertical line)

noTrimWrap

noTrimWrap
Type
"special" wrap /+.splitChar / stdWrap

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

Additional property:

splitChar

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

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.noTrimWrap = | val1 | val2 |
Copied!

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

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10 {
   noTrimWrap = ^ val1 ^ val2 ^ || ^ val3 ^ val4 ^
   noTrimWrap.splitChar = ^
}
Copied!

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

wrap2

wrap2
Type
wrap /+.splitChar / stdWrap

same as (but watch the order in which they are executed)

dataWrap

dataWrap
Type
mixed / stdWrap

The content is parsed for pairs of curly braces. The content of the curly braces is of the type Data / getText and is substituted with the result of Data / getText.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.dataWrap = <div id="{tsfe : id}"> | </div>
Copied!

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

prepend

prepend
Type
Content Objects (cObject)

prepended to content (before)

append

append
Type
Content Objects (cObject)

appended to content (after)

wrap3

wrap3
Type
wrap /+.splitChar / stdWrap

same as wrap (but watch the order in which they are executed)

orderedStdWrap

orderedStdWrap
Type
Array of numeric keys with / stdWrap each

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.

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
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;
}
Copied!

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

outerWrap
Type
wrap / stdWrap

Wraps the complete content

insertData

insertData
Type
boolean / stdWrap

If set, then the content string is parsed like dataWrap above.

Examples

Displays the page title:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = This is the page title: {page:title}
10.stdWrap.insertData = 1

# TEXT is already stdWrapable, so we can also use insertData right away
20 = TEXT
20.value = <link rel="preload" href="{path : EXT:site/Resources/Public/Fonts/Roboto.woff2}" as="font" type="font/woff2" crossorigin="anonymous">
20.insertData = 1
Copied!

postUserFunc

postUserFunc
Type
function name

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.

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page = PAGE
page.typeNum = 0

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

page.20 = TEXT
page.20 {
    value = Hello World!
    stdWrap.postUserFunc = MyVendor\SitePackage\UserFunctions\YourClass->reverseString
    stdWrap.postUserFunc.uppercase = 1
    stdWrap.postUserFunc.typolink = 11
}
Copied!

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

EXT:site_package/Classes/UserFunctions/YourClass.php
<?php

declare(strict_types=1);

namespace MyVendor\SitePackage\UserFunctions;

use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

final class YourClass
{
    /*
     * Reference to the parent (calling) cObject set from TypoScript
     */
    private ContentObjectRenderer $cObj;

    public function setContentObjectRenderer(
        ContentObjectRenderer $cObj,
    ): void {
        $this->cObj = $cObj;
    }

    /**
     * Custom method for data processing. Also demonstrates
     * how this gives us the ability to use methods in the
     * parent object.
     *
     * @param string $content holds the value to be processed.
     * @param array $conf TypoScript properties passed to this method.
     */
    public function reverseString(
        string $content,
        array $conf,
        ServerRequestInterface $request,
    ): string {
        $content = strrev($content);
        if (isset($conf['uppercase']) && $conf['uppercase'] === '1') {
            // Use the method caseshift() from ContentObjectRenderer
            $content = $this->cObj->caseshift($content, 'upper');
        }
        if (isset($conf['typolink'])) {
            // Use the method typoLink() from ContentObjectRenderer
            $content = $this->cObj
                ->typoLink($content, ['parameter' => $conf['typolink']]);
        }
        return $content;
    }
}
Copied!

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="/path/to/page/id/11">!DLROW OLLEH</a>.

Note how in the second example $this->cObj, the reference to the calling cObject, is utilised to use functions from ContentObjectRenderer class!

postUserFuncInt

postUserFuncInt
Type
function name

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

prefixComment
Type
string / stdWrap

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 .

Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
prefixComment = 2 | CONTENT ELEMENT, uid:{field:uid}/{field:CType}
Copied!

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

Properties for sanitizing and caching data

Name Type
boolean / array with key "build"
cache

htmlSanitize

htmlSanitize
Type
boolean / array with key "build"

The property controls the sanitization and removal of XSS from markup. It strips tags, attributes and values that are not explicitly allowed.

  • htmlSanitize = [boolean]: whether to invoke sanitization (enabled per default when invoked via stdWrap.parseFunc).
  • htmlSanitize.build = [string]: defines which specific builder (must be an instance of \TYPO3\HtmlSanitizer\Builder\BuilderInterface) to be used for building a \TYPO3\HtmlSanitizer\Sanitizer instance using a particular \TYPO3\HtmlSanitizer\Behavior. This can either be a fully qualified class name or the name of a preset as defined in $GLOBALS['TYPO3_CONF_VARS']['SYS']['htmlSanitizer'] - per default, \TYPO3\CMS\Core\Html\DefaultSanitizerBuilder is used.
Examples
EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10 {
    value = <div><img src="invalid.file" onerror="alert(1)"></div>
    htmlSanitize = 1
}
Copied!

will result in the following output:

<div><img src="invalid.file"></div>
Copied!

The following code is equivalent to above, but with a builder specified:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10 {
    value = <div><img src="invalid.file" onerror="alert(1)"></div>
    htmlSanitize = 1
    // Use either "default" for the default builder
    htmlSanitize.build = default
    // or use the full class name of the default builder
    // htmlSanitize.build = TYPO3\CMS\Core\Html\DefaultSanitizerBuilder
}
Copied!

cache

cache
Type
cache

Caches rendered content in the caching framework.

Properties for debugging data

debug

debug
Type
boolean / stdWrap

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.

debugFunc

debugFunc
Type
boolean / stdWrap

Prints the content directly to browser with the debug() function.

Set to value "2" the content will be printed in a table which looks nicer.

debugData

debugData
Type
boolean / stdWrap

Prints the current data-array, $cObj->data, directly to browser. This is where field gets data from.

Example

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = some text
10.stdWrap.case = upper
Copied!

Here the content of the object "10" is upper-cased before it is returned.

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.

Properties

length

length

length
Type
integer / stdWrap
Default
0

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.

padWith

padWith

padWith
Type
string / stdWrap
Default
(space character)

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.

type

type

type
Type
(list of keywords) / stdWrap
Default
right

The side(s) of the input value, on which the padding should be added. Possible keywords are "left", "right" or "both".

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
# The input value is 34 signs long.
10.value = TYPO3 - inspiring people to share.
10.value.strPad {
     length = 37
     padWith = =
     type = both
}
Copied!

This results in "=TYPO3 - inspiring people to share.==".

tags

Used to create custom tags and define how they should be parsed. This is used in conjunction with parseFunc.

The best known is the "link" tag, which is used to create links.

Properties

(array of strings)

array of strings

array of strings
Type
Content Objects (cObject)

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

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
EXT:site_package/Configuration/TypoScript/setup.typoscript
tags.bold = TEXT
tags.bold {
    stdWrap.current = 1
    stdWrap.wrap = <p style="font-weight: bold;"> | </p>
}
tags.bold.stdWrap.stripNL = 1
Copied!

This example would e.g. transform <BOLD>Important!</BOLD> to <p style="font-weight: bold;">Important!</p>.

Example

This example creates 4 custom tags. The <LINK>-, <TYPOLIST>-, <GRAFIX>- and <PIC>-tags:

<LINK> is made into a typolink and provides an easy way of creating links in text.

<TYPOLIST> is used to create bullet-lists.

<GRAFIX> will create an image file with 90x10 pixels where the text is the content of the tag.

<PIC> lets us place an image in the text. The content of the tag should be the image-reference in fileadmin/images/.

EXT:site_package/Configuration/TypoScript/setup.typoscript
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
}
Copied!

Wrap

wrap

wrap
Syntax

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

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

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

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

A wrap is applied as one of the last of properties a cObject.

Examples

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

EXT:site_package/Configuration/TypoScript/setup.typoscript
page.10.wrap = <p class="bg-red"> | </p>
Copied!

Conditions

Frontend TypoScript conditions offer a way to conditionally change TypoScript based on current context. Do not confuse conditions with the "if" function, which is a stdWrap property to act on current data.

The Symfony expression language tends to throw warnings when sub-arrays are checked in a condition that do not exist. Use the traverse function to avoid this.

applicationContext

applicationContext

applicationContext
Type
String

The current application context as a string. See Application context.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[applicationContext == "Development"]
    # ...
[END]

# Any context that is "Production" or starts with "Production"
# (for example, Production/Staging").
[applicationContext matches "/^Production/"]
    # ...
[END]
Copied!

page

page

page
Type
Array

All data of the current page record as array.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Check single page UID
[traverse(page, "uid") == 2]
    # ...
[END]

# Check list of page UIDs
[traverse(page, "uid") in [17,24]]
    # ...
[END]

# Check list of page UIDs NOT in
[traverse(page, "uid") not in [17,24]]
    # ...
[END]

# Check range of pages (example: page UID from 10 to 20)
[traverse(page, "uid") in 10..20]
    # ...
[END]

# Check the page backend layout
[traverse(page, "backend_layout") == 5]
    # ...
[END]
[traverse(page, "backend_layout") == "example_layout"]
    # ...
[END]

# Check the page title
[traverse(page, "title") == "foo"]
    # ...
[END]
Copied!

tree

tree

tree
Type
Object

Object with tree information.

tree.level

tree.level

tree.level
Type
Integer

The current tree level.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Check, if the page is on level 0:
[tree.level == 0]
    # ...
[END]
Copied!

tree.pagelayout

tree.pagelayout

tree.pagelayout
Type
Integer / String

Check for the defined backend layout of a page, including the inheritance of the field Backend Layout (subpages of this page).

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Using backend layout records
[tree.pagelayout === "2"]
    # ...
[END]

# Using the TSconfig provider of backend layouts
[tree.pagelayout === "pagets__Home"]
    # ...
[END]

# Using backend layout records multiple
[tree.pagelayout in ['2','3','4','5']]
    # ...
[END]
Copied!

tree.rootLine

tree.rootLine

tree.rootLine
Type
Array

Array of arrays with UID and PID.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[tree.rootLine[0]["uid"] == 1]
    # ...
[END]
Copied!

tree.rootLineIds

tree.rootLineIds

tree.rootLineIds
Type
Array

An array with UIDs of the root line.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Check, if page with uid 2 is inside the root line
[2 in tree.rootLineIds]
    # ...
[END]
Copied!

tree.rootLineParentIds

tree.rootLineParentIds

tree.rootLineParentIds
Type
Array

An array with parent UIDs of the root line.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Check, if the page with UID 2 is the parent of a page inside the root line
[2 in tree.rootLineParentIds]
    # ...
[END]
Copied!

backend

backend

backend
Type
Object

Object with backend information.

backend.user

backend.user

backend.user
Type
Object

Object with current backend user information.

backend.user.isAdmin

backend.user.isAdmin

backend.user.isAdmin
Type
Boolean

True, if the current backend user is administrator.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Evaluates to true, if the current backend user is administrator
[backend.user.isAdmin]
    # ...
[END]
Copied!

backend.user.isLoggedIn

backend.user.isLoggedIn

backend.user.isLoggedIn
Type
Boolean

True, if the current backend user is logged in.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Evaluates to true, if a backend user is logged in
[backend.user.isLoggedIn]
    # ...
[END]
Copied!

backend.user.userId

backend.user.userId

backend.user.userId
Type
Integer

UID of the the current backend user.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Evaluates to true, if the user UID of the current logged-in backend
# user is equal to 5
[backend.user.userId == 5]
    # ...
[END]
Copied!

backend.user.userGroupIds

backend.user.userGroupIds

backend.user.userGroupIds
Type
Array
Context
Frontend, backend

Array of user group IDs assigned to the current backend user.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[2 in backend.user.userGroupIds]
    # ...
[END]
Copied!

backend.user.userGroupList

backend.user.userGroupList

backend.user.userGroupList
Type
String

Comma-separated list of group UIDs.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[like(","~backend.user.userGroupList~",", "*,1,*")]
    # ...
[END]
Copied!

frontend

frontend

frontend
Type
Object

Object with frontend information.

frontend.user

frontend.user

frontend.user
Type
Object

Object with current frontend user information.

frontend.user.isLoggedIn

frontend.user.isLoggedIn

frontend.user.isLoggedIn
Type
Boolean

True, if the current frontend user is logged in.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[frontend.user.isLoggedIn]
    # ...
[END]
Copied!

frontend.user.userId

frontend.user.userId

frontend.user.userId
Type
Integer

The UID of the current frontend user.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[frontend.user.userId == 5]
    # ...
[END]
Copied!

frontend.user.userGroupIds

frontend.user.userGroupIds

frontend.user.userGroupIds
Type
Array
Context
Frontend

Array of user group IDs of the current frontend user.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[4 in frontend.user.userGroupIds]
    # ...
[END]
Copied!

frontend.user.userGroupList

frontend.user.userGroupList

frontend.user.userGroupList
Type
String

Comma-separated list of group UIDs.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[like(","~frontend.user.userGroupList~",", "*,1,*")]
    # ...
[END]
Copied!

workspace

workspace

workspace
Type
Object

Object with workspace information.

workspace.workspaceId

workspace.workspaceId

workspace.workspaceId
Type
Integer

UID of the current workspace.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Check, if in live workspace
[workspace.workspaceId == 0]
    # ...
[END]
Copied!

workspace.isLive

workspace.isLive

workspace.isLive
Type
Boolean

True, if the current workspace is the live workspace.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[workspace.isLive]
    # ...
[END]
Copied!

workspace.isOffline

workspace.isOffline

workspace.isOffline
Type
Boolean

True, if the current workspace is offline.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[workspace.isOffline]
    # ...
[END]
Copied!

typo3

typo3

typo3
Type
Object

Object with TYPO3-related information.

typo3.version

typo3.version

typo3.version
Type
String

TYPO3_version (for example, 13.4.0)

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[typo3.version == "13.4.0"]
    # ...
[END]
Copied!

typo3.branch

typo3.branch

typo3.branch
Type
String

TYPO3 branch (for example, 13.4)

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[typo3.branch == "13.4"]
    # ...
[END]
Copied!

typo3.devIpMask

typo3.devIpMask

typo3.devIpMask
Type
String

$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[typo3.devIpMask == "172.18.0.6"]
    # ...
[END]
Copied!

date()

date()

date()
Parameter

String

type

String | Integer

Get the current date in the given format. See the PHP date function as a reference for the possible usage.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# True, if the day of the current month is 7
[date("j") == 7]
    # ...
[END]

# True, if the day of the current week is 7
[date("w") == 7]
    # ...
[END]

# True, if the day of the current year is 7
[date("z") == 7]
    # ...
[END]

# True, if the current hour is 7
[date("G") == 7]
    # ...
[END]
Copied!

like()

like()

like()
Parameter

String, String

type

Boolean

This function has two parameters: The first parameter is the string to search in, the second parameter is the search string.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Search a string with * within another string
[like("fooBarBaz", "*Bar*")]
    # ...
[END]

# Search string with single characters in between, using ?
[like("fooBarBaz", "f?oBa?Baz")]
    # ...
[END]

# Search string using regular expression
[like("fooBarBaz", "/f[o]{2,2}[aBrz]+/")]
    # ...
[END]
Copied!

traverse()

traverse()

traverse()
Parameter

Array, String

type

Mixed

This function gets a value from an array with arbitrary depth and suppresses a PHP warning when sub-arrays do not exist. It has two parameters: The first parameter is the array to traverse, the second parameter is the path to traverse.

In case the path is not found in the array, an empty string is returned.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Traverse query parameters of current request along tx_news_pi1[news]
[request && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0]
Copied!

compatVersion()

compatVersion()

compatVersion()
Parameter

String

type

Boolean

Compares against the current TYPO3 branch.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# True, if the current TYPO3 version is 13.4.x
[compatVersion("13.4")]
    # ...
[END]

# True, if the current TYPO3 version is 13.4.0
[compatVersion("13.4.0")]
    # ...
[END]
Copied!

getTSFE()

getTSFE()

getTSFE()
Type
Object

Provides access to TypoScriptFrontendController $GLOBALS['TSFE'] . This function can directly access methods of TypoScriptFrontendController. This class is target of a mid-term refactoring. It should be used with care since it will eventually vanish in the future.

Using the getTSFE() function, developers have to ensure that "TSFE" is available before accessing its properties. A missing "TSFE", for example, in backend context, does no longer automatically evaluate the whole condition to false. Instead, the function returns null, which can be checked using either [getTSFE() && getTSFE().id == 17] or the null-safe operator [getTSFE()?.id == 17].

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# True, if the current page UID is 17. Use the page variable instead
[getTSFE()?.id == 17]
Copied!

getenv()

getenv()

getenv()
Type
String

PHP function getenv.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[getenv("VIRTUAL_HOST") == "www.example.org"]
    # ...
[END]
Copied!

feature()

feature()

feature()
Type
String

Provides access to the current state of feature toggles.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# True, if the feature toggle for enforcing the Content Security Policy
# in the frontend is enabled
[feature("security.frontend.enforceContentSecurityPolicy") === true]
    # ...
[END]
Copied!

ip()

Changed in version 13.0

This function is only available in TypoScript frontend context. For migration hints see the changelog.

ip()

ip()
Parameter

String

type

Boolean

Value or constraint, wildcard or regular expression possible; special value: "devIP" (matches the devIPmask).

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[ip("172.18.*")]
    page.10.value = Your IP matches "172.18.*"
[END]

[ip("devIP")]
    page.10.value = Your IP matches the configured devIp
[END]
Copied!

request()

request()

request()
Type
Mixed

Allows to fetch information from current request.

request.getQueryParams()

request.getQueryParams()

request.getQueryParams()
Type
Array

Allows to access GET parameters from current request.

Assuming the following query within URL:

route=%2Fajax%2Fsystem-information%2Frender&token=5c53e9b715362e7b0c3275848068133b89bbed77&skipSessionUpdate=1

then the following array would be provided:

Key: route
Value: /ajax/system-information/render
Key: token
Value: 5c53e9b715362e7b0c3275848068133b89bbed77
Key: skipSessionUpdate
Value: 1

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Safely check the query parameter array to avoid error logs in case key
# is not defined. This will check if the GET parameter
# tx_news_pi1[news] in the URL is greater than 0:
[request && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0]
    # ...
[END]
Copied!

request.getParsedBody()

request.getParsedBody()

request.getParsedBody()
Type
Array

Provide all values contained in the request body, for example, in case of submitted form via POST, the submitted values.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[request && traverse(request.getParsedBody(), 'foo') == 1]
    # ...
[END]
Copied!

request.getHeaders()

request.getHeaders()

request.getHeaders()
Type
Array

Provide all values from request headers.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[request && request.getHeaders()['Accept'] == 'json']
    page.10.value = Accepts json
[END]

[request && request.getHeaders()['host'][0] == 'www.example.org']
    page.20.value = The host is www.example.org
[END]
Copied!

request.getCookieParams()

request.getCookieParams()

request.getCookieParams()
Type
Array

Provides available cookies.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[request && request.getCookieParams()['foo'] == 1]
    # ...
[END]
Copied!

request.getNormalizedParams()

request.getNormalizedParams()

request.getNormalizedParams()
Type
Array

Provides access to the \TYPO3\CMS\Core\Http\NormalizedParams object. Have a look at the normalized parameters of the request object for a list of the available methods.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[request && request.getNormalizedParams().isHttps()]
    page.10.value = HTTPS is being used
[END]

[request && request.getNormalizedParams().getHttpHost() == "example.org"]
    page.10.value = The host is "example.org"
[END]
Copied!

request.getPageArguments()

request.getPageArguments()

request.getPageArguments()
Type
Object

Get the current \TYPO3\CMS\Core\Routing\PageArguments object with the resolved route parts from enhancers.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[request && request.getPageArguments().get('foo_id') > 0]
    # ...
[END]

# True, if current page type is 98
[request && request.getPageArguments()?.getPageType() == 98]
    # ...
[END]
Copied!

session()

session()

session()
Parameter

String

type

Mixed

Allows to access values of the current session. Available values depend on values written to the session, for example, by extensions. Use | to dig deeper into the structure for stored values.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Match, if the session has the value 1234567 in the structure :php:`$foo['bar']`:
[session("foo|bar") == 1234567]
    # ...
[END]
Copied!

site()

site()

site()
Parameter

String

type

Mixed

Get a value from the site configuration, or null, if no site was found or the property does not exists.

Available information:

site("identifier")
Returns the identifier of the current site as a string.
site("base")
Returns the base of the current site as a string.
site("rootPageId")
Returns the root page UID of the current site as an integer.
site("languages")
Returns an array of the available languages for the current site. For deeper information, see siteLanguage().
site("allLanguages")
Returns an array of available and unavailable languages for the current site. For deeper information, see siteLanguage().
site("defaultLanguage")
Returns the default language for the current site. For deeper information, see siteLanguage().
site("configuration")
Returns an array with the available configuration for the current site.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# Site identifier
[site("identifier") == "my_site"]
    # ...
[END]

# Match site base host
[site("base").getHost() == "www.example.org"]
    # ...
[END]

# Match base path
[site("base").getPath() == "/"]
    # ...
[END]

# Match root page UID
[site("rootPageId") == 1]
    # ...
[END]

# Match a configuration property
[traverse(site("configuration"), "myCustomProperty") == true]
    # ...
[END]
Copied!

Site settings can also be used in the conditions in TypoScript constants:

EXT:site_package/Configuration/TypoScript/constants.typoscript
my.constant = my global value
[traverse(site('configuration'), 'settings/some/setting') == 'someValue']
  my.constant = another value, if condition matches
[global]
Copied!

siteLanguage()

siteLanguage()

siteLanguage()
Parameter

String

type

Mixed

Get a value from the site language configuration, or null if no site was found or property not exists.

Available information:

siteLanguage("languageId")
Returns the language ID as an integer.
siteLanguage("locale")
Returns the current locale as a string, for example en-GB or de-DE.
siteLanguage("base")
Returns the configured base URL as a string.
siteLanguage("title")
Returns the internal human-readable name for this language as a string.
siteLanguage("navigationTitle")
Returns the navigation title as a string.
siteLanguage("flagIdentifier")
Returns the flag identifier as a string, for example gb.
siteLanguage("typo3Language")
Returns the language identifier used in TYPO3 XLIFF files as a string, for example default or the two-letter language code.
siteLanguage("hreflang")
Returns the language information for the hreflang tag as a string.
siteLanguage("fallbackType")
Returns the language fallback mode as a string, one of fallback, strict or free.
siteLanguage("fallbackLanguageIds")
Returns the list of fallback languages as a string, for example 1,0.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
[siteLanguage("locale") == "de-CH"]
    page.10.value = This site has the locale "de_CH" or "de_CH.utf8"
[END]

[siteLanguage("title") == "Italy"]
    page.10.value = This site has the title "Italy"
[END]
Copied!

loginUser()

Changed in version 13.0

usergroup()

Changed in version 13.0

Examples

Check if a constant is set to a certain value

TypoScript constants can be used in conditions with the Syntax for conditions:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
[{$tx_my_extension.settings.feature1Enabled} == 1]
    page.10.value = The feature 1 of my_extension is enabled.
[ELSE]
    page.10.value = The feature 1 of my_extension is not enabled.
[END]
Copied!

Compare constant with strict types

All constants are by default string. But as constants were replaced before expression check, numeric values will interpreted as integer if they were not wrapped into quotes. This may lead to miss-understanding while using strict type comparison === in expressions. See following examples:

Without using strict type comparison following two examples are true if constant is set to 1:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
[{$tx_my_extension.settings.feature1Enabled} == 1]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!
EXT:my_extension/Configuration/TypoScript/setup.typoscript
[{$tx_my_extension.settings.feature1Enabled} == "1"]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!

In case of using strict type comparison only the next upper example is true. That's because the stored number of the constant was not wrapped with quotes and was therefor interpreted as integer.

EXT:my_extension/Configuration/TypoScript/setup.typoscript
[{$tx_my_extension.settings.feature1Enabled} === 1]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!
EXT:my_extension/Configuration/TypoScript/setup.typoscript
[{$tx_my_extension.settings.feature1Enabled} === "1"]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!

Compare constant against strings

All constants are by default string. As they are replaced with their contained value before expression check, you have to wrap them into quotes to prevent interpreting the values as integer or float.

Following condition is always false:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
[{$tx_my_extension.settings.feature1Enabled} == "active"]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!

If you are working with strings in conditions please do it that way:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
["{$tx_my_extension.settings.feature1Enabled}" == "active"]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!

Sure, strict type string comparisons are also working:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
["{$tx_my_extension.settings.feature1Enabled}" === "active"]
    page.10.value = The feature 1 of my_extension is enabled.
[END]
Copied!

Use constants with reserved keywords

As explained, above constants were replaced with their values before they are processed by expression language. That allows experimental structures: If {$foo} is set to the reserved page array and page title is Home following condition is true:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
[traverse({$foo}, "title") == "Home"]
    page.10.value (
        Value will be shown if constant is "page" and page title is "Home"
    )
[END]
Copied!

After the replacement of the constant the example will result into:

EXT:my_extension/Configuration/TypoScript/setup.typoscript
[traverse(page, "title") == "Home"]
    page.10.value (
        Value will be shown if constant is "page" and page title is "Home"
    )
[END]
Copied!

Page TSconfig Reference

The page TSconfig primarily concerns configuration of the modules in the TYPO3 backend, the most important section is mod.

The TSconfig for a page is accumulated from the root and extends to cover the whole branch of sub pages as well (unless values are overridden further out).

Note that the page TSconfig can be overridden on a user and group basis by user TSconfig again, for details, see section Overriding page TSconfig in user TSconfig.

colorPalettes

New in version 13.0

TYPO3 provides a color picker component that supports color palettes, or swatches. The colors can be configured and assigned to palettes. This way, for example, colors defined in a corporate design can be selected by a simple click. Multiple color palettes can be configured.

Example of a color palette

Example of a color palette

Basic syntax

First, define the colors by name and RGB value:

EXT:my_sitepackage/Configuration/page.tsconfig
colorPalettes {
  colors {
    typo3 {
      value = #ff8700
    }
    blue {
      value = #0080c9
    }
    darkgrey {
      value = #515151
    }
    valid {
      value = #5abc55
    }
    error {
      value = #dd123d
    }
  }
}
Copied!

Then assign the colors to your palettes:

EXT:my_sitepackage/Configuration/page.tsconfig
colorPalettes {
  palettes {
    main = typo3
    key_colors = typo3, blue, darkgrey
    messages = valid, error
  }
}
Copied!

Now you can assign a color palette to one field, to all fields of a table or as a global configuration, see TCEFORM.colorPalette.

mod

Configuration for backend modules. This is the part of page TSconfig with the most options, most sections affect the main TYPO3 editing modules like Web > Page and Web > List.

Properties

SHARED

colPos_list

colPos_list

colPos_list
Type
comma separated list of integers
Default
''
Path
mod.SHARED.colPos_list

This setting controls which areas or columns of the backend layouts are editable. Columns configured in the Backend Layout, which are not listed here, will be displayed with placeholder area.

The default backend layout only has one column, which has the id 0.

Example: Make a column in a backend layout not editable

Assuming the current page uses the following backend layout:

config/sites/my-site/page.tsconfig
mod.web_layout.BackendLayouts {
    default {
        title = Default
        config {
            backend_layout {
                colCount = 2
                rowCount = 2
                rows {
                    1 {
                        columns {
                            1 {
                                name = Jumbotron
                                colPos = 1
                                identifier = jumbotron
                                slideMode = slide
                                colspan = 2
                            }
                        }
                    }

                    2 {
                        columns {
                            1 {
                                name = Left
                                colPos = 0
                                identifier = left
                            }

                            2 {
                                name = Right
                                colPos = 2
                                identifier = right
                                slideMode = collectReverse
                            }
                        }
                    }
                }
            }
        }
    }
}
Copied!

And we want to make the area "Jumbotron" (colPos = 1) not editable.

As long as colPos_list is empty all areas are allowed. We therefore have to list all colPos, which should still be allowed. In this that would be the columns left (colPos = 0) and right (colPos = 2).

config/sites/my-site/page.tsconfig
mod.SHARED.colPos_list = 0,2
Copied!

defaultLanguageFlag

defaultLanguageFlag

defaultLanguageFlag
Type
string

Country flag shown for the "Default" language in the backend, used in Web > List and Web > Page module. Values as listed in the "Select flag icon" of a language record in the backend are allowed, including the value "multiple".

The flag selector of a language record in the backend

The flag selector of a language record in the backend

Example: Show a German flag on a NullSite

This will show the German flag, and the text "deutsch" on hover.

EXT:site_package/Configuration/page.tsconfig
mod.SHARED {
    defaultLanguageFlag = de
    defaultLanguageLabel = deutsch
}
Copied!

defaultLanguageLabel

defaultLanguageLabel

defaultLanguageLabel
Type
string

Alternate label for "Default" when language labels are shown in the interface.

Used in Web > List and Web > Page module.

disableLanguages

disableLanguages

disableLanguages
Type
string

Comma-separated list of language UIDs which will be disabled in the given page tree.

disableSysNoteButton

disableSysNoteButton

disableSysNoteButton
Type
boolean

Disables the sys_note creation button in the modules' top button bar in the Page, List and Info modules.

web_info

Configuration options of the "Web > Info" module.

fieldDefinitions

fieldDefinitions

fieldDefinitions
Type
array

The available fields in the "Pagetree overview" module under the Info module, by default ship with the entries "Basic settings", "Record overview", and "Cache and age".

Default entries of Pagetree Overview

Default entries of Pagetree Overview

By using page TsConfig it is possible to change the available fields and add additional entries to the select box.

Next to using a list of fields from the pages table you can add counters for records in a given table by prefixing a table name with table_ and adding it to the list of fields.

The string ###ALL_TABLES### is replaced with a list of all table names an editor has access to.

Example: Override the field definitions in the info module

EXT:site_package/Configuration/page.tsconfig
mod.web_info.fieldDefinitions {
    0 {
        # Basic settings
        label = LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:pages_0
        fields = title,uid,slug,alias,starttime,endtime,fe_group,target,url,shortcut,shortcut_mode
    }
    1 {
        # Record overview
        label = LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:pages_1
        fields = title,uid,###ALL_TABLES###
    }
    2 {
        # Cache and age
        label = LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:pages_2
        fields = title,uid,table_tt_content,table_fe_users
    }
}
Copied!

web_layout

Configuration options of the "Web > Page" module.

allowInconsistentLanguageHandling

allowInconsistentLanguageHandling

allowInconsistentLanguageHandling
Type
boolean

By default, TYPO3 will not allow you to mix translated content and independent content in the page module. Content elements violating this behavior will be marked in the page module and there is no UI control (yet) allowing you to create independent content elements in a given language.

If you want to go back to the old, inconsistent behavior, you can toggle it back on using this switch.

Example: Allow inconsistent language modes

Allows to set TYPO3s page module back to inconsistent language mode

EXT:site_package/Configuration/page.tsconfig
mod.web_layout.allowInconsistentLanguageHandling = 1
Copied!

BackendLayouts

BackendLayouts

BackendLayouts
Type
array
no-index
1

Backend Layouts were initially introduced in order to customize the view of the Page module in TYPO3 Backend for a page, but has then since grown also in Frontend rendering to select for example Fluid template files via TypoScript for a page, commonly used via data:pagelayout.

See also the dedicated chapter Backend layouts.

Example: Define a backend layout

EXT:site_package/Configuration/page.tsconfig
mod.web_layout.BackendLayouts {
    exampleKey {
        title = Example
        icon = EXT:example_extension/Resources/Public/Images/BackendLayouts/default.gif
        config {
            backend_layout {
                colCount = 1
                rowCount = 2
                rows {
                    1 {
                        columns {
                            1 {
                                name = LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:colPos.I.3
                                colPos = 3
                                colspan = 1
                            }
                        }
                    }
                    2 {
                        columns {
                            1 {
                                name = Main
                                colPos = 0
                                colspan = 1
                                identifier = main
                            }
                        }
                    }
                }
            }
        }
    }
}
Copied!

defaultLanguageLabel

defaultLanguageLabel

defaultLanguageLabel
Type
string

Alternate label for "Default" when language labels are shown in the interface.

Overrides the same property from mod.SHARED if set.

defLangBinding

defLangBinding

defLangBinding
Type
boolean
Default
0

If set, translations of content elements are bound to the default record in the display. This means that within each column with content elements any translation found for exactly the shown default content element will be shown in the language column next to.

This display mode should be used depending on how the frontend is configured to display localization. The frontend must display localized pages by selecting the default content elements and for each one overlay with a possible translation if found.

hideRestrictedCols

hideRestrictedCols

hideRestrictedCols
Type
boolean
Default
false

If activated, only columns will be shown in the backend that the editor is allowed to access. All columns with access restriction are hidden in that case.

By default columns with restricted access are rendered with a message telling that the user doesn't have access. This may be useless and distracting or look repelling. Instead, all columns an editor doesn't have access to can be hidden:

EXT:site_package/Configuration/page.tsconfig
mod.web_layout.hideRestrictedCols = 1
Copied!

localization.enableCopy

localization.enableCopy

localization.enableCopy
Type
boolean
Default
1

Enables the creation of copies of content elements into languages in the translation wizard ("free mode").

Example: Disable free mode button for localization

EXT:site_package/Configuration/page.tsconfig
mod.web_layout {
    localization.enableCopy = 0
}
Copied!

localization.enableTranslate

localization.enableTranslate

localization.enableTranslate
Type
boolean
Default
1

Enables simple translations of content elements in the translation wizard ("connected mode").

Example: Disable "connected mode" button for translation

EXT:site_package/Configuration/page.tsconfig
mod.web_layout {
    localization.enableTranslate = 0
}
Copied!

tt_content.preview

tt_content.preview

tt_content.preview
Type
boolean

It is possible to render previews of your own content elements in the page module. By referencing a Fluid template you can create a visual representation of your content element, making it easier for an editor to understand what is going on on the page.

The syntax is as follows:

EXT:site_package/Configuration/page.tsconfig
mod.web_layout.tt_content.preview.[CTYPE].[list_type value] = EXT:site_mysite/Resources/Private/Templates/Preview/ExamplePlugin.html
Copied!

This way you can even switch between previews for your plugins by supplying list as CType.

Example: Define previews for custom content elements

EXT:site_package/Configuration/page.tsconfig
mod.web_layout.tt_content {
    preview.custom_ce = EXT:site_mysite/Resources/Private/Templates/Preview/CustomCe.html
    preview.table = EXT:site_mysite/Resources/Private/Templates/Preview/Table.html
    preview.list.tx_news = EXT:site_mysite/Resources/Private/Templates/Preview/TxNews.html
}
Copied!

Backend layouts

Backend layouts were initially introduced in order to customize the view of the Page module in TYPO3 Backend for a page, but has then since grown also in Frontend rendering to select for example Fluid template files via TypoScript for a page, commonly used via data:pagelayout.

A page module with a backend layout that has 3 content areas.

Backend layouts are organized in rows and columns. Content areas can span multiple rows and or columns. They cannot be nested. For nested layouts in the backend use an extension like b13/container .

The page TSconfig for the backend layout above can be found in the site package tutorial: Create the backend page layouts.

For extended examples have a look at the predefined backend layouts of the bootstrap package (GitHub).

BackendLayouts.[backendLayout]

BackendLayouts.[backendLayout]
Type
array
Path
mod.web_layout.BackendLayouts

title

title
Type
string or language identifier

The title of the backend layout. It will be displayed in the page properties in the backend.

icon

icon
Type
string, extension path to an image file

The icon to be displayed in the page properties.

EXT:bootstrap_package/Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts/subnavigation_right_2_columns.tsconfig
mod.web_layout.BackendLayouts.subnavigation_right_2_columns {
    icon = EXT:bootstrap_package/Resources/Public/Icons/BackendLayouts/subnavigation_right_2_columns.svg
}
Copied!

config.backend_layout

config.backend_layout

colCount

colCount
Type
integer

Total number of columns in the backend layout.

rowCount

rowCount
Type
integer

Total number of rows in the backend layout.

rows.[row].columns.[col]

rows.[row].columns.[col]

name

name
Type
string or language identifier

Name of the input area where content elements can be added. Will be displayed in the Page module.

colPos

colPos
Type
integer, 0 - maxInt

When content elements are added to this area, the value of colPos

identifier

identifier
Type
string

An identifier that can be used by the page content DataProcessor to identify the content elements within this area.

It is a speaking representation for the colPos, such as "main", "sidebar" or "footerArea".

slideMode

slideMode
Type
string, "" (empty string), "slide", "collect", "collectReverse"

An identifier that can be used by the page content DataProcessor to identify the content elements within this area.

slide
If no content is found, check the parent pages for more content
collect
Use all content from this page, and the parent pages as one collection
collectReverse
Same as "collect" but in the opposite order

colspan

colspan
Type
integer, 1 - colCount

Can be used if the content element area should span multiple columns as for the "Jumbotron" example in the example above.

rowspan

rowspan
Type
integer, 1 - rowCount

Can be used if the content element area should span multiple rows.

Example: Use a backend layout in the page content data processor

Define the backend layout via page TSconfig, for example in the site:

config/sites/my-site/page.tsconfig
mod.web_layout.BackendLayouts {
    default {
        title = Default
        config {
            backend_layout {
                colCount = 2
                rowCount = 2
                rows {
                    1 {
                        columns {
                            1 {
                                name = Jumbotron
                                colPos = 1
                                identifier = jumbotron
                                slideMode = slide
                                colspan = 2
                            }
                        }
                    }

                    2 {
                        columns {
                            1 {
                                name = Left
                                colPos = 0
                                identifier = left
                            }

                            2 {
                                name = Right
                                colPos = 2
                                identifier = right
                                slideMode = collectReverse
                            }
                        }
                    }
                }
            }
        }
    }
}
Copied!

Configure the output via TypoScript, using the content object PAGEVIEW and the DataProcessor page-content.

config/sites/my-site/setup.typoscript
page = PAGE
page {
    10 = PAGEVIEW
    10 {
        paths.10 = EXT:my_sitepackage/Resources/Private/Templates/
        dataProcessing.10 = page-content
        dataProcessing.10.as = myContent
    }
}
Copied!

Use the identifiers of the columns in the Fluid template:

EXT:my_sitepackage/Resources/Private/Templates/Pages/Default.html
<f:render partial="Jumbotron" arguments="{jumbotronContent: myContent.jumbotron}"/>
<main>
    <f:for each="{myContent.left.records}" as="contentElement">
        <f:cObject typoscriptObjectPath="tt_content.{contentElement.data.CType}"
            data="{contentElement.data}"
            table="tt_content"
        />
    </f:for>
</main>
<aside>
    <f:render partial="Aside" arguments="{content: myContent.right}"/>
</aside>
Copied!

web_list

Configuration options of the "Web > List" module.

allowedNewTables

allowedNewTables

allowedNewTables
Type
list of table names

If this list is set, then only tables listed here will have a link to "create new" in the page and sub pages. This also affects the "Create new record" content element wizard.

This is the opposite of deniedNewTables property.

Example: Only allow records of type pages or sys_category in the new record wizard

EXT:site_package/Configuration/page.tsconfig
mod.web_list {
    # Only pages and sys_category table elements will be linked to in the new record wizard
    allowedNewTables = pages, sys_category
}
Copied!
The New record screen after modifying the allowed elements

The New record screen after modifying the allowed elements

clickTitleMode

clickTitleMode

clickTitleMode
Type
string
Default
edit

Keyword which defines what happens when a user clicks a record title in the list.

The following values are possible:

edit
Edits record
info
Shows information
show
Shows page in the frontend

csvDelimiter

csvDelimiter

csvDelimiter
Type
string
Default
,

Defines the default delimiter for CSV downloads (Microsoft Excel expects ; to be set). The value set will be displayed as default delimiter in the download dialog in the list module.

Example: Use semicolon as delimiter CSV downloads

EXT:examples/Configuration/TsConfig/Page/Mod/csvExport.tsconfig
mod.web_list {
   csvDelimiter = ;
   csvQuote = '
}
Copied!

csvQuote

csvQuote

csvQuote
Type
string
Default
"

Defines the default quoting character for CSV downloads. The value set will be displayed as default quoting in the download dialog in the list module.

Example: Use single quotes as quoting character for CSV downloads

EXT:examples/Configuration/TsConfig/Page/Mod/csvExport.tsconfig
mod.web_list {
   csvDelimiter = ;
   csvQuote = '
}
Copied!

deniedNewTables

deniedNewTables

deniedNewTables
Type
list of table names

If this list is set, then the tables listed here won't have a link to "create new record" in the page and sub pages. This also affects the "Create new record" content element wizard.

This is the opposite of allowedNewTables property.

If allowedNewTables and deniedNewTables contain a common subset, deniedNewTables takes precedence.

disableSearchBox

disableSearchBox

disableSearchBox
Type
boolean

If set, the checkbox "Show search" in the list module is hidden.

disableSingleTableView

disableSingleTableView

disableSingleTableView
Type
boolean

If set, then the links on the table titles which shows a single table listing will not be available - including sorting links on columns titles, because these links jumps to the table-only view.

displayColumnSelector

displayColumnSelector

displayColumnSelector
Type
boolean
Default
true

The column selector is enabled by default and can be disabled with this option. The column selector is displayed at the top of each record list in the List module. It can be used to compare different fields of the listed records.

Example: Hide the column selector

EXT:site_package/Configuration/page.tsconfig
mod.web_list.displayColumnSelector = 0
Copied!

downloadPresets

downloadPresets.[table]

downloadPresets.[table]
Type
array of presets

New in version 13.2

A new function has been introduced that makes it possible to select the data columns to be exported from a list of configurable presets.

This property adds presets of preselected fields to the download area in the Web > List backend module.

Those presets can be configured via page TSconfig, and can also be overridden via user TSconfig (for example, to expand certain presets only to specific users).

Each entry of mod.web_list.downloadPresets defines the table name on the first level, followed by any number of presets.

Each preset contains a label (the displayed name of the preset, which can be a locallang key), a comma-separated list of each column that should be included in the export as columns and optionally an identifier. In case identifier is not provided, the identifier is generated as hash of the label and columns.

Since any table can be configured for a preset, any extension can deliver a defined set of presets through the EXT:my_extension/Configuration/page.tsconfig file and their table name(s).

Additionally, the list of presets can be manipulated via the PSR-14 event TYPO3CMSBackendRecordListEventBeforeRecordDownloadPresetsAreDisplayedEvent.

Example: Create download presets for table page

EXT:my_extension/Configuration/page.tsconfig
mod.web_list.downloadPresets {
    pages {
        minimum {
            label = Quick overview
            columns = uid, title, crdate, slug
        }

        fullExport {
            identifier = uid-title
            label = LLL:EXT:myext/Resources/Private/Language/locallang.xlf:preset2.label
            columns = uid, title
        }
    }
}
Copied!

This can be manipulated with user TSconfig by adding the page. prefix. User TSconfig is loaded after page TSconfig, so you can overwrite the existing default settings using the same TypoScript path.

EXT:my_extension/Configuration/user.tsconfig
mod.web_list.downloadPresets {
    pages {
        minimum {
            label = Quick overview
            columns = uid, title, crdate, slug
        }

        fullExport {
            identifier = uid-title
            label = LLL:EXT:myext/Resources/Private/Language/locallang.xlf:preset2.label
            columns = uid, title
        }
    }
}
Copied!

enableClipBoard

enableClipBoard

enableClipBoard
Type
list of keywords
Default
selectable

Determines whether the checkbox "Show clipboard" in the list module is shown or hidden. If it is hidden, you can predefine it to be always activated or always deactivated.

The following values are possible:

activated
The option is activated and the checkbox is hidden.
deactivated
The option is deactivated and the checkbox is hidden.
selectable
The checkbox is shown so that the option can be selected by the user.

enableDisplayBigControlPanel

Changed in version 11.3

The checkbox Extended view was removed with TYPO3 v11.3. Therefore the option mod.web_list.enableDisplayBigControlPanel has no effect anymore.

hideTables

hideTables

hideTables
Type
list of table names, or *

Hide these tables in record listings (comma-separated)

If * is used, all tables will be hidden

hideTranslations

hideTranslations

hideTranslations
Type
list of table names, or *

For tables in this list all their translated records in additional website languages will be hidden in the List module.

Use * to hide all records of additional website languages in all tables or set single table names as comma-separated list.

Example: Hide all translated records

EXT:site_package/Configuration/page.tsconfig
mod.web_list.hideTranslations = *
Copied!

Example: Hide translated records in tables tt_content and tt_news

EXT:site_package/Configuration/page.tsconfig
mod.web_list.hideTranslations = tt_content, tt_news
Copied!

itemsLimitPerTable

itemsLimitPerTable

itemsLimitPerTable
Type
positive integer
Default
20 Set the default maximum number of items to show per table. The number must be between 0 and 10000`. If below or above this range, the nearest valid number will be used.

If a value is defined in the $TCA[<table>]['interface']['maxDBListItems'] of the table, it will override this TSconfig option. For example, the maxDBListItems for the pages table is 30 by default.

Example: Limit items per table in overview to 10

EXT:site_package/Configuration/page.tsconfig
mod.web_list {
    itemsLimitPerTable = 10
}
Copied!

itemsLimitSingleTable

itemsLimitSingleTable

itemsLimitSingleTable
Type
positive integer
Default
100

Set the default maximum number of items to show in single table view. The number must be between 0 and 10000. If below or above this range, the nearest valid number will be used.

If a value is defined in the $TCA[<table>]['interface']['maxSingleDBListItems'] of the table, it will override this TSconfig option. For example, the maxSingleDBListItems for the pages table is 50 by default.

Example: Limit items in single table view to 10

EXT:site_package/Configuration/page.tsconfig
mod.web_list {
    itemsLimitSingleTable = 10
}
Copied!

listOnlyInSingleTableView

listOnlyInSingleTableView

listOnlyInSingleTableView
Type
boolean
Default
0

If set, the default view will not show the single records inside a table anymore, but only the available tables and the number of records in these tables. The individual records will only be listed in the single table view, that means when a table has been clicked. This is very practical for pages containing many records from many tables!

Example: Only list records of tables in single-table mode

EXT:site_package/Configuration/page.tsconfig
mod.web_list {
    listOnlyInSingleTableView = 1
}

The result will be that records from tables are only listed in the single-table mode:
Copied!
The list module after activating the single-table mode

The list module after activating the single-table mode

newPageWizard.override

newPageWizard.override

newPageWizard.override
Type
string

If set to an extension key, then the specified module or route will be used for creating new elements on the page.

noViewWithDokTypes

noViewWithDokTypes

noViewWithDokTypes
Type
string (comma-separated list of integers)
Default
254,255

Hide view icon for the defined doktypes.

table.[tableName].hideTable

table.[tableName].hideTable

table.[tableName].hideTable
Type
boolean
Default
0

If set to non-zero, the table is hidden. If it is zero, table is shown even if table name is listed in "hideTables" list.

Example: Hide table tt_content

EXT:site_package/Configuration/page.tsconfig
mod.web_list.table.tt_content.hideTable = 1
Copied!

table.[tableName].displayColumnSelector

table.[tableName].displayColumnSelector

table.[tableName].displayColumnSelector
Type
boolean

If set to false, the column selector in the title row of the specified table gets hidden. If the column selctors have been disabled globally this option can be used to enable it for a specific table.

Example: Hide the column selector for tt_content

EXT:site_package/Configuration/page.tsconfig
mod.web_list.table.tt_content.displayColumnSelector = 0
Copied!

Example: Hide the column selector for all tables but sys_category

EXT:site_package/Configuration/page.tsconfig
mod.web_list.displayColumnSelector = 0
mod.web_list.table.sys_category.displayColumnSelector = 1
Copied!

tableDisplayOrder

tableDisplayOrder.[tableName]

tableDisplayOrder.[tableName]
Type
array

Flexible configuration of the order in which tables are displayed.

The keywords before and after can be used to specify an order relative to other table names.

mod.web_list.tableDisplayOrder.<tableName> {
    before = <tableA>, <tableB>, ...
    after = <tableA>, <tableB>, ...
}
Copied!

searchLevel.items

searchLevel.items

searchLevel.items
Type
array

Sets labels for each level label in the search level select box

EXT:site_package/Configuration/page.tsconfig
mod.web_list.searchLevel.items {
    -1 = EXT:core/Resources/Private/Language/locallang_core.xlf:labels.searchLevel.infinite
    0 = EXT:core/Resources/Private/Language/locallang_core.xlf:labels.searchLevel.0
    1 = EXT:core/Resources/Private/Language/locallang_core.xlf:labels.searchLevel.1
    2 = EXT:core/Resources/Private/Language/locallang_core.xlf:labels.searchLevel.2
    3 = EXT:core/Resources/Private/Language/locallang_core.xlf:labels.searchLevel.3
    4 = EXT:core/Resources/Private/Language/locallang_core.xlf:labels.searchLevel.4
}
Copied!

searchLevel.default

searchLevel.default

searchLevel.default
Type
integer

New in version 13.2

This option allows to define one of the available level options as the default level to use.

When searching for records in the Web > List module as well as the database browser, it is possible to select the search levels (page tree levels to respect in the search).

An editor is therefore able to select between the current page, a couple of defined levels (e.g. 1, 2, 3) as well as the special "infinite levels".

Those options can already be extended using the TSconfig option searchLevel.items.

Example: Set the default search level to "infinite levels"

EXT:my_sitepackage/Configuration/page.tsconfig
mod.web_list.searchLevel.default = -1
Copied!

web_view

Configuration options of the "Web > View" module.

previewFrameWidths

previewFrameWidths

previewFrameWidths
Type
array

Configure available presets in view module.

<key>.label
Label for the preset
<key>.type
Category of the preset, must be one of 'desktop', 'tablet' or 'mobile'
<key>.width
Width of the preset
<key>.height
Height of the preset

Example: Define a new preview preset

With this configuration a new preset '1014' with size 1024x768 will be configured with a label loaded from an xlf file and the category 'desktop'.

EXT:site_package/Configuration/page.tsconfig
mod.web_view.previewFrameWidths {
    1024.label = LLL:EXT:viewpage/Resources/Private/Language/locallang.xlf:computer
    1024.type = desktop
    1024.width = 1024
    1024.height = 768
}
Copied!
Dropdown menu Width with added frame size called myPreview

Dropdown menu Width with added frame size called myPreview

type

type

type
Type
positive integer

Enter the value of the &type= parameter passed to the webpage.

Example: Show pages of type 42 in the preview

EXT:site_package/Configuration/page.tsconfig
mod.web_view {
    # Frontend link will be something like index.php?id=123&type=42
    type = 42
}
Copied!

wizards

The wizards section allows to customize the New record wizard and the New content element wizard.

newContentElement.wizardItems

Changed in version 13.0

New content elements added via TCA to the items of field CType of table tt_content are automatically added to the New Content Element Wizard. The following page TSconfig can be used to override values set via TCA.

newContentElement.wizardItems

newContentElement.wizardItems
Type
array
Path
mod.wizards.newContentElement.wizardItems

In the New Content Element Wizard, content element types are grouped together by type. Each such group can be configured independently. The four default groups are: default, special, forms and plugins.

Changed in version 13.0

The group common was renamed to default. A permanent migration is in place.

removeItems

removeItems
Type
comma separated list of groups
Path
mod.wizards.newContentElement.wizardItems.removeItems

Changed in version 13.0

With this setting one or several groups with all their content elements can be hidden in the New Content Element Wizard.

# This will remove the "menu" group
mod.wizards.newContentElement.wizardItems.removeItems := addToList(menu)
Copied!

[group].before

[group].before
Type
string
Path
mod.wizards.newContentElement.wizardItems.[group].before

Sorts [group] in front of the group given.

[group].after

[group].after
Type
string
Path
mod.wizards.newContentElement.wizardItems.[group].after

Sorts [group] after the group given.

[group].header

[group].header
Type
string | localized string
Path
mod.wizards.newContentElement.wizardItems.[group].header

Name of the group.

[group].show

[group].show
Type
string, comma-separated list of items
Path
mod.wizards.newContentElement.wizardItems.[group].show

Changed in version 13.0

The configuration of the New Content Element Wizard has been changed to automatically registering the groups and elements from the TCA configuration.

The previously used option to show / hide elements mod.wizards.newContentElement.wizardItems.<group>.show is not evaluated anymore.

All configured groups and elements are automatically shown. Removing these groups and elements from the New Content Element Wizard can be done via the option removeItems and [group].removeItems options.

[group].elements

[group].elements
Type
array
Path
mod.wizards.newContentElement.wizardItems.[group].elements

List of items in the group.

[name]

[name]
Type
array
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name]

Configuration for a single item.

iconIdentifier

iconIdentifier
Type
string
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name].iconIdentifier

The icon identifier of the icon you want to display.

iconOverlay

iconOverlay
Type
string
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name].iconOverlay

The icon identifier of the overlay icon you want to use.

title

title
Type
string | localized string
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name].title

Name of the item.

description

description
Type
string | localized string
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name].description

Description text for the item.

tt_content_defValues

tt_content_defValues
Type
array
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name].tt_content_defValues

Default values for tt_content fields.

saveAndClose

saveAndClose
Type
bool
Path
mod.wizards.newContentElement.wizardItems.[group].elements.[name].saveAndClose
Default
false

If true, directs the user back to the Page module directly instead of showing the FormEngine.

[group].removeItems

[group].removeItems
Type
Comma separated list
Path
mod.wizards.newContentElement.wizardItems.[group].removeItems

Changed in version 13.0

Comma separated list of content elements that should be hidden in [group].

EXT:site_package/Configuration/page.tsconfig
mod.wizards.newContentElement.wizardItems {
    special.removeItems := addToList(html)
}
Copied!

Example: Add a new element to the "common" group

EXT:site_package/Configuration/page.tsconfig
# Add a new element (header) to the "common" group
mod.wizards.newContentElement.wizardItems.common.elements.header {
    iconIdentifier = content-header
    title = Header
    description = Adds a header element only
    tt_content_defValues {
        CType = header
    }
}
mod.wizards.newContentElement.wizardItems.common.show := addToList(header)
Copied!

Example: Create a new group and add an element to it

EXT:site_package/Configuration/page.tsconfig
# Create a new group and add a (pre-filled) element to it
mod.wizards.newContentElement.wizardItems.myGroup {
    header = LLL:EXT:cms/layout/locallang.xlf:advancedFunctions
    elements.customText {
        iconIdentifier = content-text
        title = Introductory text for national startpage
        description = Use this element for all national startpages
        tt_content_defValues {
            CType = text
            bodytext (
                    <h2>Section Header</h2>
                    <p class="bodytext">Lorem ipsum dolor sit amet, consectetur, sadipisci velit ...</p>
            )
            header = Section Header
            header_layout = 100
        }
    }
}
mod.wizards.newContentElement.wizardItems.myGroup.show = customText
Copied!

With the second example, the bottom of the new content element wizard shows:

Added entry in the new content element wizard

Added entry in the new content element wizard

newRecord.order

newRecord.order

newRecord.order
Type
list of values

Define an alternate order for the groups of records in the new records wizard. Pages and content elements will always be on top, but the order of other record groups can be changed.

Records are grouped by extension keys, plus the special key "system" for records provided by the TYPO3 Core.

Example: Place the tt_news group at the top of the new record dialog

Place the tt_news group at the top (after pages and content elements), other groups follow unchanged:

EXT:site_package/Configuration/page.tsconfig
mod.wizards.newRecord.order = tt_news
Copied!
The position of News changed after modifying the New record screen

The position of News changed after modifying the New record screen

newRecord.pages

newRecord.pages

newRecord.pages
Type
boolean

Use the following sub-properties to show or hide the specified links. Setting any of these properties to 0 will hide the corresponding link, but setting to 1 will leave it visible.

show.pageAfter
Show or hide the link to create new pages after the selected page.
show.pageInside
Show or hide the link to create new pages inside the selected page.
show.pageSelectPosition
Show or hide the link to create new pages at a selected position.

options

Various options for the page affecting the Core at various points.

Properties

backendLayout.exclude

backendLayout.exclude

backendLayout.exclude
Type
list of identifiers / uids

Exclude a list of backend layouts from being selectable when assigning a backend layout to a page record.

Use the uid/identifier of the record in the default data provider.

Example: Exclude two backend layouts from drop down selector

Two backend layout records shown in list module

Before: Two backend layout records shown in list module

EXT:site_package/Configuration/page.tsconfig
# Exclude two backend layouts from drop down selector
options.backendLayout.exclude = 1,2
Copied!
Drop down without backend layouts

After: Drop down without backend layouts

defaultUploadFolder

defaultUploadFolder

defaultUploadFolder
Type
string

Identical to the user TSconfig setting options.defaultUploadFolder, this allows the setting of a default upload folder per page.

If specified and the given folder exists, this setting will override the value defined in user TSconfig.

The syntax is "storage_uid:file_path".

Example: Set default upload

EXT:site_package/Configuration/page.tsconfig
# Set default upload folder to "fileadmin/page_upload" on PID 1
[traverse(page, "uid") == 1]
    options.defaultUploadFolder = 1:/page_upload/
[END]
Copied!

RTE

The RTE prefix key is used for configuration of the Rich Text Editor. Please refer to the RTE chapter in Core API document for more general information on RTE configuration and data processing.

The order in which the configuration for the RTE is loaded is (the first one which is set will be used, see example below):

  1. preset defined for a specific field via page TSconfig
  2. richtextConfiguration defined for a specific field via TCA
  3. general preset defined via page TSconfig (RTE.default.preset)
  4. default (the preset "default", e.g. as defined by EXT:rte_ckeditor or overridden in ext_localconf.php)

The full property path building is a bit more complex than for other property segments. The goal is that global options can be set that can also be overridden in more specific situations:

Configure all RTE for all tables, fields and types:
RTE.default
Configure RTE for a specific field in a table
RTE.config.[tableName].[fieldName]
Configure RTE for a specific field in a table for a specific record type
RTE.config.[tableName].[fieldName].types.[type]

Configuring RTE via page TSconfig is general and not specific to a particular rich-text editor. However, TYPO3 comes with EXT:rte_ckeditor, so this one will usually be used. This page covers only the general configuration, for more information about configuring EXT:rte_ckeditor, see the rte_ckeditor configuration.

Examples

Example: Disable RTE

EXT:site_package/Configuration/page.tsconfig
# Disable all RTEs
RTE.default.disabled = 1
Copied!
EXT:site_package/Configuration/page.tsconfig
# Disable all RTEs
RTE.default.disabled = 1
# Enable RTE for the tt_content bodytext field only
RTE.config.tt_content.bodytext.disabled = 0
Copied!
EXT:site_package/Configuration/page.tsconfig
# Disable all RTEs
RTE.default.disabled = 1
# Enable RTE for the tt_content bodytext field only
RTE.config.tt_content.bodytext.disabled = 0
# But disable RTE for tt_content bodytext again if the record type is "text"
RTE.config.tt_content.bodytext.types.text.disabled = 1
Copied!

Example: Override preset

Refer to the description of the order above for details of which setting has priority over which.

Summary:

  • Setting the preset via page TSconfig for a specific field overrides all, else
  • TCA richtextConfiguration (for a specific field) overrides the page TSconfig default preset (RTE.default.preset)
EXT:site_package/Configuration/page.tsconfig
# set a default preset to use as fallback
RTE.default.preset = custom_preset_default

# Override preset for field "description" in table "tt_address"
RTE.config.tt_address.description.preset = custom_preset_fancy
Copied!

Properties

disabled

disabled

disabled
Type
boolean

If set, the editor is disabled. This option is evaluated in \TYPO3\CMS\Backend\Form\FormEngine where it determines whether the RTE is rendered or not. Note that a backend user can also ultimately disable RTE's in his user settings.

buttons

config.contentsLanguageDirection

config.contentsLanguageDirection

config.contentsLanguageDirection
Type
string

The configuration contentsLangDirection of the ckeditor is used to define the direction of the content. It is filled by the direction defined in the site language of the current element.

As fallback the following page TsConfig configuration can be used:

EXT:my_sitepackage/Configuration/page.tsconfig
# always use right to left
RTE.config.contentsLanguageDirection = rtl

# except for the following language:
[siteLanguage("locale") == "en_US"]
    RTE.config.contentsLanguageDirection = ltr
[END]
Copied!

proc

The proc section allows customization of the server processing of the content, see the transformation section of the RTE chapter in the core API document for more general information on server processing.

The proc properties are in \TYPO3\CMS\Core\Html\RteHtmlParser and are universal for all RTEs. The main objective of these options is to allow for minor configuration of the transformations. For instance you may disable the mapping between <b>-<strong> and <i>-<em> tags which is done by the ts_transform transformation.

Notice how many properties relate to specific transformations only! Also notice that the meta-transformations ts_css imply other transformations.

This means that options limited to ts_transform will also work for ts_css of course.

allowedClasses

proc.allowedClasses

proc.allowedClasses
Type
string with comma separated values

Applies for ts_transform and css_transform only.

Direction: From RTE to database, saving a record.

Allowed general class names when content is stored in database. Could be a list matching the number of defined classes you have. Class names are case insensitive.

This might be a really good idea to do, because when pasting in content from MS word for instance there are a lot of <SPAN> and <P> tags which may have class names in. So by setting a list of allowed classes, such foreign class names are removed.

If a class name is not found in this list, the default is to remove the class.

allowTags

proc.allowTags

proc.allowTags
Type
string with comma separated values

Applies for ts_transform and css_transform only.

Tags to allow. Notice, this list is added to the default list, which you see here:

b,i,u,a,img,br,div,center,pre,figure,figcaption,font,hr,sub,sup,p,strong,em,li,ul,ol,blockquote,strike,span,abbr,acronym,dfn

allowTagsOutside

proc.allowTagsOutside

proc.allowTagsOutside
Type
string with comma separated values
Default
address, article, aside, blockquote, footer, header, hr, nav, section, div

Applies for ts_transform and css_transform only.

Enter tags which are allowed outside of <P> and <DIV> sections when converted back to database.

Example: Allow only hr tags outside of p and div
EXT:site_package/Configuration/page.tsconfig
# Allow only hr tags outside of p and div
RTE.default.proc.allowTagsOutside = hr
Copied!

blockElementList

proc.blockElementList

proc.blockElementList
Type
string with comma separated values

Comma-separated list of uppercase tags (e.g. P,HR) that overrides the list of HTML elements that will be treated as block elements by the RTE transformations.

denyTags

proc.denyTags

proc.denyTags
Type
string with comma separated values

Applies for ts_transform and css_transform only.

Tags from above list to disallow.

entryHTMLparser_db

proc.entryHTMLparser_db

proc.entryHTMLparser_db
Type
boolean / HTMLparser

Applies to all kinds of processing.

Allows to enable / disable the HTMLparser before the content is processed with the predefined processors (e.g. ts_images or ts_transform).

entryHTMLparser_rte

proc.entryHTMLparser_rte

proc.entryHTMLparser_rte
Type
boolean / HTMLparser

Applies to all kinds of processing.

Allows to enable / disable the HTMLparser before the content is processed with the predefined processors (e.g. ts_images or ts_transform).

exitHTMLparser_db

proc.exitHTMLparser_db

proc.exitHTMLparser_db
Type
boolean / HTMLparser

Applies to all kinds of processing.

Allows to enable / disable the HTMLparser after the content is processed with the predefined processors (e.g. ts_images or ts_transform).

exitHTMLparser_rte

proc.exitHTMLparser_rte

proc.exitHTMLparser_rte
Type
boolean / HTMLparser

Applies to all kinds of processing.

Allows to enable / disable the HTMLparser after the content is processed with the predefined processors (e.g. ts_images or ts_transform).

HTMLparser_db

proc.HTMLparser_db

proc.HTMLparser_db
Type
HTMLparser

Applies for ts_transform and css_transform only.

These are additional options to the HTML parser calls which strips of tags when the content is prepared from the RTE to the database, saving a record. It is possible to configure additional rules like which other tags to preserve, which attributes to preserve, which values are allowed as attributes of a certain tag etc.

For the detailed list of properties, see the section of the TypoScript reference.

Sanitization

New in version 9.5.29/10.4.19

An HTML sanitizer is available to sanitize and remove XSS from markup. It strips tags, attributes and values that are not explicitly allowed.

Sanitization for persisting data is disabled by default and can be enabled globally by using the corresponding feature flag in the configuration files config/system/settings.php or config/system/additional.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['security.backend.htmlSanitizeRte'] = true;
Copied!

It can then be disabled per use case with a custom processing instruction:

EXT:site_package/Configuration/Processing.yaml
processing:
  allowTags:
    # ...
  HTMLparser_db:
    # ...
    # disable individually per use case
    htmlSanitize: false

    # This is the default configuration,
    # the feature flag has to be enabled
    htmlSanitize:
      # use default builder as configured in
      # $GLOBALS['TYPO3_CONF_VARS']['SYS']['htmlSanitizer']
      build: default
Copied!

HTMLparser_rte

proc.HTMLparser_rte

proc.HTMLparser_rte
Type
HTMLparser

Applies for ts_transform and css_transform only.

These are additional options to the HTML parser calls which strips of tags when the content is prepared from the database to the RTE rendering. It is possible to configure additional rules like which other tags to preserve, which attributes to preserve, which values are allowed as attributes of a certain tag etc.

For the detailed list of properties, see the section of the TypoScript reference.

overruleMode

proc.overruleMode

proc.overruleMode
Type
Comma list of RTE transformations

This can overrule the RTE transformation set from TCA. Notice, this is a comma list of transformation keys.

TCAdefaults

This allows to set or override the default values of TCA fields that is available for various TCA types, for instance for type=input.

The full path of a setting include the table and the field name: TCAdefaults.[table name].[field]

This key is also available on User TSconfig level, the order of default values when creating new records in the backend is this:

  1. Value from $GLOBALS['TCA']
  2. Value from user TSconfig
  3. Value from page TSconfig (these settings)
  4. Value from "defVals" GET variables
  5. Value from previous record based on useColumnsForDefaultValues

Example: Do not hide newly created pages by default

EXT:site_package/Configuration/page.tsconfig
TCAdefaults.pages.hidden = 0
Copied!

TCEFORM

Allows detailed configuration of how editing forms are rendered for a page tree branch and for individual tables if you like. You can enable and disable options, blind options in selector boxes etc.

See the core API document section FormEngine for more details on how records are rendered in the backend.

Applying properties

The properties listed below apply to various contexts which are explained per property. The full property path thus depends on the property and where it should apply. In general, a more specific property path overrides a less specific one:

Some properties apply to single fields, those can be usually set per table or per table and record type. This leads to the property paths TCEFORM.[tableName].[fieldName].[propertyName] to configure the field for all types and TCEFORM.[tableName].[fieldName].types.[typeName].[propertyName] to configure a field for a specific type, see the TCA type section for details on types.

While all that property path munging looks messy at first, it should become more clear when reading through the single properties below and looking at the examples.

Applying properties to FlexForm fields

Other properties also apply to FlexForm fields, in this case the full property path including the data structure key has to be set:

# TCEFORM.[tableName].[fieldName].[dataStructureKey].[flexSheet].[flexFieldName with escaped dots].[propertyName]
TCEFORM.tt_content.pi_flexform.sfregister_create.sDEF.settings\.fields\.selected.addItems.ZZZ = ZZZ
Copied!

The sheet name (sDEF) must be given only if the FlexForm has a sheet.

The [dataStructureKey] represents the key of a FlexForm in $GLOBALS['TCA'][<tableName>]['columns'][<field>]['config']['ds'] . This key will be split into up to two parts. By default the first part will be used as identifier of the FlexForm in TSconfig. The second part will override the identifier if it is not empty, list or *. For example the identifier of the key myext_pi1,list will be myext_pi1 and of the key *,my_CType it will be my_CType. See section Pointing to a data structure of the TCA reference for details.

The flexFieldName is the name of the property in the FlexForm. If it contains dots ('.'), these must be escaped with backslash.

Some properties apply to whole FlexForm sheets, their property path is TCEFORM.[tableName].[fieldName].[dataStructureKey].[flexSheet].[propertyName].

Properties

addItems

addItems

addItems
Type
localized string

Change the list of items in TCA type=select fields. Using this property, items can be added to the list. Note that the added elements might be removed if the selector represents records: If the select box is a relation to another table. In that case only existing records will be preserved.

The subkey icon will allow to add your own icons to new values.

The subkey group can be used to insert a new element into an existing select item group by settings the value to the group identifier. The grouping is usually displayed in select fields with groups available.

This property is available for various levels:

table level, example:
TCEFORM.tt_content.header_layout.addItems
table and record type level, example:
TCEFORM.tt_content.header_layout.types.textpic.addItems
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.addItems

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Add header layout option

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.header_layout {
    # Add another header_layout option:
    addItems.1525215969 = Another header layout
    # Add another one with localized label, icon and group
    addItems.1525216023 = LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:header_layout
    addItems.1525216023.icon = EXT:my_ext/icon.png
    addItems.1525216023.group = special
}

Instead of adding files by path, icon identifiers should be used.
Copied!

altLabels

altLabels

altLabels
Type
localized string

This property applies to TCA type=select, TCA type=check and TCA type=radio.

This property allows you to enter alternative labels for the items in the list. For a single checkbox or radio button, use default, for multiple checkboxes and radiobuttons, use an integer for their position starting at 0.

This property is available for various levels:

table level:
TCEFORM.[tableName].[fieldName].altLabels
table and record type level:
TCEFORM.[tableName].[fieldName].types.[typeName].altLabels
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.altLabels

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Override labels for document types

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.doktype {
    # Set a different item label
    altLabels.1 = STANDARD Page Type
    altLabels.254 = Folder (for various elements)
    # Sets the default label for Recycler via "locallang":
    altLabels.255 = LLL:EXT:my_ext/Resources/Private/Language/locallang_tca.xlf:recycler
}
Copied!
The Page types with modified labels

The Page types with modified labels

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.space_before_class.altLabels.. = foo
Copied!

Note the double dot after altLabels.

PAGE_TSCONFIG_ID

PAGE_TSCONFIG_ID

PAGE_TSCONFIG_ID
Type
integer

This option allows to provide a value for dynamic SQL-WHERE parameters. The value is defined for a specific field of a table. For usage with flexform fields, the entire path to a sub-field must be provided.

Example: Substitute a marker in a plugin FlexForm

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.myField.PAGE_TSCONFIG_ID = 22
Copied!

In this example, the value will substitute the marker in a plugin FlexForm.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tx_myext_table.myfield.PAGE_TSCONFIG_ID = 22
Copied!

This example might be used for a record in an extension. It refers to a table called tx_myext_table and the field myfield. Here the marker will be substituted by the value 22.

PAGE_TSCONFIG_IDLIST

PAGE_TSCONFIG_IDLIST

PAGE_TSCONFIG_IDLIST
Type
list of integers

See above.

Example: Substitute a list of IDs in a plugin FlexForm

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.myField.PAGE_TSCONFIG_IDLIST = 20,21,22
Copied!

In this example, the value will substitute the marker in a plugin FlexForm.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tx_myext_table.myfield.PAGE_TSCONFIG_IDLIST = 20,21,22
Copied!

This example might be used for a record in an extension. It refers to a table called tx_myext_table and the field myfield. Here the marker will be substituted by the list of integers.

PAGE_TSCONFIG_STR

PAGE_TSCONFIG_STR

PAGE_TSCONFIG_STR
Type
string

See above.

Example: Substitute a string in a plugin FlexForm

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.myField.PAGE_TSCONFIG_STR = %hello%
Copied!

In this example, the value will substitute the marker in a plugin FlexForm.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tx_myext_table.myfield.PAGE_TSCONFIG_STR = %hello%
Copied!

This example might be used for a record in an extension. It refers to a table called tx_myext_table and the field myfield. Here the marker will be substituted by the given value.

colorPalette

New in version 13.0

colorPalette

colorPalette
Type
string

Assign a color palette to a specific field of a table, for all fields within a table or a global configuration affecting all color pickers within FormEngine. If no palette is defined, FormEngine falls back to all configured colors.

Example: Assign a palette to a field

EXT:my_sitepackage/Configuration/page.tsconfig
# Assign a palette to a specific field
TCEFORM.tx_myext_table.myfield.colorPalette = messages

# Assign a palette to all color pickers used in a table
TCEFORM.tx_myext_table.colorPalette = key_colors

# Assign global palette
TCEFORM.colorPalette = main
Copied!

config

config

config

This setting allows to override TCA field configuration. This will influence configuration settings in $GLOBALS['TCA'][<tableName>]['columns'][<fieldName>]['config'][<key>] , see TCA reference for details.

Not all configuration options can be overridden, the properties are restricted and depend on the field type. The array typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php->$allowOverrideMatrix within FormEngine code defines details:

'input' => ['size', 'max', 'readOnly'],
'number' => ['size', 'readOnly'],
'email' => ['size', 'readOnly'],
'link' => ['size', 'readOnly'],
'password' => ['size', 'readOnly'],
'datetime' => ['size', 'readOnly'],
'color' => ['size', 'readOnly'],
'uuid' => ['size', 'enableCopyToClipboard'],
'text' => ['cols', 'rows', 'wrap', 'max', 'readOnly'],
'json' => ['cols', 'rows', 'readOnly'],
'check' => ['cols', 'readOnly'],
'select' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'treeConfig', 'fileFolderConfig'],
'category' => ['size', 'maxitems', 'minitems', 'readOnly', 'treeConfig'],
'group' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'elementBrowserEntryPoints'],
'folder' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'elementBrowserEntryPoints'],
'inline' => ['appearance', 'behaviour', 'foreign_label', 'foreign_selector', 'foreign_unique', 'maxitems', 'minitems', 'size', 'autoSizeMax', 'symmetric_label', 'readOnly'],
'file' => ['appearance', 'behaviour', 'maxitems', 'minitems', 'readOnly'],
'imageManipulation' => ['ratios', 'cropVariants'],
Copied!

The reason that not all properties can be changed is that internally, the DataHandler performs database operations which require finalized TCA definitions that are accessed without this TSconfig getting interpreted. This mismatch would then lead to inconsistencies.

An input or text TCA field can not enable the RTE via the config.enableRichtext option due to similar reasons in respect to the DataHandler.

Also, if for example the max definition of a field is made larger than the TCA definition of that field, you may need to to change the file ext_tables.sql (see ext_tables.sql) to adjust column definitions, especially when using the Auto-generated structure.

The property config is available for these levels:

table level, example:
TCEFORM.tt_content.header.config.max
table and record type level, example:
TCEFORM.tt_content.header.types.textpic.config.max
Flex form field level, example:
No current TYPO3 version allows to override the configuration of Flex form fields, even though this was previously documented here. This may change in future versions.

config.treeConfig

config.treeConfig

config.treeConfig
Type
int

The treeConfig sub properties of TCEFORM.config are dedicated to the TCA config type select with renderType=selectTree. A couple of treeConfig properties can be overriden on page TSconfig level, see their detailed description in the TCA reference:

EXT:site_package/Configuration/page.tsconfig
config.treeConfig.startingPoints = 1,42
config.treeConfig.appearance.expandAll = 1
config.treeConfig.appearance.maxLevels = 2
config.treeConfig.appearance.nonSelectableLevels = 1
Copied!

This property is available for various levels:

table level, example:
TCEFORM.tt_content.myField.config.treeConfig.startingPoints
table and record type level, example:
TCEFORM.tt_content.header.types.config.treeConfig.startingPoints
Flex form field level, example:
No current TYPO3 version allows to override the configuration of Flex form fields, even though this was previously documented here. This may change in future versions.

description

description

description
Type
string

This property sets or overrides the TCA property TCA description, which allows to define a description for a TCA field, next to its label.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.header.description = override description
Copied!

As already known from other properties, this can also be configured for a specific language.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.header.description.de = override description for DE
Copied!

The option can be used on a per record type basis, too.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.header.types.textpic.description = override description for textpic
Copied!

Also referencing language labels is supported.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.header.description = LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:override_description
Copied!

disabled

disabled

disabled
Type
boolean

If set, the field is not displayed in the backend form of the record. However, the field can still be set by other means. For example if this property is set: TCEFORM.tt_content.colPos.disabled = 1 the Column field will not be displayed in the content elements form. The content element can still be moved to another column which internally also sets the field colPos. Fields with the TSconfig property TCEFORM.<table>.<field>.disabled therefore show the same behaviour as fields of the TCA type passthrough.

table level, example:
TCEFORM.tt_content.header.disabled
table and record type level, example:
TCEFORM.tt_content.header.types.textpic.disabled
Flex form sheet level. If set, the entire tab is not rendered, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.disabled

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.disabled

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Disable editing of the page title

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.title {
    # The title field of the pages table is not editable
    disabled = 1
}
Copied!

disableNoMatchingValueElement

disableNoMatchingValueElement

disableNoMatchingValueElement
Type
boolean

This property applies only to items in TCA type=select fields. If a selector box value is not available among the options in the box, the default behavior of TYPO3 is to preserve the value and to show a label which warns about this special state:

A missing selector box value is indicated by a warning message

A missing selector box value is indicated by a warning message

If disableNoMatchingValueElement is set, the element "INVALID VALUE" will not be added to the list.

This property is available for various levels:

table level, example:
TCEFORM.tt_content.header_layout.disableNoMatchingValueElement
table and record type level, example:
TCEFORM.tt_content.header_layout.types.textpic.disableNoMatchingValueElement
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.disableNoMatchingValueElement

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Disable "INVALID VALUE ..." label

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.doktype {
    # "INVALID VALUE ..." label will never show up
    disableNoMatchingValueElement = 1
}
Copied!

Now the selector box will default to the first element in the selector box:

Instead of show a warning message the system choose the first element in the selector box

Instead of show a warning message the system choose the first element in the selector box

fileFolderConfig

fileFolderConfig

fileFolderConfig
Type
array

The special fileFolder configuration options for TCA columns of type TCA type=select can be used to fill a select field with files (images / icons) from a defined folder.

The fileFolderConfig TCA configuration can be overridden with page TSconfig, allowing administrators to use different folders or different file extensions, per site.

The same sub properties as in the fileFolderConfig TCA configuration are available:

EXT:site_package/Configuration/page.tsconfig
fileFolderConfig {
    folder = 'EXT:styleguide/Resources/Public/Icons'
    allowedExtensions = 'svg'
    depth = 1
}
Copied!

This property is available for various levels:

table level:
TCEFORM.[tableName].[fieldName].fileFolderConfig.folder
table and record type level:
TCEFORM.[tableName].[fieldName].types.[typeName].fileFolderConfig.folder
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.fileFolderConfig.folder

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

itemsProcFunc

itemsProcFunc

itemsProcFunc
Type
custom

This property applies only to items in TCA type=select fields. The properties of this key is passed on to the itemsProcFunc in the parameter array by the key "TSconfig".

This property is available for various levels:

table level:
TCEFORM.[tableName].[fieldName].itemsProcFunc
table and record type level:
TCEFORM.[tableName].[fieldName].types.[typeName].itemsProcFunc
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.itemsProcFunc

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

keepItems

keepItems

keepItems
Type
list of values

Change the list of items in TCA type=select fields. Using this property, all items except those defined here are removed.

This property is available for various levels:

table level, example:
TCEFORM.tt_content.header_layout.keepItems
table and record type level, example:
TCEFORM.tt_content.header_layout.types.textpic.keepItems
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.keepItems

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Show only standard and spacer pages

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.doktype {
    # Show only standard and "Spacer" page types
    keepItems = 1, 199
}
Copied!

label

label

label
Type
localized string

This allows you to enter alternative labels for any field. The value can be a LLL: reference to a localization file, the system will then look up the selected backend user language and tries to fetch the localized string if available. However, it is also possible to override these by appending the language key and hard setting a value, for example label.de = Neuer Feldname.

This property is available for various levels:

table level, example:
TCEFORM.[tableName].[fieldName].label
table and record type level, example:
TCEFORM.[tableName].[fieldName].types.[typeName].label
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.label

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Override the label of a field

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.title {
    label = LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:table.column
    label.default = New Label
    label.de = Neuer Feldname
}
Copied!

noMatchingValue_label

noMatchingValue_label

noMatchingValue_label
Type
localized string

This property applies only to items in TCA type=select fields, it allows defining a different label of the noMatchingValue element.

It is possible to use the placeholder %s to insert the value. If the property is set to empty, the label will be blank.

This property is available for various levels:

table level, example:
TCEFORM.tt_content.header_layout.noMatchingValue_label
table and record type level, example:
TCEFORM.tt_content.header_layout.types.textpic.noMatchingValue_label
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.noMatchingValue_label

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Replace "INVALID VALUE ..." label with another string

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.doktype {
    # Different "INVALID VALUE ..." label:
    noMatchingValue_label = VALUE "%s" was not available!
}
Copied!
An invalid selector box value is indicated by a warning message

An invalid selector box value is indicated by a warning message

removeItems

removeItems

removeItems
Type
list of values

Change the list of items in TCA type=select fields. Using this property, single items can be removed, leaving all others.

This property is available for various levels:

table level, example:
TCEFORM.tt_content.header_layout.removeItems
table and record type level, example:
TCEFORM.tt_content.header_layout.types.textpic.removeItems
Flex form field level, example:

TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.settings\.myfield.removeItems

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Remove "Recycler" and "Spacer" page types

EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.doktype {
    # Remove "Recycler" and "Spacer" page types
    removeItems = 199, 255
}
Copied!

sheetDescription

sheetDescription

sheetDescription
Type
localized string

Specifies a description for the sheet shown in the FlexForm.

This property is only available on flex form sheet level, for example TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.sheetDescription.

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

sheetShortDescr

sheetShortDescr

sheetShortDescr
Type
localized string

Specifies a short description of the sheet used as link title in the tab-menu.

This property is only available on flex form sheet level, example: TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.sheetShortDescription.

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

sheetTitle

sheetTitle

sheetTitle
Type
localized string

Set the title of the sheet / tab in a FlexForm configuration.

This property is only available on flex form sheet level, example: TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF.sheetTitle.

Where sDEF is the sheet name. For a description see the section Applying properties to FlexForm fields on this page.

Example: Rename the first tab of the FlexForm plugin

EXT:site_package/Configuration/page.tsconfig
TCEFORM.tt_content.pi_flexform.myext_pi1.sDEF {
    # Rename the first tab of the FlexForm plug-in configuration
    sheetTitle = LLL:my_ext/Resource/Private/Language/locallang.xlf:tt_content.pi_flexform.myext_pi1.sDEF
}
Copied!

suggest

Configuration of the suggest wizard that is available and often enabled for TCA type=group fields.

A configured suggest wizard

A configured suggest wizard

The properties listed below are available on various levels. A more specific setting overrides a less specific one:

Configuration of all suggest wizards in all tables for all target query tables:
TCEFORM.suggest.default
Configuration of all suggest wizards in all tables looking up records from a specific target table:
TCEFORM.suggest.[queryTable]
Configuration of one suggest wizard field in one table for all target query tables:
TCEFORM.[tableName].[fieldName].suggest.default
Configuration of one suggest wizard field in one table for a specific target query table:
TCEFORM.[tableName].[fieldName].suggest.[queryTable]
Configuration of one suggest wizard field in a flex form field of one table for all target query tables:
TCEFORM.[tableName].[fieldName].[dataStructureKey].[sheetName].[flexFieldName].suggest.default
Configuration of one suggest wizard field in a flex form field of one table for a specific target query table:
TCEFORM.[tableName].[fieldName].[dataStructureKey].[sheetName].[flexFieldName].suggest.[queryTable]

suggest.additionalSearchFields

suggest.additionalSearchFields

suggest.additionalSearchFields
Type
string

Comma-separated list of fields the suggest wizard should also search in. By default the wizard looks only in the fields listed in the label and label_alt of TCA ctrl properties.

suggest.addWhere

suggest.addWhere

suggest.addWhere
Type
string

Additional WHERE clause (with AND at the beginning).

Markers possible for replacement:

Example: limit storage_pid to the children of a certain page
EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.storage_pid.suggest.default {
    addWhere = AND pages.pid=###PAGE_TSCONFIG_ID###
}
Copied!

suggest.cssClass

suggest.cssClass

suggest.cssClass
Type
string

Add a CSS class to every list item of the result list.

EXT:site_package/Configuration/page.tsconfig
TCEFORM.suggest.pages {
    # Configure all suggest wizards which list records from table "pages"
    # to add the CSS class "pages" to every list item of the result list.
    cssClass = pages
}
Copied!

suggest.hide

suggest.hide

suggest.hide
Type
boolean

Hide the suggest field. Works only for single fields.

Example: Hide the suggest field for the storage_pid
EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.storage_pid.suggest.default {
    hide = 1
}
Copied!

suggest.maxPathTitleLength

suggest.maxPathTitleLength

suggest.maxPathTitleLength
Type
positive integer

Maximum number of characters to display when a path element is too long.

Example: Limit the suggest field to 30 characters
EXT:site_package/Configuration/page.tsconfig
TCEFORM.suggest.default {
    maxPathTitleLength = 30
}
Copied!

suggest.minimumCharacters

suggest.minimumCharacters

suggest.minimumCharacters
Type
positive integer
Default
2

Minimum number of characters needed to start the search. Works only for single fields.

Example: Start the suggest search after 3 characters
EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.storage_pid.suggest.default {
    minimumCharacters = 3
}
Copied!

suggest.pidDepth

suggest.pidDepth

suggest.pidDepth
Type
positive integer

Expand pidList by this number of levels. Only has an effect, if pidList has a value.

Example: Set search depth for suggest field
EXT:site_package/Configuration/page.tsconfig
TCEFORM.suggest.default {
    pidList = 6,7
    pidDepth = 4
}
Copied!

suggest.pidList

suggest.pidList

suggest.pidList
Type
list of values

Limit the search to certain pages (and their subpages). When pidList is empty all pages will be included in the search as long as the backend user is allowed to see them.

Example: Limit suggest search to records on certain pages
EXT:site_package/Configuration/page.tsconfig
TCEFORM.suggest.default {
    # sets the pidList for a suggest fields in all tables
    pidList = 1,2,3,45
}
Copied!

suggest.receiverClass

suggest.receiverClass

suggest.receiverClass
Type
Fully Qualified PHP class name
Default
\TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver

PHP class alternative receiver class - the file that holds the class should be derived from \TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver.

suggest.renderFunc

suggest.renderFunc

suggest.renderFunc
Type
string

User function to manipulate the displayed records in the result.

suggest.searchCondition

suggest.searchCondition

suggest.searchCondition
Type
string

Additional WHERE clause (no AND needed to prepend).

Example: Only search on pages with doktype=1
EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.storage_pid.suggest.default {
    # Configure the suggest wizard for the field "storage_pid" in table "pages"
    # to search only for pages with doktype=1
    searchCondition = doktype=1
}
Copied!

suggest.searchWholePhrase

suggest.searchWholePhrase

suggest.searchWholePhrase
Type
boolean
Default
0

Whether to do a LIKE=%mystring% (searchWholePhrase = 1) or a LIKE=mystring% (to do a real find as you type).

Example: Search only for whole phrases
EXT:site_package/Configuration/page.tsconfig
TCEFORM.pages.storage_pid.suggest.default {
    # Configure the suggest wizard for the field "storage_pid" in table "pages" to search only for whole phrases
    searchWholePhrase = 1
}
Copied!

TCEMAIN

Configuration for the TYPO3 Core Engine (DataHandler). For general information, see the according section of TYPO3 Explained.

Properties

clearCacheCmd

clearCacheCmd

clearCacheCmd
Type
List of integers, all, pages or tags

This allows you to have the frontend cache for additional pages cleared when saving to some page or branch of the page tree.

It it possible to trigger clearing of all caches or just the pages cache. It is also possible to target precise pages either by referring to their ID numbers or to tags that are attached to them.

Attaching tags to page cache is described in the TypoScript Reference.

Example: Clear the cache for certain pages when a record is changed

EXT:site_package/Configuration/page.tsconfig
TCEMAIN {
    # Clear the cache for page uid 12 and 23 when saving a record in this page
    clearCacheCmd = 12, 23
    # Clear all frontent page caches of pages
    clearCacheCmd = pages
    # Clear ALL caches
    clearCacheCmd = all
    # Clear cache for all pages tagged with tag "pagetag1"
    clearCacheCmd = cacheTag:pagetag1
}
Copied!

clearCache_disable

clearCache_disable

clearCache_disable
Type
boolean

If set, then the automatic clearing of page cache when records are edited etc. is disabled. This also disables the significance of the two options clearCache_pageSiblingChildren and clearCache_pageGrandParent

clearCache_pageGrandParent

clearCache_pageGrandParent

clearCache_pageGrandParent
Type
boolean

If set, then the grand parent of a page being edited will have the page cache cleared.

clearCache_pageSiblingChildren

clearCache_pageSiblingChildren

clearCache_pageSiblingChildren
Type
boolean

If set, then children of all siblings of a page being edited will have the page cache cleared.

Default is that when a page record is edited, the cache for itself, the parent, and siblings (same level) is cleared.

disableHideAtCopy

disableHideAtCopy

disableHideAtCopy
Type
boolean

Disables the hideAtCopy TCA feature if configured for the table.

Example: Do not hide pages when they are copy-pasted

EXT:site_package/Configuration/page.tsconfig
TCEMAIN.table.pages {
   # Pages will *not* have "(copy)" appended:
   disablePrependAtCopy = 1
   # Pages will *not* be hidden upon copy:
   disableHideAtCopy = 1
}
Copied!

These settings adjust that a page which is copied will neither have "(copy X)" appended nor be hidden.

The last page in this tree, labeled "Test", is used as original to be copied. The first sub page was copied using the settings from the above example: It is labeled "Test" and is visible exactly like the original page. The page "Test (copy 2)" in the middle was in contrast copied in default mode: The page is hidden and the "(copy X)" suffix is added, if another page with the same named existed already.

Hidden page with added suffix after copying its original page

Hidden page with added suffix after copying its original page

Example: Apply disableHideAtCopy as default to all tables

EXT:site_package/Configuration/page.tsconfig
TCEMAIN.default {
  disableHideAtCopy = 1
}
Copied!

disablePrependAtCopy

disablePrependAtCopy

disablePrependAtCopy
Type
boolean

Disable the prependAtCopy TCA feature if configured for the table.

The word "prepend" is misleading. The "(copy)" label is actually appended to the record title.

Example: Do not append the "(copy)" label to newly copied pages

EXT:site_package/Configuration/page.tsconfig
TCEMAIN.table.pages {
   # Pages will *not* have "(copy)" appended:
   disablePrependAtCopy = 1
   # Pages will *not* be hidden upon copy:
   disableHideAtCopy = 1
}
Copied!

These settings adjust that a page which is copied will neither have "(copy X)" appended nor be hidden.

The last page in this tree, labeled "Test", is used as original to be copied. The first sub page was copied using the settings from the above example: It is labeled "Test" and is visible exactly like the original page. The page "Test (copy 2)" in the middle was in contrast copied in default mode: The page is hidden and the "(copy X)" suffix is added, if another page with the same named existed already.

Hidden page with added suffix after copying its original page

Hidden page with added suffix after copying its original page

Example: Apply disablePrependAtCopy as default to all tables

EXT:site_package/Configuration/page.tsconfig
TCEMAIN.default {
  disablePrependAtCopy = 1
}
Copied!

linkHandler

linkHandler

linkHandler
Type
array of link handler configurations

Contains an array of link handler configurations.

handler
Fully qualified name of the class containing the backend link handler.
configuration
Configuration for the link handler, depends on the handler. For \TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler configuration.table must be defined.
scanBefore / scanAfter
Define the order in which handlers are queried when determining the responsible tab for editing an existing link.
displayBefore / displayAfter
Define the order of how the various tabs are displayed in the link browser.

Example: Display an additional tab in the linkbrowser

The following page TSconfig display an additional tab with the label as title in the linkbrowser. It then saves the link in the format t3://record?identifier=my_content&uid=123. To render the link in the frontend you need to define the same key in the TypoScript setup config.recordLinks.

Page TSconfig definition for identifier my_content
TCEMAIN.linkHandler.my_content {
    handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler
    label = LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:link.customTab
    configuration {
        table = tx_myextension_content
    }
    scanBefore = page
}
Copied!

permissions

Value copyFromParent

The value copyFromParent can be set for each of the page TSconfig TCEMAIN.permissions.* sub keys. If this value is set, the page access permissions are copied from the parent page.

Example: Inherit the group id of the parent page
EXT:my_extension/Configuration/page.tsconfig
TCEMAIN.permissions {
    groupid = copyFromParent
    group = 31
    everybody = 0
}
Copied!

By default all new pages created by users will inherit the group of the parent page. Members of this group get all permissions. Users not in the group get no permissions.

When an administrator creates a new page she can use the module System > Access to set a different owner group for this new page.

All subpages created to this new page will now automatically have the new pages group. The administrator does not have to set custom TSconfig to achieve this.

This behaviour is similar to the "group sticky bit" in Unix for directories.

everybody

permissions.everybody

permissions.everybody
Type
list of strings or integer 0-31
Default
0

Default permissions for everybody who is not the owner user or member of the owning group, key list: show, edit, delete, new, editcontent.

Alternatively, it is allowed to set an integer between 0 and 31, indicating which bits corresponding to the key list should be set: show = 1, edit = 2, delete = 4, new = 8, editcontent = 16.

It also possible to set the value copyFromParent to inherit the value from the parent page.

Example: Set permissions defaults so that everybody can see the page
EXT:site_package/Configuration/page.tsconfig
TCEMAIN.permissions {
  # Everybody can at least see the page, normally everybody can do nothing
  everybody = show
}
Copied!

The page "Community" was created with the settings from the example above. Compared to the two other pages created with default permissions you can see the effect: "Everybody" has read access:

Page with altered permissions for backend users, groups and everybody

Page with altered permissions for backend users, groups and everybody

group

permissions.group

permissions.group
Type
list of strings or integer 0-31
Default
show,edit,new,editcontent
Default permissions for group members, key list: show, edit, new,
editcontent.

Alternatively, it is allowed to set an integer between 0 and 31, indicating which bits corresponding to the key list should be set: show = 1, edit = 2, delete = 4, new = 8, editcontent = 16.

It also possible to set the value copyFromParent to inherit the value from the parent page.

Example: Set permission defaults so that the group can do anything but delete a page
EXT:site_package/Configuration/page.tsconfig
TCEMAIN.permissions {
    # Group can do anything, normally "delete" is disabled
    group = 31
}
Copied!

The page "Community" was created with the settings from the example above. Compared to the two other pages created with default permissions you can see the effect: The Backend Group can now also delete the page by default:

Page with altered permissions for backend users, groups and everybody

Page with altered permissions for backend users, groups and everybody

groupid

permissions.groupid

permissions.groupid
Type
positive integer or string

By default the owner group of a newly created page is set to the main group of the backend user creating the page.

By setting the value of this property to copyFromParent the owner group is copied from the newly created pages parent page.

The owner group of a newly created page can be hardcoded by setting this property to a positive integer greater then zero.

Example: Set default user group for permissions on new pages
EXT:site_package/Configuration/page.tsconfig
TCEMAIN {
    # Owner be_groups UID for new pages
    permissions.groupid = 3
}
Copied!

In this instance, backend group with UID 3 is "test_group". With the configuration above a new page would be created with this group setting instead of the default, even if a user who is not member of that group creates the page:

Page with altered permissions for backend users and groups

Page with altered permissions for backend groups

user

permissions.user

permissions.user
Type
list of strings or integer 0-31
Default
show,edit,delete,new,editcontent

Default permissions for owner user, key list: show, edit, delete, new, editcontent.

Alternatively, it is allowed to set an integer between 0 and 31, indicating which bits corresponding to the key list should be set: show = 1, edit = 2, delete = 4, new = 8, editcontent = 16.

It also possible to set the value copyFromParent to inherit the value from the parent page.

Example: Set permission defaults so that the pages owner can do anything
EXT:site_package/Configuration/page.tsconfig
TCEMAIN.permissions {
    # User can do anything, this is identical to the default value
    user = 31
}
Copied!

userid

permissions.userid

permissions.userid
Type
positive integer or string

By default the owner of a newly created page is the user that created or copied the page.

By setting the value of this property to copyFromParent the owner group is copied from the newly created pages parent page.

When this property is set to a positive integer the owner of new pages is hardcoded to the user of that uid.

Example: Set default user for permissions on new pages
EXT:site_package/Configuration/page.tsconfig
TCEMAIN {
    # Owner be_users UID for new pages
    permissions.userid = 2
}
Copied!

In this instance, backend user with UID 2 is "test". With the configuration above a new page would be created with this owner setting instead of the default, even if another user creates the page:

Page with altered permissions for backend users

Page with altered permissions for backend users

preview

preview

preview
Type
array

Configure preview link generated for the save+view button and other frontend view related buttons in the backend. This allows to have different preview URLs depending on the record type. A common use case is to have previews for blog or news records, and this feature allows you to define a different preview page for content elements as well, which might be handy if those are stored in a sysfolder.

EXT:site_package/Configuration/page.tsconfig
TCEMAIN.preview {
    disableButtonForDokType = 199, 254, 255
    <table name> {
        previewPageId = 123
        useDefaultLanguageRecord = 0
        fieldToParameterMap {
            uid = tx_myext_pi1[showUid]
        }
        additionalGetParameters {
            tx_myext_pi1.special = HELLO # results in tx_myext_pi1[special]
        }
    }
}
Copied!

The previewPageId is the uid of the page to use for preview. If this setting is omitted the current page will be used. If the current page is not a normal page, the root page will be chosen.

The disableButtonForDokType setting allows you to disable the preview button for a given list of doktypes. If none are configured, this defaults to: 199, 254, 255 (Spacer, Folder and Recycler).

The useDefaultLanguageRecord defaults to 1 and ensures that translated records will use the uid of the default record for the preview link. You may disable this, if your extension can deal with the uid of translated records.

The fieldToParameterMap is a mapping which allows you to select fields of the record to be included as GET-parameters in the preview link. The key specifies the field name and the value specifies the GET-parameter name.

Finally additionalGetParameters allow you to add arbitrary GET-parameters and even override others. If the plugin on your target page shows a list of records by default you will also need something like tx_myext_pi1.action = show to ensure the record details are displayed.

The core automatically sets the "no_cache" and the "L" parameter. The language matches the language of the current record. You may override each parameter by using the additionalGetParameters configuration option.

table

Processing options for tables. The table name is added, for instance TCEMAIN.table.pages.disablePrependAtCopy = 1 or TCEMAIN.table.tt_content.disablePrependAtCopy = 1.

It is also possible to set a default value for all tables, for example TCEMAIN.default.disablePrependAtCopy = 1.

translateToMessage

translateToMessage

translateToMessage
Type
string
Default
Translate to %s:

Defines the string that will be prepended to some field values if you copy an element to another language version. This applies to all fields where the TCA columns property l10n_mode is set to prefixLangTitle.

The special string "%s" will be replaced with the language title.

You can globally disable the prepending of the string by setting translateToMessage to an empty string. You can disable the message to a certain field by setting the l10n_mode to an empty string.

Example: Set a German prefix for newly translated records

PageTSconfig
TCEMAIN {
    translateToMessage = Bitte in "%s" übersetzen:
}
Copied!

Example: Disable the "[Translate to ...]" prefix

PageTSconfig
TCEMAIN {
    translateToMessage =
}
Copied!

templates

All Fluid templates rendered by backend controllers can be overridden with own templates on a per-file basis. The feature is available for basically all core backend modules, as well as the backend main frame templates. Exceptions are email templates and templates of the install tool.

Basic syntax

The various combinations are best explained by example:

The linkvalidator extension (its composer name is typo3/cms-linkvalidator) comes with a backend module in the Web main section. The page tree is displayed for this module and linkvalidator has two main views and templates:

Resources/Private/Templates/Backend/Report.html for the Report view and another for the Check link view. To override the Backend/Report.html file with a custom template, this definition can be added to the Configuration/page.tsconfig file of an extension:

EXT:site_package/Configuration/page.tsconfig
# Left pattern (before equal sign): templates."composer-name"."something-unique"
# Right pattern (after equal sign): "overriding-extension-composer-name":"entry-path"
templates.typo3/cms-linkvalidator {
    1643293191 = my-vendor/my-extension:Resources/Private/TemplateOverrides
}
Copied!

If the target extension, identified by its composer name my-vendor/my-extension, provides the Resources/Private/TemplateOverrides/Templates/Backend/Report.html file, this file is used instead of the default template file from the linkvalidator extension.

All core extensions follow the general structure for templates, layouts and partials file. If an extension needs to override a partial that is located in Resources/Private/Partials/SomeName/SomePartial.html, and an override has been specified like above to my-vendor/my-extension:Resources/Private/TemplateOverrides, the system looks for the Resources/Private/TemplateOverrides/Partials/SomeName/SomePartial.html file. Similar is the case for layouts.

Template overriding is based on the existence of files: Two files are never merged. An override definition either takes effect because it actually provides a file at the correct position with the correct file name, or it does not and the default is used. This can become impractical for large template files. In such cases it might be an option to request a split of a large template file into smaller partial files so an extension can override a specific partial only.

Combinations of overrides

Due to the nature of TSconfig and its two types page TSconfig and user TSconfig, various combinations are possible:

  • Define "global" overrides with page TSconfig in Configuration/page.tsconfig of an extension. This works for all modules, regardless of whether the module renders a page tree or not.
  • Define page level overrides via the TSconfig field of page records. As always with page TSconfig, subpages and subtrees inherit these settings from their parent pages.
  • Define overrides on user or (better) group level. As always, user TSconfig can override page TSconfig by prefixing any setting available as page TSconfig with page. in user TSconfig. A user TSconfig template override starts with page.templates. instead of templates..

Usage in own modules

Extensions with backend modules that use the simplified backend module template API automatically enable the general backend template override feature. Extension authors do not need to further prepare their extensions to enable template overrides by other extensions.

tx_*

The tx_ prefix key is not used in the Core itself, and is just a reserved space for extensions to never collide with core options, a use case could be tx_news for the news extension. Extension developers should create a key like that: tx_[extension key with no underscore]

auth

The auth key is used for configuration of authentication services.

Properties

Name Type
string
boolean
string, comma separated list of strings
string

auth.BE.redirectToURL

auth.BE.redirectToURL
Type
string

Specifies a URL to redirect to after login is performed in the backend login form. This has been used in the past to redirect a backend user to the frontend to use frontend editing.

auth.mfa.required

auth.mfa.required
Type
boolean

Require multi-factor authentication for a user. This overrules the global configuration and can therefore also be used to unset the requirement by using 0 as value.

EXT:site_package/Configuration/user.tsconfig
auth.mfa.required = 1
Copied!

auth.mfa.disableProviders

auth.mfa.disableProviders
Type
string, comma separated list of strings
Example
Example: Disable a multi-factor authentication provider

Disable multi-factor authentication providers for the current user or group. It overrules the configuration from the Backend usergroup "Access List". This means, if a provider is allowed in "Access List" but disallowed with TSconfig, it will be disallowed for the user or user group.

auth.mfa.recommendedProvider

auth.mfa.recommendedProvider
Type
string
Example
Example: Set a recommended multi-factor authentication provider

Set a recommended multi-factor authentication provider on a per user or user group basis, which overrules the global configuration.

Examples

Example: Disable a multi-factor authentication provider

EXT:site_package/Configuration/user.tsconfig
auth.mfa.disableProviders := addToList(totp)
Copied!

options

Various options for the user affecting the Core at various points.

As an example, this enables the Flush frontend caches button in the upper right toolbar cache menu for non-admin users:

EXT:site_package/Configuration/user.tsconfig
options.clearCache.pages = 1
Copied!

Properties

Name Type Default
list of sys_language IDs
bitmask 255 (show all warnings)
Array of integers / strings
boolean 0
boolean 0
integer (0-20) 3
list of items
list of dashboard identifiers default
list or tiles tiles
string
boolean
boolean
boolean 1
list of keywords selectable
boolean true
list of keywords selectable
integer 40
string view,metadata,translations,delete
integer 64
integer 64
string Cancel
list of "storageUid:folderName" items
integer 3
list of module groups or modules
list of page IDs
boolean 0
boolean 0
boolean
boolean
list of integers
boolean
string 1,6,4,7,3,254,255,199
list of integers
list of page IDs
boolean
boolean
boolean
boolean
boolean 1
boolean
boolean / "top" 1
boolean 1
boolean 0
boolean
comma separated list

additionalPreviewLanguages

additionalPreviewLanguages
Type
list of sys_language IDs

The user will see these additional languages when localizing stuff in TCEforms. The list are IDs of site languages, as defined in the languageId property of the site configuration.

alertPopups

alertPopups
Type
bitmask
Default
255 (show all warnings)

Configure which Javascript popup alerts have to be displayed and which not:

  • 1 – onTypeChange
  • 2 – copy / move / paste
  • 4 – delete
  • 8 – FE editing
  • 128 – other (not used yet)

bookmarkGroups

bookmarkGroups
Type
Array of integers / strings

Set groups of bookmarks that can be accessed by the user. This affects the bookmarks toolbar item in the top right of the backend.

By default, 5 default groups will be defined globally (shared, can only be set by admins) and also for each user (personal bookmarks):

  1. Pages
  2. Records
  3. Files
  4. Tools
  5. Miscellaneous

Set 0 to disable one of these group IDs, 1 to enable it (this is the default) or "string" to change the label accordingly.

Example:

EXT:site_package/Configuration/user.tsconfig
bookmarkGroups {
  1 = 1
  2 = My Group
  3 = 0
  4 =
}
Copied!

Bookmark group 1 is loaded with the default label (Pages), group 2 is loaded and labeled as "My Group" and groups 3 and 4 are disabled. Group 5 has not been set, so it will be displayed by default, just like group 1.

New in version 11.0

Custom language labels can also be used instead of a fixed label:

EXT:site_package/Configuration/user.tsconfig
bookmarkGroups {
  2 = LLL:EXT:sitepackage/Resources/Private/Language/locallang_be.xlf:bookmarkGroups.2
}
Copied!

clearCache

clearCache

all

all
Type
boolean
Default
0
Path
options.clearCache.all

This will allow a non-admin user to clear frontend and page-related caches, plus some backend-related caches (that is everything including templates); if it is explicitly set to 0 for an admin user, it will remove the clear all option on toolbar for that user.

pages

pages
Type
boolean
Default
0
Path
options.clearCache.pages

If set to 1, this will allow a non-admin user to clear frontend and page-related caches.

clipboardNumberPads

clipboardNumberPads
Type
integer (0-20)
Default
3

This allows you to enter how many pads you want on the clipboard.

contextMenu.table.[tableName][.context].disableItems

contextMenu.table.[tableName][.context].disableItems
Type
list of items

List of context menu ("clickmenu") items to disable.

Context menu of the page tree

Context menu of the page tree

The [tableName] refers to the type of the record (database table name) the context menu is shown for, for example, pages, sys_file, tt_content, etc.

The optional key [.context] refers to the place from which the context menu is triggered. The Core uses just one context called tree for context menus triggered from page tree and folder tree. This way you can disable certain options for one context, but keep them for another.

Items to disable for "page" type are:

  • view
  • edit
  • new
  • info
  • copy
  • copyRelease
  • cut
  • cutRelease
  • pasteAfter
  • pasteInto
  • newWizard
  • pagesSort
  • pagesNewMultiple
  • openListModule
  • mountAsTreeRoot
  • hideInMenus
  • showInMenus
  • permissions
  • enable
  • disable
  • delete
  • history
  • clearCache

Items to disable for "sys_file" type (that is files/folders) are:

  • edit
  • rename
  • upload
  • new
  • info
  • copy
  • copyRelease
  • cut
  • cutRelease
  • pasteInto
  • delete

When the system extension Import/Export (EXT:impexp) is installed then two more options become available:

  • exportT3d
  • importT3d

Example:

EXT:site_package/Configuration/user.tsconfig
# Remove "New" and "Create New wizard" for pages context menu (list module)
options.contextMenu.table.pages.disableItems = new,newWizard

# Remove "New" and "Create New wizard" in page tree context menu
options.contextMenu.table.pages.tree.disableItems = new,newWizard

# Remove the "More options" item in the page tree context menu and all its subelements
options.contextMenu.table.pages.tree.disableItems = newWizard, pagesSort, pagesNewMultiple, openListModule, mountAsTreeRoot, exportT3d, importT3d, hideInMenus, showInMenus, permissions
Copied!

dashboard

dashboard

dashboardPresetsForNewUsers

dashboardPresetsForNewUsers
Type
list of dashboard identifiers
Default
default
Path
options.dashboard.dashboardPresetsForNewUsers

List of dashboard identifiers to be used on initial dashboard module access.

Example:

EXT:site_package/Configuration/user.tsconfig
options.dashboard.dashboardPresetsForNewUsers := addToList(customDashboard)
Copied!

defaultResourcesViewMode

defaultResourcesViewMode
Type
list or tiles
Default
tiles

The option options.defaultResourcesViewMode has been introduced, which allows to define the initial display mode. Valid values are therefore list and tiles, e.g.:

The listing of resources in the TYPO3 Backend, e.g. in the File > Filelist module or the FileBrowser can be changed between list and tiles. TYPO3 serves by default tiles, if the user has not already made a choice.

EXT:site_package/Configuration/user.tsconfig
options.defaultResourcesViewMode = list
Copied!

defaultUploadFolder

defaultUploadFolder
Type
string

When a user uploads files they are stored in the default upload folder of the first file storage that user may access. The folder is used for uploads in the TCEforms fields. In general, this will be fileadmin/user_upload/.

With this property it is possible to set a specific upload folder.

The syntax is "storage_uid:file_path".

Example:

EXT:site_package/Configuration/user.tsconfig
options.defaultUploadFolder = 2:user_folders/my_folder/
Copied!

disableDelete

disableDelete
Type
boolean

Disables the Delete button in TCEFORMs.

Note, it is possible to set this for single tables using options.disableDelete.<tableName>. Any value set for a single table will override the default value set for disableDelete.

Example:

EXT:site_package/Configuration/user.tsconfig
options.disableDelete.tt_content = 1
Copied!

dontMountAdminMounts

dontMountAdminMounts
Type
boolean

This options prevents the root to be mounted for an admin user.

enableBookmarks

enableBookmarks
Type
boolean
Default
1

Enables the usage of bookmarks in the backend.

file_list

file_list

enableClipBoard

enableClipBoard
Type
list of keywords
Default
selectable
Path
options.file_list.enableClipBoard

Determines whether the checkbox Show clipboard in the file list module is shown or hidden. If it is hidden, you can predefine it to be always activated or always deactivated.

The following values are possible:

activated
The option is activated and the checkbox is hidden.
deactivated
The option is deactivated and the checkbox is hidden.
selectable
The checkbox is shown so that the option can be selected by the user.

displayColumnSelector

displayColumnSelector
Type
boolean
Default
true
Path
options.file_list.displayColumnSelector

The column selector is enabled by default and can be disabled with this option. The column selector is displayed at the top of each file list.

It can be used to manage the fields displayed for each file / folder, while containing convenience actions such as "filter", "check all / none" and "toggle selection".

The fields to be selected are a combination of special fields, such as references or read/write permissions, the corresponding sys_file record fields, as well as all available sys_file_metadata fields.

Example:

EXT:site_package/Configuration/user.tsconfig
# Disable the column selector
file_list.displayColumnSelector = 0
Copied!

file_list.enableDisplayThumbnails

file_list.enableDisplayThumbnails
Type
list of keywords
Default
selectable

Determines whether the checkbox Display thumbnails in the file list module is shown or hidden. If it is hidden, you can predefine it to be always activated or always deactivated.

The following values are possible:

activated
The option is activated and the checkbox is hidden.
deactivated
The option is deactivated and the checkbox is hidden.
selectable
The checkbox is shown so that the option can be selected by the user.

filesPerPage

filesPerPage
Type
integer
Default
40
Path
options.file_list.filesPerPage

The maximum number of files shown per page in the File > List module.

primaryActions

primaryActions
Type
string
Default
view,metadata,translations,delete
Path
options.file_list.primaryActions

Option to add more primary actions to the list view, which are otherwise only accessible through the "..." menu in the file list module.

The list of actions to be displayed can be given in the TSConfig of the backend user. The actions that can be set are

  • copy
  • cut
  • delete
  • download
  • edit
  • info
  • metadata
  • paste
  • rename
  • replace
  • translations (always active)
  • updateOnlineMedia
  • upload
  • view

Example:

EXT:site_package/Configuration/user.tsconfig
# This will add "copy", "cut" and "replace" buttons in addition to the three default
# buttons. "translations" can be omitted, as it will be added by default,
# if a TYPO3 site is set up multilingual.
options.file_list.primaryActions = view,metadata,delete,copy,cut,replace
Copied!
Show primary action with additional copy, cut and replace buttons

See option primaryActions with three default buttons and the three additional buttons "copy", "cut" and "replace". As there is no TYPO3 site set up multilingual the button "translations" is not rendered in that TYPO3 environment.

thumbnail.height

thumbnail.height
Type
integer
Default
64
Path
options.file_list.thumbnail.height

All preview images in the file list will be rendered with the configured thumbnail height.

thumbnail.width

thumbnail.width
Type
integer
Default
64
Path
options.file_list.thumbnail.width

All preview images in the file list will be rendered with the configured thumbnail width.

uploader.defaultAction

uploader.defaultAction
Type
string
Default
Cancel
Path
options.file_list.uploader.defaultAction

Default action for the modal that appears when during file upload a name collision occurs. Possible values:

cancel
Abort the action.
rename
Append the file name with a numerical index.
replace
Override the file with the uploaded one.

folderTree

folderTree

altElementBrowserMountPoints

altElementBrowserMountPoints
Type
list of "storageUid:folderName" items
Path
options.folderTree.altElementBrowserMountPoints

Sets alternative filemounts for use in any folder tree, including in the File > List module, in the element browser and in file selectors.

Each item consists of storage UID followed by a colon and the folder name inside that storage. Separate multiple items by a comma.

For backwards compatibility, defining only a folder name but no storage uid and colon prepended is still supported. Folders without a storage UID prepended are assumed to be located in the default storage, which by default is the fileadmin/ folder. If a folder you specify does not exist it will not get mounted.

Settings this option is effective in workspaces too.

The alternative file mounts are added to the existing ones defined in the user or group configuration.

Example:

EXT:site_package/Configuration/user.tsconfig
options.folderTree.altElementBrowserMountPoints = _temp_/, 2:/templates, 1:/files/images
Copied!

uploadFieldsInLinkBrowser

uploadFieldsInLinkBrowser
Type
integer
Default
3
Path
options.folderTree.uploadFieldsInLinkBrowser

This value defines the number of upload fields in the element browser. Default value is 3, if set to 0, no upload form will be shown.

hideModules

hideModules
Type
list of module groups or modules

Configure which module groups or modules should be hidden from the main menu.

Example:

EXT:site_package/Configuration/user.tsconfig
# Hide only module groups "file" and "help"
options.hideModules = file, help

# Hide additional modules "info" and "ts" from the "web" group
options.hideModules := addToList(web_info, web_ts)

# Hide only module BeLogLog from "system" group
options.hideModules = system_BelogLog
Copied!

hideRecords

hideRecords

pages

pages
Type
list of page IDs
Path
options.hideRecords.pages

This setting hides records in the backend user interface. It is not an access restriction but makes defined records invisible. That means in principle those records can still be edited if the user rights allow. This makes sense if only a specialized module should be used to edit those otherwise hidden records.

This option is currently implemented for the pages table only and has an effect in the following places:

  • Page tree navigation frame
  • Web > List module
  • New record wizard

Example:

EXT:site_package/Configuration/user.tsconfig
options.hideRecords.pages = 12,45
Copied!

impexp

impexp

enableExportForNonAdminUser

enableExportForNonAdminUser
Type
boolean
Default
0
Path
options.impexp.enableExportForNonAdminUser

The import/export module of EXT:impexp is disabled by default for non-admin users. Enable this option, if non-admin users need to use the module and export data. This should only be enabled for trustworthy backend users, as it might impose a security risk.

enableImportForNonAdminUser

enableImportForNonAdminUser
Type
boolean
Default
0
Path
options.impexp.enableImportForNonAdminUser

The import/export module of EXT:impexp is disabled by default for non-admin users. Enable this option, if non-admin users need to use the module and import data. This should only be enabled for trustworthy backend users, as it might impose a security risk.

mayNotCreateEditBookmarks

mayNotCreateEditBookmarks
Type
boolean

If set, the user can not create or edit bookmarks.

noThumbsInEB

noThumbsInEB
Type
boolean

If set, then image thumbnails are not shown in the element browser.

pageTree

pageTree

overridePageModule

overridePageModule

Changed in version 13.0

This setting has been removed.

In order to replace the Web > Page module within a third-party extension, such as TemplaVoila, it is possible to create a custom module entry in an extension's Configuration/Backend/Modules.php with the following entry:

EXT:my_extension/Configuration/Backend/Modules.php
return [
    'my_module' => [
        'parent' => 'web',
        'position' => ['before' => '*'],
        'access' => 'user',
        'aliases' => ['web_layout'],
        'path' => '/module/my_module',
        'iconIdentifier' => 'module-page',
        'labels' => 'LLL:EXT:backend/Resources/Private/Language/locallang_mod.xlf',
        'routes' => [
            '_default' => [
                'target' => \MyVendor\MyExtension\Controller\MyController::class . '::mainAction',
            ],
        ],
    ],
];
Copied!

altElementBrowserMountPoints

altElementBrowserMountPoints
Type
list of integers
Path
options.pageTree.altElementBrowserMountPoints

Sets alternative webmounts for use in the element browser. You separate page IDs by a comma. Non-existing page IDs are ignored. If you insert a non-integer it will evaluate to "0" (zero) and the root of the page tree is mounted. Effective in workspaces too.

These alternative webmounts replace configured DB mount points unless you use the altElementBrowserMountPoints.append option.

Example:

EXT:site_package/Configuration/user.tsconfig
options.pageTree.altElementBrowserMountPoints = 34,123
Copied!

altElementBrowserMountPoints.append

altElementBrowserMountPoints.append
Type
boolean
Path
options.pageTree.altElementBrowserMountPoints.append

This option allows administrators to add additional mount points in the RTE and the wizard element browser instead of replacing the configured database mount points of the user when using the existing user TSconfig option.

Example:

EXT:site_package/Configuration/user.tsconfig
options.pageTree.altElementBrowserMountPoints = 34,123
options.pageTree.altElementBrowserMountPoints.append = 1
Copied!

doktypesToShowInNewPageDragArea

doktypesToShowInNewPageDragArea
Type
string
Default
1,6,4,7,3,254,255,199
Path
options.pageTree.doktypesToShowInNewPageDragArea

If set, the node top panel feature can be configured by a comma-separated list. Each number stands for a doktype ID that should be added to the node top panel.

Top panel in normal mode

Top panel in normal mode

Top panel modified

Top panel modified

excludeDoktypes

excludeDoktypes
Type
list of integers
Path
options.pageTree.excludeDoktypes

Excludes nodes (pages) with one of the defined doktypes from the page tree. Can be used, for example, for hiding custom doktypes.

Example:

EXT:site_package/Configuration/user.tsconfig
options.pageTree.excludeDoktypes = 254,1
Copied!

label.<page-id>

label.<page-id>
Type
list of page IDs
Path
options.pageTree.label.<page-id>

New in version 13.1

This setting is the successor of the removed -.

Labels offer customizable color markings for tree nodes and require an associated label for accessibility.

Example:

EXT:my_extension/Configuration/user.tsconfig
options.pageTree.label.296 {
  label = Campaign A
  color = #ff8700
}
Copied!

Display:

Page with configured color and label

Page with configured color and label

showDomainNameWithTitle

showDomainNameWithTitle
Type
boolean
Path
options.pageTree.showDomainNameWithTitle

If set, the domain name will be appended to the page title for pages that have Is root of web site? checked in the page properties. Useful if there are several domains in one page tree.

showNavTitle

showNavTitle
Type
boolean
Path
options.pageTree.showNavTitle

If set, the navigation title is displayed in the page navigation tree instead of the normal page title. The page title is shown in a tooltip if the mouse hovers the navigation title.

showPageIdWithTitle

showPageIdWithTitle
Type
boolean
Path
options.pageTree.showPageIdWithTitle

If set, the titles in the page tree will have their ID numbers printed before the title.

showPathAboveMounts

showPathAboveMounts
Type
boolean
Path
options.pageTree.showPathAboveMounts

If set, the user db mount path above the mount itself is shown. This is useful if you work a lot with user db mounts.

Active user db mount

Active user db mount

passwordReset

passwordReset
Type
boolean
Default
1

If set to 0 the initiating of the password reset in the backend will be disabled. This does not affect the password reset by CLI command.

To completely disable the password reset in the backend for all users, you can set the user TSconfig globally in your Configuration/user.tsconfig:

EXT:site_package/Configuration/user.tsconfig
options.passwordReset = 0
Copied!

If required, this setting can be overridden on a per user basis in the corresponding TSconfig field of the backend usergroup or user.

The password reset functionality can also be disabled globally by setting:

config/system/settings.php | typo3conf/system/settings.php
$GLOBALS['TYPO3_CONF_VARS']['BE']['passwordReset'] = false
Copied!

saveClipboard

saveClipboard
Type
boolean

If set, the clipboard content will be preserved for the next login. Normally the clipboard content lasts only during the session.

saveDocNew

saveDocNew
Type
boolean / "top"
Default
1

If set, a button Save and create new will appear in TCEFORMs.

Note, it is possible to set this for single tables using options.saveDocNew.[tableName]. Any value set for a single table will override the default value set for saveDocNew.

Example:

In this example the button is disabled for all tables, except tt_content where it will appear, and in addition create the records in the top of the page (default is after instead of top).

EXT:site_package/Configuration/user.tsconfig
options.saveDocNew = 0
options.saveDocNew.tt_content = top
Copied!

saveDocView

saveDocView
Type
boolean
Default
1

If set, a button Save and view will appear in TCEFORMs.

Note, it is possible to set this for single tables using options.saveDocView.[tableName]. Any value set for a single table will override the default value set for saveDocView.

showDuplicate

showDuplicate
Type
boolean
Default
0

If set, a button Duplicate will appear in TCEFORMs.

Note, that it is possible to set this for single tables using options.showDuplicate.[tableName]. Any value set for a single table will override the default value set for showDuplicate.

showHistory

showHistory
Type
boolean

Shows link to the history for the record in TCEFORMs.

Note, it is possible to set this for single tables using options.showHistory.[tableName]. Any value set for a single table will override the default value set for showHistory.

hideSets

hideSets
Type
comma separated list

Hides existing Site sets from the list of available sets for backend users, in case only a curated list of sets shall be selectable:

EXT:my_extension/Configuration/user.tsconfig
options.sites.hideSets := addToList(typo3/fluid-styled-content)
Copied!

The Site Management > Sites GUI will not show hidden sets, but makes one exception if a hidden set has already been applied to a site

In this case a set marked as hidden will be shown in the list of currently activated sets (that means it can be introspected and removed via backend UI).

page

Override any page TSconfig property on a user or group basis by prefixing the according property path with page.. Find more information about this in the Using and setting section.

Example:

EXT:site_package/Configuration/user.tsconfig
page.TCEMAIN.table.pages.disablePrependAtCopy = 1
Copied!

permissions

Set permissions on a user or group basis. This is especially useful for access permissions on files and folders as part of the Digital assets management (FAL) of the core.

Read more about FAL access permissions in the permission chapter of the core API document, but find some examples below:

EXT:site_package/Configuration/user.tsconfig
# Allow to create and upload files on all storages
permissions.file.default.addFile = 1

# Allow to add new folders if user has write permissions on parent folder
permissions.file.default.addFolder = 1

# Allow to edit contents of files on FAL storage with uid 1
permissions.file.storage.1.writeFile = 1
Copied!

setup

Default values and override values for the User Settings module.

The User > User settings module may only represent a subset of the options from the table below.

Default values and overriding values in the "User > User settings" module

Default values and overriding values in the User > User settings module

The following properties are available:

Properties

setup.default.[someProperty]

setup.default.[someProperty]
Type
any

With this property you can set default values. In case a backend user may override these settings using its User Settings module the default settings will be overridden for this specific backend user. To change the defaults for users with this property only affects new users who did not login yet. It is usually not possible to set new defaults for users who already logged in, at least once. The only way to apply new defaults to existing users is by Reset Backend User Preferences in the Admin tools > Maintenance section of the install tool.

EXT:site_package/Configuration/user.tsconfig
[backend.user.isAdmin]
    # Some settings an administrator might find helpful
    setup.default {
        recursiveDelete = 1
        copyLevels = 99
        moduleData {
            # Defaulting some options of the Template/TypoScript backend module
            web_ts {
                # Pre-select 'Object browser' instead of 'Constant editor'
                function = TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController
                # Pre-select 'Setup' instead of 'Constants'
                ts_browser_type = setup
                # The other settings
                ts_browser_const = subst
                ts_browser_fixedLgd = 0
                ts_browser_showComments = 1
            }
        }
    }
[END]
Copied!

setup.override.[someProperty]

setup.override.[someProperty]
Type
mixed

This forces values for the properties of the list below, a user can not override these setting in its User settings module. So, overriding values will be impossible for the user to change himself and no matter what the current value is, the overriding value will overrule it.

setup.fields.[fieldName].disabled

setup.fields.[fieldName].disabled
Type
boolean

On top of being able to set default values or override them, it is also possible to hide fields in the User Settings module, using setup.fields.[fieldName].disabled = 1. You can find the names of the fields in the Configuration module by browsing the "User Settings" array, example:

EXT:site_package/Configuration/user.tsconfig
# Do not show the 'emailMeAtLogin' field to the user in "User Settings" module
setup.fields.emailMeAtLogin.disabled = 1

# And force the value of this field to be set to 1
setup.override.emailMeAtLogin = 1
Copied!

backendTitleFormat

backendTitleFormat
Type
string

Format of window title in backend. Possible values:

titleFirst
[title] · [sitename]
sitenameFirst
[sitename] · [title]

copyLevels

copyLevels
Type
positive integer

Recursive Copy: Enter the number of page sub-levels to include, when a page is copied

edit_docModuleUpload

edit_docModuleUpload
Type
boolean

Allow file upload directly from file reference fields within backend forms.

emailMeAtLogin

emailMeAtLogin
Type
boolean

Notify me by email, when somebody logs into my account

lang

lang
Type
language-key

One of the language keys. For current options see Supported languages, for example dk, de, es etc.

neverHideAtCopy

neverHideAtCopy
Type
boolean

If set, then the hideAtCopy feature for records in TCE will not be used.

showHiddenFilesAndFolders

showHiddenFilesAndFolders
Type
boolean

If set, hidden files and folders will be shown in the filelist.

startModule

startModule
Type
string

Name of the module that is called when the user logs into the backend, for example web_layout, web_list, web_view, web_info, web_ts etc.

titleLen

titleLen
Type
positive integer

Maximum length of rendered record titles in the backend interface. It is used in several places: page tree, edit masks, workspace module, etc.

TCAdefaults

This allows to set or override the default values of TCA fields that is available for various TCA types, for instance for type=input.

The full path of a setting include the table and the field name: TCAdefaults.[table name].[field]

This key is also available on Page TSconfig level, the order of default values when creating new records in the backend is this:

  1. Value from $GLOBALS['TCA']
  2. Value from User TSconfig (these settings)
  3. Value from Page TSconfig
  4. Value from "defVals" GET variables
  5. Value from previous record based on 'useColumnsForDefaultValues'

However the order for default values used by \TYPO3\CMS\Core\DataHandling\DataHandler if a certain field is not granted access to for user will be:

  1. Value from $GLOBALS['TCA']
  2. Value from User TSconfig (these settings)

So these values will be authoritative if the user has no access to the field anyway.

Example:

EXT:site_package/Configuration/user.tsconfig
# Show newly created pages by default
TCAdefaults.pages.hidden = 0
Copied!

If 'hidden' is in the list, it gets overridden with the "neighbor" record value (see \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::setDefaultsFromNeighborRow) and as the value is set - usually to '0' - it will not be overridden again. To make it work as expected, that value must be overridden. This can be done for example in the Configuration/TCA/Overrides folder of an extension:

EXT:site_package/Configuration/TCA/Overrides/pages.php
$GLOBALS['TCA']['pages']['ctrl']['useColumnsForDefaultValues'] = 'doktype,fe_group';
Copied!

tx_*

The tx_ prefix key is not used in the core itself, and is just a reserved space for extensions to never collide with core options, a use case could be tx_news for the news extension. Extension developers should create a key like that: tx_[extension key with no underscore]

PHP and TypoScript

ContentObjectRenderer

ContentObjectRenderer::cObjGetSingle(value, properties[, TSkey = '__'])

A method of \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer . Gets a content object from the $conf array.

Example:

$content = $cObjectRenderer->cObjGetSingle($conf['image'], $conf['image.'], 'My Image 2');
Copied!

This would return any IMAGE cObject at the property image of the $conf array for the include script!

ContentObjectRenderer::stdWrap(value, properties)

A method of \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer .

Hands the content in "value" to the stdWrap function, which will process it according to the configuration of the array "properties".

Example:

$content = $cObjectRenderer->stdWrap($content, $conf['stdWrap.']);
Copied!

This will stdWrap the content with the properties of .stdWrap of the $conf array!

TypoScriptFrontendController, TSFE

Deprecated since version 13.4

You can retrieve the \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController via the request attribute frontend.controller.

For instance, if you want to access the variable id, you can do so by writing: TypoScriptFrontendController->id.

TypoScriptFrontendController->id

Changed in version 13.0

The property has been marked as read-only. Use $request->getAttribute('frontend.page.information')->getId() instead. See Frontend page information.

id

id
Type
integer

The current page id

TypoScriptFrontendController->type

Changed in version 13.0

The property has been removed with TYPO3 v13.0. See Migration

type

type
Type
integer

Migration from $GLOBALS['TSFE']->type

When using this property in PHP code via $GLOBALS['TSFE']->type , it is recommended to move to the PSR-7 request via $request->getAttribute('routing')->getPageType().

TypoScriptFrontendController->page

Changed in version 13.0

The property has been marked as read-only. Use $request->getAttribute('frontend.page.information')->getPageRecord() instead. See Frontend page information.

page

page
Type
array

The page record

TypoScriptFrontendController->feuser

Changed in version 13.0

The variable has been removed with TYPO3 v13. See Migration

fe_user

fe_user
Type
array

The frontend user record

Migration: Use UserAspect or context instead of $GLOBALS['TSFE']->fe_user

There are two possible migrations.

First, a limited information list of frontend user details can be retrieved using the Context aspect frontend.user in frontend calls. See class \TYPO3\CMS\Core\Context\UserAspect for a full list. The current context can be retrieved using dependency injection. Example:

EXT:my_extension/Classes/Controller/MyExtensionController.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use TYPO3\CMS\Core\Context\Context;

final class MyExtensionController
{
    public function __construct(
        private readonly Context $context,
    ) {}

    public function myAction()
    {
        $frontendUserUsername = $this->context->getPropertyFromAspect(
            'frontend.user',
            'username',
            '',
        );
    }
}
Copied!

Additionally, the full \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication object is available as request attribute frontend.user in the frontend. Note some details of that object are marked @internal, using the context aspect is thus the preferred way. Example of an extension using the Extbase's ActionController:

EXT:my_extension/Classes/Controller/MyExtensionController.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

final class MyExtensionController extends ActionController
{
    public function myAction(): ResponseInterface
    {
        // Note the 'user' property is marked @internal.
        $frontendUserUsername = $this->request
            ->getAttribute('frontend.user')->user['username'];
        $this->view->assign('username', $frontendUserUsername);
        return $this->htmlResponse();
    }
}
Copied!

TypoScriptFrontendController->rootLine

Changed in version 13.0

The property has been marked as read-only. Use $request->getAttribute('frontend.page.information')->getRootLine() instead. See Frontend page information.

rootLine

rootLine
Type
array

The root line (all the way to tree root, not only the current site!).

The current site root line is available via $request->getAttribute('frontend.page.information')->getLocalRootLine(). See Frontend page information.

In TYPO3 versions before v13 the current site root line was only available via \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->config['rootLine'].

TypoScriptFrontendController->table-row

Changed in version 13.0

rootLine

rootLine
Type
object

The object with page functions (object) See EXT:core/Classes/Domain/Repository/PageRepository.php.

Glossary

We use the terms as explained in TypoScript Syntax, with some modifications:

We differentiates between Object paths, Objects, properties and values.

To reuse the OOP analogy and compare with PHP:

TypoScript Configuration PHP classes
property property
object (is defined by / is an instantiation of an object type) object (is defined by / is an instantiation of a class)
object type = complex data type class
simple datatype PHP primitive data type
text = TEXT $text = new Text()

Example 1 (assign value to property in object1:

EXT:site_package/Configuration/TypoScript/setup.typoscript
object1 = OBJECTTYPE1
object1 {
   property = value
}
Copied!

Example 2:

EXT:site_package/Configuration/TypoScript/setup.typoscript
# here, object1 is defined as type OBJECTTYPE1
#   "OBJECTTYPE1" is an object type, so is OTHER
object1 = OBJECTTYPE1
object1 {
   object2 = OTHER
   object2 {
      property = value
   }
}
Copied!

Note: OBJECTTYPE1 and OTHER are not real object types (as used in TypoScript) and are used here only to illustrate the example.

Variable:
Is anything on the left side of an assignment, e.g. in Example 1, the variable is property, the full variable path is object.property. The variable can be a property with a simple datatype or an "object type".
Property:
(= simple variable) A variable with a simple data type. The terms "object" and "property" are mutually exclusive. "Object" and "property" are both "variables".
"Object":
In the context of TypoScript configuration, objects are complex variables and have a complex data type. They contain one or more variables.
Value:
The right side of the assignment. It must be of the correct data type.
Data type
Variables usually have a fixed data type. It may be a simple data type (such as a string) or it may be a complex data type (= Object Type).
Simple data type
!= Complex data type. If a variable has a simple data type, it cannot be assigned an object. Hence, it is a property.
Object type
= complex data type. If a variable is an object and thus has a complex data type, it will contain several variables. In example 2 above, object1 has a complex data type, as does object2, but not property. Complex data types are usually spelled in full caps, e.g. CONTENT, TEXT, PAGE etc. The exception is the abstract complex data type cObject from which the data type CONTENT, TEXT etc. are derived.
Object path:
The full path of an object. In the example above object1.object2 is an object path
Variable path
The full path of a variable. In the example above object1.object2.property is a variable path.
cObject data type
This is an (abstract) complex data type. Specific cObject data types, such as TEXT, IMAGE etc. are all cObject data types. They are usually used for content elements.
Top level objects
As described in TypoScript syntax TypoScript configuration is converted into a multidimensional PHP array. You can view this in the Submodule "Active TypoScript". Top level objects are located on the top level. Top level objects are for example config, page and plugin.

Sitemap