config
: TypoScript configuration
The config
top-level object does not have to be initialized. Configuration
can be set like this:
# TypoScript
config {
headerComment = Made with ❤ by your TYPO3 Documentation Team
}
Table of content
Properties of 'config'
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 | |
string / stdWrap | |
string | |
integer | |
boolean | |
boolean | |
boolean | |
boolean | |
target | |
list | |
string | |
string | |
boolean | |
string | |
boolean | |
list of PIDs / string | |
string :Example:setup-config-namespaces | |
boolean | |
integer | |
string | |
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
-
- Type
- string
- Special value
- "auto"
If set, this string is prepended to all relative links that TYPO3 generates.
config.
means TYPO3 auto-detects the site root from path prefixes rather than host name variables on the server, making this value safe for multi-domain environments.abs Ref Prefix = auto If config.forceAbsoluteUrls is enabled
abs
is overridden.Ref Prefix Using an URI in
abs
will require additional conditions if you use different domains for your deployment stages in CI environments.Ref Prefix 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), set
abs
to the URL and path of your site, e.g.Ref Prefix https://
. If you do not, you risk rendering pages to cache from the internal network and thereby prefixing image references and links with incorrect or inaccessible paths.example. org/
additionalHeaders
-
- Type
- numerically indexed array of "HTTP header entries".
- Example
- set additional headers data
config.
allows additional HTTP headers to be configured. An entry has the following structure:additional Headers 10.
header = the header string - This value is required.
10.
replace = 0 | 1 - Optional, boolean. Default value is
1
. If1
the header will replace an existing header with the same name. 10.
http Response Code = 201 - Optional, integer. The 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' and then any additional headers. Finally, a "Content-Length" header is sent, if enabled via Properties of 'config'.
admPanel
-
- Type
- boolean
config.
enables the admin panel. See Configuration in the Admin Panel manual.adm Panel = 1
ATagParams
-
- Type
- <A>-params
Additional parameters for 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 be determined by start and stop times of content elements on that page, as well as arbitrary records on any other page. The page needs to be configured so that TYPO3 knows which records' start and stop times to take into account. Otherwise, the cache entry might be used although a start/stop date has already passed by.
To include records of type <table name> on page <pid> in the cache lifetime calculation of page <page-id>, add the following TypoScript:
EXT:site_package/Configuration/TypoScript/setup.typoscriptconfig.cache.<page-id> = <table name>:<storage-pid>
Copied!Multiple record sources can be added as a comma-separated list. See examples.
Use the keyword "all" instead of a <page-id> to take all records from all pages into account for the cache lifetime calculation.
Use the keyword "current" instead of a <storage-pid> to take only records on the current page into account for the cache lifetime calculation.
cache_clearAtMidnight
-
- Type
- boolean
- Default
0
This setting ensures that the cache expires at midnight on the day that the page is scheduled to expire.
cache_period
-
- Type
- integer
- Default
86400
(= 24 hours)
The number of seconds a page can remain in the cache.
This value is overridden by the value in the page record
field="cache_
if that value is greater than zero.timeout"
compressCss
-
- Type
- boolean
- Default
0
- Example
- Config compress CSS example
If set, CSS files referenced in
page.
, etc, will be minified and compressed. It has no effect on files which are referenced ininclude CSS page.
.header Data Minification will remove excess space. A higher level of compression (using gzip) requires
$GLOBALS
to be enabled in the Install Tool. For it to work you also need to activate gzip- related compressionLevel options in['TYPO3_ CONF_ VARS'] ['FE'] ['compression Level'] .htaccess
, otherwise the compressed files will not be readable by the user agent.Hint
Enabling concatenation and/or compression requires several filesystem operations and can considerably impact frontend request time performance, especially for uncached pages. For optimal performance, you should prefer to pre-bundle as many CSS/JS assets as possible via a frontend buildchain. Also, you can try to utilize HTTP/2 multiplexing on your webserver, which performs much better than HTTP/1 for requesting multiple small files. It also leverages distinct cacheability of these CSS/JS assets.
Most servers can be configured to dynamically compress specific file types on-the-fly, which is preferable to using application-level compression.
TYPO3 comes with a built-in compression handler, but you can also register your own using
$GLOBALS
.['TYPO3_ CONF_ VARS'] ['FE'] ['css Compress Handler'] $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
in the Install Tool wil compress frontend JavaScript files referenced in['TYPO3_ CONF_ VARS'] ['FE'] ['compression Level'] page.
, etc, using GZIP compression. It has no effect on files which are referenced ininclude JS page.
.header Data Please note that this requires
.htaccess
to be modified, otherwise the files will not be readable by the user agent. Please see the description of$GLOBALS
in the Install Tool.['TYPO3_ CONF_ VARS'] ['FE'] ['compression Level'] Hint
Enabling concatenation and/or compression requires several filesystem operations and can considerably impact frontend request time performance, especially for uncached pages. For optimal performance, you should prefer to pre-bundle as many CSS/JS assets as possible via a frontend buildchain. Also, you can try to utilize HTTP/2 multiplexing on your webserver, which performs much better than HTTP/1 for requesting multiple small files. It also leverages distinct cacheability of these CSS/JS assets.
Most servers can be configured to dynamically compress specific file types on-the-fly, which is preferable to using application-level compression.
TYPO3 comes with a built-in compression handler, but you can also register your own using
$GLOBALS
.['TYPO3_ CONF_ VARS'] ['FE'] ['js Compress Handler'] $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.
merges frontend stylesheet files referenced in page.includeCSS, etc. Files are merged only if their media attribute has the same value, e.g. if it is "all" for several files. It has no effect on files which are referenced inconcatenate Css page.
.header Data Hint
Enabling concatenation and/or compression requires several filesystem operations and can considerably impact frontend request time performance, especially for uncached pages. For optimal performance, you should prefer to pre-bundle as many CSS/JS assets as possible via a frontend buildchain. Also, you can try to utilize HTTP/2 multiplexing on your webserver, which performs much better than HTTP/1 for requesting multiple small files. It also leverages distinct cacheability of these CSS/JS assets.
Most servers can be configured to dynamically compress specific file types on-the-fly, which is preferable to using application-level compression.
TYPO3 comes with a built-in concatenation handler, but you can also register your own using
$GLOBALS
.['TYPO3_ CONF_ VARS'] ['FE'] ['css Concatenate Handler'] $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.
merges frontend JavaScript files referenced inconcatenate Js page.
, etc. It has no effect on files which are referenced ininclude JS page.
.header Data If all the files are marked with an async flag, an async attribute is assigned to the script tag.
Hint
Enabling concatenation and/or compression requires several filesystem operations and can considerably impact frontend request time performance, especially for uncached pages. For optimal performance, you should prefer to pre-bundle as many CSS/JS assets as possible via a frontend buildchain. Also, you can try to utilize HTTP/2 multiplexing on your webserver, which performs much better than HTTP/1 for requesting multiple small files. It also leverages distinct cacheability of these CSS/JS assets.
Most servers can be configured to dynamically compress specific file types on-the-fly, which is preferable to using application-level compression.
TYPO3 comes with a built-in concatenation handler, but you can also register your own using
$GLOBALS
.['TYPO3_ CONF_ VARS'] ['FE'] ['js Concatenate Handler'] $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- content Object Exception Handler
Exceptions which occur during the rendering of content objects (typically plugins) are caught by default in a production context. An error message is displayed with the rendered output.
If there is an exception, the page will remain available while the section of the page that produces the error (i.e. throws an exception) will show a configurable error message. By default the error message contains a random code referencing the exception and the error is logged by the logging framework for developer reference.
Important
Instead of a whole page breaking when an exception occurs, an error message is displayed just in the part of the page that is broken. Be aware that a page displaying an error message can get cached.
To get rid of the error message, the error needs to be fixed and the cache must be cleared for the page.
debug
-
- Type
- boolean
If set, debug information for the TypoScript code is sent. This applies to menu objects and parse-time output. The parse-time will be sent in HTTP response header
X-
.TYPO3- Parsetime
disableAllHeaderCode
-
- Type
- boolean
- Default
0
- Example
- Provide JSON and disable HTML headers
If this is not set or set to
0
, the PAGE object type in TypoScript outputs a HTML skeleton, see Output of the PAGE object.To disable the default behaviour set
disable
. The page then consists of only the cObject array (1,2,3,4...) output of the PAGE object type in TypoScript.All Header Code = 1 Use this feature for templates for content types other than HTML, for example images, RSS-feeds or ajax requests in an XML or JSON format.
This property can also be used to generate complete HTML pages, including the
<html>
and<body>
tags.
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</
is not affected and will still be generated.body> disable
takes precedence overBody Tag body
,Tag CObject body
andTag body
in the PAGE object type in TypoScript properties. IfTag Add config.
then the other settings are ignored and won't have any effect.disable Body Tag = 1
disableCanonical
-
- Type
- boolean
If the SEO system extension is installed, canonical tags are generated 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 by setting it to
1
.
disableHrefLang
-
- Type
- boolean
If the SEO system extension is installed, hreflang tags are generated in multi-language setups. By settings this option to
1
the rendering of the tags will be skipped.
disablePrefixComment
-
- Type
- boolean
disablePreviewNotification
-
- Type
- boolean
- Default
0
Disables the "preview" notification box.
disableLanguageHeader
-
- Type
- boolean
- Default
0
TYPO3 by default sends a
Content-
HTTP header, where "XX" is the ISO code of the relevant language. The value is based on the language defined in the Site Configuration.language: XX If
config.
is set, this header will not be sent.disable Language Header
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.
See config.htmlTag_setParams for more details on the effect on the HTML tag.
It defaults to the HTML 5 doctype:
<!DOCTYPE html>
Copied!
enableContentLengthHeader
-
- Type
- boolean
- Default
1
If set, the header "content-length: [bytes of content]" is sent.
This is disabled if a backend user is logged in. The reason is that the content length header cannot include the length of these objects and the content-length will truncate 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
If this option is set, all links, image references or assets previously built with a relative or absolute path (for example,
/fileadmin/
) will be rendered as absolute URLs with the site prefix / current domain.my- pdf. pdf An example of a possible use case is generating a static version of a TYPO3 site for sending a page via email.
Note
Setting this option will override config.absRefPrefix and any typolink forceAbsoluteUrl options.
forceTypeValue
-
- Type
- boolean
Force the
&type
value of TYPO3 generated links to a specific value (except if overruled by localforce
values).Type Value This is useful if you have a template with special content, for example
&type=95
, but still want to keep your targets neutral. Then you can set your targets to blank and this value to your required type value.
headerComment
-
- Type
- string
This content is added above the "TYPO3 Content Management Framework" comment in the <head> page section. Use this to insert text like "Programmed by My-Agency".
htmlTag.attributes.[attribute]
-
- Type
- string / stdWrap
- Example
- setup-config-htmltag-attributes
Changed in version 14.0
It is now possible to use stdWrap options as a subkey for an attribute, for example, userFunc, override and Data / getText.
Sets the
<html>
tag attributes on the page. Allows attributes to be customized and overridden using TypoScript without having to re-add attributes generated by siteHandling.This property supersedes the previous
config.
option by providing a more flexible API to add attributes.html Tag_ set Params config.htmlTag.attributes.my-attribute = 123
Copied!config.htmlTag.attributes.my-attribute = 123 config.htmlTag.attributes.my-attribute.userFunc = MyVendor\MyExtension\HtmlTagEnhancer->overrideMyAttribute
Copied!
htmlTag_setParams
-
- Type
- string
- Example
- htmlTag_setParams example
Sets the
<html>
tag attributes on the page. If you set Properties of 'config' to a keyword that enables XHTML then some attributes will already be set. This property allows you to override preset attributes with your own content.Special: If you set it to "none" then setting attributes is no longer possible.
If you have set
html
this property (Tag. attributes html
) will not have any effect.Tag_ set Params
htmlTag_stdWrap
index_descrLgd
-
- Type
- integer
- Default
200
This indicates how many chars to preserve in the description of an indexed page. This can be used in search result output.
index_enable
-
- Type
- boolean
Enables cached pages to be indexed.
Automatically enabled when
indexed_
is enabled.search
index_externals
-
- Type
- boolean
If set, external media linked to on pages is indexed.
Automatically enabled when
indexed_
is enabled.search
index_metatags
-
- Type
- boolean
- Default
1
This allows the indexing of metatags to be switched on or off. It is switched on by default.
inlineStyle2TempFile
-
- Type
- boolean
- Default
1
- Example
- inlineStyle2TempFile example
If set, the inline styles TYPO3 controls in the core are written to the
typo3temp/
file and the header then contains just a link to the stylesheet.assets/ css/ stylesheet\_ [hashstring]. css The file hash is based 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_
, which is passed on in links in TYPO3. It is compiled into a string stored inGET_ VARS $GLOBALS
['TSFE']->link Vars The values are rawurlencoded in PHP.
You can specify a range of valid values by appending a () after each value. If the range doesn't match, the variable won't be appended to links. This prevents the cache system getting flooded with forged values.
The range can contain one of the following values:
[a]-
[b] - A range of allowed integer values
int
- Only integer values are allowed
[a]\
| [b]\ | [c] - A list of allowed strings (whitespace will be removed)
/
[regex]/ - Match a regular expression (PCRE style)
You can use the pipe character (|) to access nested properties.
Note
Do not include the
type
andL
parameters in the linkVars list as this will result in unexpected behavior.
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).
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 :typoscript
MP_
, you can ensure consistency and reduce the risk of broken links or incorrect content being displayed due to missing parameters.defaults
MP_disableTypolinkClosestMPvalue
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 have been specified prior to the call to
\TYPO3\
.CMS\ Frontend\ Typolink\ Page Link Builder 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 can be significant - any ID in a branch which has already been processed (by a previous ID root point) will not be processed again.
Configured IDs have to be the uids of actual mount point pages, 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 thepages
cache, meaning that the rendered result/response will not be saved to cache.If set to
0
, it is ignored. The rendered result (e.g. full html of a page) is stored in thepages
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 settingconfig.
you can change dynamic (non-cacheable) content from USER to USER_INT (COA to COA_INT).no_ cache For more information about cache types see the 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 output.Please note that this tag is required for (X)HTML compliant output, so you should only disable this tag if you have already generated it manually.
pageRendererTemplateFile
-
- Type
- string
- Default
- file:
EXT:
core/ Resources/ Private/ Templates/ Page Renderer. html
Sets the template for page renderer class
\TYPO3\
.CMS\ Core\ Page\ Page Renderer
pageTitle
-
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 title tags in the format "website: page title".
If
page
is set (and if the page title is printed), then the page title will be printed before the template title, i.e. "page title: website".Title First
pageTitleProviders
-
- Type
- array
In order to set page titles, an API is available. The API uses
Page
to set the page title based on the page record and the content on that page.Title Providers Based on the priority of providers,
Page
will check the providers to see if they have titles. It will start with the highest priorityTitle Provider Manager Page
.Title Providers
pageTitleSeparator
-
- Type
- array
- Default
:
(colon with following space)- Example
- Use custom separators between page title parts
The symbols ouput in the title tag between the website name and the page title. If
page
is set, but no sub-properties are defined, then a space will be added to the end of the separator. stdWrap can be used to adjust whitespace at the beginning and end of the separator.Title Separator
recordLinks
-
- Type
- array of link configurations
Frontend TypoScript definition for identifiermy_
content config.recordLinks.my_content { // If the record is hidden do not force link generation 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
-
Remove CSS generated by the _CSS_DEFAULT_STYLE extension property. (
_CSS_
outputs a set of default styles for extensions with frontend plugins)DEFAULT_ STYLE
removeDefaultJS
-
- Type
- boolean / string
- Example
- Remove default external JavaScript and all default CSS
If set, default JavaScript in the header will be removed.
The default JavaScript decrypts email addresses.
Special case: If the value is set to the string
external
, then the default JavaScript is written to a temporary file and included in that file. See inlineStyle2TempFile example.
sendCacheHeaders
-
- Type
- boolean
If set, TYPO3 will output cache-control headers to the client based on whether the page was internally cached. 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
*_
orINT *_
objects are on the page (e.g. USER and USER_INT)EXT - No frontend users are logged in
- No backend users are 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
If caching is not allowed, the following headers are sent to avoid client caching:
- Cache-Control: private, no-store
Notice that enabling browser caches means you will 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 a log. There should be ways to circumvent these problems but they are outside the domain of TYPO3.
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 make TYPO3 regenerate the page. A good tip worth knowing about!
showWebsiteTitle
-
- Type
- boolean
- Default
- 1
This 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, set the option to
0
.
spamProtectEmailAddresses
-
- Type
-10
to10
- Example
- Spam protect email addresses automatically
If set, 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 method is an offset of character values. If you set this value to "-2" all characters will have their ASCII value offset by "-2". It works by adding a small piece of JavaScript code to every web page.
(It is recommended to set the option to a value between -5 to 1 since setting it to >= 2 means a "z" is converted to "|" which is a special character in TYPO3 table syntax – which might lead to confusion.)
Default JavaScript needs to be enabled. (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 plugins that have TypoScript configuration, but that don't 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 could, of course, be properly handled 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
-
typolink
Add custom attributes to the anchor tag.Link Access Restricted Pages. ATag Params
typolinkLinkAccessRestrictedPages_addParams
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:
-
Prefixing all links with a "/" results in absolute link paths:
EXT:site_package/Configuration/TypoScript/setup.typoscriptconfig.absRefPrefix = /
Copied! -
Prefixing all links with a path to a subdirectory:
EXT:site_package/Configuration/TypoScript/setup.typoscriptconfig.absRefPrefix = /some-subsite/
Copied! -
Prefixing all links with a URI scheme:
EXT:site_package/Configuration/TypoScript/setup.typoscriptconfig.absRefPrefix = https://example.org/
Copied!
set additional headers data
- Demonstrates:
-
General usage
EXT:site_package/Configuration/TypoScript/setup.typoscriptconfig.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! -
General usage, same usage, alternate notation
EXT:site_package/Configuration/TypoScript/setup.typoscriptconfig.additionalHeaders.10.header = foo config.additionalHeaders.10.replace = 0 config.additionalHeaders.10.httpResponseCode = 401 config.additionalHeaders.20.header = Cache-control: Private
Copied! -
Set content type for a page returning JSON
EXT:site_package/Configuration/TypoScript/setup.typoscriptjson = 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_
records on page 2 in the cache lifetime
calculation for page 10:
config.cache.10 = fe_users:2
This includes records from multiple sources;
fe_
records on page 2 and
tt_
records on page 11:
config.cache.10 = fe_users:2,tt_news:11
Take
fe_
records on storage page 2 into account for the cache lifetime of all
pages:
config.cache.all = fe_users:2
Each page's cache lifetime is affected if fe_users stored on the same page are changed:
config.cache.all = fe_users:current
Config compress CSS example
- Demonstrates:
config.compressCss = 1
Config compress JavaScript
- Demonstrates:
config.compressJs = 1
Concatenate CSS Example
- Demonstrates:
config.concatenateCss = 1
concatenateJs
- Demonstrates:
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
}
contentObjectExceptionHandler example
- Demonstrates:
# 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
Provide JSON and disable HTML headers
A page type providing JSON:
json = PAGE
json {
typeNum = 1617455215
10 =< tt_content.list.20.tx_myextension_myjsonplugin
config {
disableAllHeaderCode = 1
additionalHeaders.10.header = Content-type:application/json
}
}
HTML tag attributes example
- Demonstrates:
config.htmlTag.attributes.class = no-js
Results in :
<html lang="fr" class="no-js">
config.htmlTag.attributes.amp =
Results in :
<html lang="fr" amp>
Warning
If you are using
html
the property
htmlTag_setParams example will not have any effect.
Note
Please note that the lang
attribute in these examples are auto-generated by
site handling, depending on the value added there.
htmlTag_setParams example
- Demonstrates:
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
inlineStyle2TempFile example
- Demonstrates:
config.inlineStyle2TempFile = 0
Add &print
parameter to all links
- Demonstrates:
config.linkVars = print
This will add &print=
to all links in TYPO3.
config.linkVars = tracking|green(0-5)
In the above configuration, GET parameter &tracking
would
be kept, but tracking
would not be kept.
Customize workspace display box
- Demonstrates:
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>
Define mounting point defaults for certain pages
- Demonstrates:
config.MP_defaults = 36,37,48 : 2-207
This will by default add &MP=2-
to all links pointing to pages
36,37 and 48.
Define Dublin Core Metadata Element Set (dc) xmlns namespace
- Demonstrates:
config.namespaces.dc = http://purl.org/dc/elements/1.1/
config.namespaces.foaf = http://xmlns.com/foaf/0.1/
This configuration will result in an
<html>
tag like:
<html xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
Set a custom page renderer template
- Demonstrates:
config.pageRendererTemplateFile = EXT:my_extension/Resources/Private/Templates/TestPagerender.html
Reorder the default page title providers
- Demonstrates:
By default, TYPO3 ships with two providers:
config.pageTitleProviders {
record {
provider = TYPO3\CMS\Core\PageTitle\RecordPageTitleProvider
}
seo {
provider = TYPO3\CMS\Seo\PageTitle\SeoTitlePageTitleProvider
before = record
}
}
The order of 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
before
and
after
.
Note
The
seo
PageTitleProvider is only available if the SEO system
extension is installed.
You can find information about creating your own PageTitleProviders in the section PageTitle API.
Use custom separators between page title parts
- Demonstrates:
This produces a title tag with the format "website . page title":
config.pageTitleSeparator = .
This produces a title tag with the format "website - page title":
config.pageTitleSeparator = -
config.pageTitleSeparator.noTrimWrap = | | |
This produces a title tag with the format "website*page title":
config.pageTitleSeparator = *
config.pageTitleSeparator.noTrimWrap = |||
If you want to remove the web page title from the 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:
config.pageTitleSeparator = *
config.pageTitle.stdWrap {
split {
token = *
returnKey = 1
}
}
Remove default external JavaScript and all default CSS
- Demonstrates:
config {
removeDefaultJS = external
removeDefaultCss = 1
}
Spam protect email addresses automatically
- Demonstrates:
config {
spamProtectEmailAddresses = -2
spamProtectEmailAddresses_atSubst = (at)
spamProtectEmailAddresses_lastDotSubst = (dot)
}
Define configuration for custom namespaces
- Demonstrates:
config.tx_realurl_enable = 1
config.tx_myextension.width = 10
config.tx_myextension.length = 20
Define custom styling for access restricted page links
- Demonstrates:
config {
typolinkLinkAccessRestrictedPages = 29
typolinkLinkAccessRestrictedPages.ATagParams = class="restricted"
typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID###
}
Will create a link to the page with id 29 and add GET parameters with the return URL and original page id. Additionally, CSS class "restricted" is added to the anchor tag.