Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
TypoScript configuration
Each Extbase extension has some settings which can be modified using TypoScript.
Many of these settings affect aspects of the internal configuration of Extbase
and Fluid. There is also a block settings
in which you can
set extension specific settings that can be accessed in the controllers and
templates of your extension.
All TypoScript settings are made in the following TypoScript blocks:
plugin.tx_[lowercasedextensionname]
The TypoScript configuration of the extension is always located below this
TypoScript path. The "lowercase extension name" is the extension key with no
underscore (_), as for example in blogexample
. The configuration is divided into
the following sections:
Features
Activate features for Extbase or a specific plugin.
features.
skip Default Arguments - Skip default arguments in URLs. If a link to the default controller or action is created, the
parameters are omitted.
Default is
false
. features.
ignore All Enable Fields In Be - Ignore the enable fields in backend.
Default is
false
.
Persistence
Settings, relevant to the persistence layer of Extbase.
persistence.
enable Automatic Cache Clearing - Enables the automatic cache clearing when changing data sets.
Default is
true
. persistence.
storage Pid - List of Page-IDs, from which all records are read.
Settings
Here reside are all the domain-specific extension settings. These settings are
available in the controllers as the array variable $this->settings
and in any Fluid
template with {settings}
.
Tip
The settings allow you to pass arbitrary information to a template, even for 3rd-party extensions. Just make sure you prefix them with a unique vendor to prevent collisions with further updates of the extensions.
View
View and template settings.
view.
layout Root Paths - This can be used to specify the root paths for all Fluid layouts in this
extension. If nothing is specified, the path
extension
is used. All layouts that are necessary for this extension should reside in this folder.Name/ Resources/ Private/ Layouts view.
partial Root Paths - This can be used to specify the root paths for all Fluid partials in this
extension. If nothing is specified, the path
extension
is used. All partials that are necessary for this extension should reside in this folder.Name/ Resources/ Private/ Partials view.
template Root Paths - This can be used to specify the root paths for all Fluid templates in this
extension. If nothing is specified, the path
extension
is used. All templates that are necessary for this extension should reside in this folder.Name/ Resources/ Private/ Templates view.
plugin Namespace - 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. .. todo: This is not understandable without an example. This option might be deprecated and dropped.
view.
default Pid - This can be used to specify a default target page ID. If this value is set, this value will
be used as target page ID. If
default
is set toPid auto
, a pid is determined by loading the tt_content record that contains this plugin. An error will be thrown if more than one record matches thelist_
.type
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.
An example best describes the feature.
Imagine you installed the extension news
, which provides several plugins for
rendering news in the frontend.
The default template directory of that extension is the following:
EXT:
.
Let's assume you want to change the plugin's output because you need to use different CSS classes, for example. You can simply create your own extension and add the following TypoScript setup:
plugin.tx_news {
view {
templateRootPaths.10 = EXT:my_extension/Resources/Private/Templates/
}
}
As all TypoScript will be merged, the following configuration will be compiled:
plugin.tx_news {
view {
templateRootPaths {
0 = EXT:news/Resources/Private/Templates/
10 = EXT:my_extension/Resources/Private/Templates/
}
...
}
}
Imagine there is a news plugin that lists news entries. In that case, the list
method
of the News
will be called. By convention, Extbase will look for an html file
called List.
in a folder News
in all of the configured template root paths.
If there is just one root path configured, that is the one being chosen right away. Once there
are more paths defined, Extbase will check them in reverse order, i.e., from the highest key
to lowest. Following our example, Extbase will check the given path with key 10
first, and if
no template file is found, it will proceed with 0
.
Tip
If there is no root path defined at all, a fallback path will be created during runtime. The fallback path consists of the extension key and a fixed directory path.
More information on root paths can be found in the TypoScript reference: Properties
MVC
These are useful MVC settings about error handling:
mvc.
call Default Action If Action Cant Be Resolved - Will cause the controller to show its default action , e.g., if the called action is not allowed by the controller.
mvc.
throw Page Not Found Exception If Action Cant Be Resolved - Same as
mvc.
but this will raise a "page not found" error.call Default Action If Action Cant Be Resolved
_LOCAL_LANG
Under this key, you can modify localized strings for this extension.
If you specify, for example, plugin.
then the standard translation for the key read_
is overwritten by the
string More>>.
Format
The output of Extbase plugins can be provided in different formats, e.g., HTML, CSV, JSON, …. The required format can be requested via the request parameter. The default format, if nothing is requested, can be set via TypoScript. This can be combined with conditions.
format
- Defines the default format for the plugin.