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¶
Property |
Data Type |
Default |
|
---|---|---|---|
(array of keys) |
|||
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.
_CSS_PAGE_STYLE¶
Property
_CSS_PAGE_STYLE
Data type
Description
_CSS_PAGE_STYLE
is included only on the affected pages. Depending
on your configuration it will be written in an external file and included
on the page or directly added as inline CSS block. Compression
for page specific CSS also depends on the global config.compressCss
setting.
This setting can be used to only include the CSS when the plugin of a certain extension is included on that page.
This value is read by the frontend RequestHandler
when
collecting the CSS of the document to be rendered.
_DEFAULT_PI_VARS.[piVar-key]¶
Property
_DEFAULT_PI_VARS.[piVar-key]
Description
Allows you to set default values of the piVars array which most plugins are using (and should use) for data exchange with themselves.
This works only if the plugin calls $this->pi_setPiVarDefaults()
.
The values have stdWrap, which also works recursively for multilevel keys.
Example
plugin.tt_news._DEFAULT_PI_VARS {
year.stdWrap.data = date:Y
}
This sets the key "year" to the current year.
_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 the plugin. 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 extension with
$this->pi_getLL('list_mode_1', 'Text, if no entry in locallang.xlf', true);
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.