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¶
userFunc¶
Property
userFunc
Data type
(array of keys)
Description
Property setting up the USER and USER_INT object of the plugin.
_CSS_DEFAULT_STYLE¶
Property
_CSS_DEFAULT_STYLE
Description
Use this to have some default CSS styles inserted in the header
section of the document. _CSS_DEFAULT_STYLE
outputs a set of
default styles, just because an extension is installed. Most likely
this will provide an acceptable default display from the plugin, but
should ideally be cleared and moved to an external stylesheet.
This value is read by the frontend RequestHandler
script when
collecting the CSS of the document to be rendered.
This is e.g. used by frontend and indexed_search. Their default styles can be removed with:
plugin.tx_frontend._CSS_DEFAULT_STYLE >
plugin.tx_indexedsearch._CSS_DEFAULT_STYLE >
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.
General¶
ignoreFlexFormSettingsIfEmpty¶
New in version 12.3.
Property
ignoreFlexFormSettingsIfEmpty
Data type
Description
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.
Examples
Definition for all plugins of an extension:
plugin.tx_myextension.ignoreFlexFormSettingsIfEmpty = field1,field2
Definition for one plugin of an extension:
plugin.tx_myextension_myplugin.ignoreFlexFormSettingsIfEmpty = field1,field2
If an extension already defined ignoreFlexFormSettingsIfEmpty
,
integrators are advised to use addToList
or
removeFromList
to modify existing settings:
plugin.tx_myextension_myplugin.ignoreFlexFormSettingsIfEmpty := removeFromList(field1)
plugin.tx_myextension_myplugin.ignoreFlexFormSettingsIfEmpty := addToList(field3)
Persistence¶
Settings, relevant to the persistence layer of Extbase.
persistence.enableAutomaticCacheClearing¶
Property
persistence.enableAutomaticCacheClearing
Data type
Default
true
Description
Only for Extbase plugins. Enables the automatic cache clearing when changing data sets (see also Caching).
Example
plugin.tx_blogexample_admin {
persistence {
enableAutomaticCacheClearing = 0
}
}
View¶
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.
Example
plugin.blog_example {
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/
}
}
}
view.layoutRootPaths¶
Property
view.layoutRootPaths
Data type
(array of indexes)
Description
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¶
Property
view.partialRootPaths
Data type
(array of indexes)
Description
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¶
Property
view.templateRootPaths
Data type
(array of indexes)
Description
This can be used to specify the root paths for all Fluid templates in this
extension. If nothing is specified, the path
EXT:my_extension/Resources/Private/Templates
is used.
view.pluginNamespace¶
Property
view.pluginNamespace
Data type
(array of indexes)
Description
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¶
These are useful MVC settings about error handling:
mvc.callDefaultActionIfActionCantBeResolved¶
Property
mvc.callDefaultActionIfActionCantBeResolved
Data type
Default
false
Description
Only for Extbase plugins. Will cause the controller to show its default action if the called action is not allowed by the controller.
Example
plugin.tx_blogexample {
mvc {
callDefaultActionIfActionCantBeResolved = 1
}
}
mvc.throwPageNotFoundExceptionIfActionCantBeResolved¶
Property
mvc.callDefaultActionIfActionCantBeResolved
Data type
Default
false
Description
Same as mvc.callDefaultActionIfActionCantBeResolved but this will raise a "page not found" error.
Example
plugin.tx_blogexample {
mvc {
throwPageNotFoundExceptionIfActionCantBeResolved = 1
}
}
Format¶
Warning
Using this parameter is considered bad practice. In most cases it is better use different actions for different output formats.
Property
format
Data type
Default
html
Description
Define the default file ending of the template files. The template files have to take care of creating the desired format output.
Example
plugin.tx_blogexample_rssfeedxml {
// Use template List.xml
format = xml
}
plugin.tx_blogexample_rssfeedatom {
// Use template List.atom
format = atom
}
_LOCAL_LANG.[lang-key].[label-key]¶
Property
_LOCAL_LANG.[lang-key].[label-key]
Data type
Description
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.
Example
plugin.tx_myext_pi1._LOCAL_LANG.de.list_mode_1 = Der erste Modus
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¶
Here reside are all the settings, both extension-wide and plugin-specific.
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.