CONFIG & config

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 display 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
boolean
-10 to 10
string
string
array
integer (page id) / keyword "NONE"
string
string
string
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
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 true, 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
Type
boolean

config.admPanel = 1 can be used to enable the admin panel. See Configuration in the Admin Panel manual.

ATagParams
Type
<A>-params

Additional parameters to all links in TYPO3 (excluding menu-links).

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
Type
boolean
Default
false

With this setting the cache always expires at midnight of the day, the page is scheduled to expire.

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

This can significantly reduce file sizes of linked JavaScript files and thus decrease loading times.

Please note that this requires .htaccess to be adjusted, as otherwise the files will not be readable by the user agent. Please see the description of $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] in the Install Tool.

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

$GLOBALS['TYPO3_CONF_VARS']['FE']['jsCompressHandler'] =
    \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('my_extension') .
    'Classes/JsCompressHandler.php:MyVendor\MyExtension\JsCompressHandler->compressJs';
Copied!
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
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
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
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
Type
boolean
Default
false
Example
Provide JSON and disable HTML headers

If this is not set or set to false, 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
Type
boolean
Default
false

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

disableHrefLang
Type
boolean

When the system extension SEO is installed, hreflang tags are generated automatically in multi-language setups. By settings this option to true the rendering of those tags will be skipped.

disablePrefixComment
Type
boolean

If set, the stdWrap property prefixComment will be disabled, thus preventing any revealing and space-consuming comments in the HTML source code.

disablePreviewNotification
Type
boolean
Default
0

Disables the "preview" notification box completely.

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
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
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
Type
target
Default
_top

Default external target. Used by typolink if no extTarget is set.

fileTarget
Type
target

Default file link target. Used by typolink if no fileTarget is set.

forceAbsoluteUrls
Type
boolean
Default
0

New in version 12.1

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
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
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
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
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
Type
stdWrap

Modify the whole <html> tag with stdWrap functionality. This can be used to extend or override this tag.

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
Type
boolean

Enables cached pages to be indexed.

Automatically enabled when indexed_search is enabled.

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
Type
boolean
Default
true

This allows to turn on or off the indexing of metatags. It is turned on by default.

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
Type
target

Default internal target. Used by typolink if no target is set.

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
Type
string

Alternative message in HTML that appears when the preview function is active.

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
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
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
Type
boolean

If set, the typolink function will not try to find the closest MP value for the id.

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]
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
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
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
Type
string
Default
file:EXT:core/Resources/Private/Templates/PageRenderer.html

Sets the template for page renderer class TYPO3\CMS\Core\Page\PageRenderer.

pageTitle
Type
stdWrap

stdWrap for the page title. This option will be executed after all other processing options like Properties of 'config'.

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

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

showWebsiteTitle
Type
boolean
Default
1

New in version 12.0

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
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
Type
string
Default
(at)
Example
Spam protect email addresses automatically

Substitute label for the at-sign (@).

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]_[*]
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
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
Type
string
Example
Define custom styling for access restricted page links

New in version 12.3

typolinkLinkAccessRestrictedPages.ATagParams Add custom attributes to the anchor tag.

typolinkLinkAccessRestrictedPages_addParams
Type
string
Example
Define custom styling for access restricted page links
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_lastDotSubst = (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!