DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Expression keys reference¶
Expressions can be used both in the the frontend and the backend, but
some keys will obviously not be available in the backend as they rely
on frontend object (for example, $TSFE
).
It is possible to create processors for custom expression keys (see "Developer's Guide") and thus to extend the expression parser.
tsfe¶
Gets a value from the $TSFE
global variable.
Examples
Retrieve the uid of the current page:
tsfe:id
Retrieve the username of the currently logged in user:
tsfe:fe_user|user|username
page¶
Gets a value related to the current page, as stored in $TSFE->page
.
Example
Retrieve the uid of the current page:
page:uid
config¶
Gets a value from the "config" object, as stored in
$TSFE->config['config']
.
Example
Retrieve the current language:
config:language
fe_user¶
Gets a value for the current frontend user, as stored in
$GLOBALS['TSFE']->fe_user->user
.
Example
Retrieve the current FE user's name:
fe\_user:name
plugin¶
Get a TypoScript property for a plugin as stored in
$GLOBALS['TSFE']->tmpl->setup['plugin.']
.
Note
Remember that TS indices have an ending dot (.).
Example
Retrieve the TypoScript property plugin.tx_vgetagcloud_pi1.startPage.data
:
plugin:tx_vgetagcloud_pi1.|startPage.|data
gp¶
Gets a value from either the $_GET
or $_POST
superglobal arrays.
This makes it possible to retrieve any GET or POST variable passed to the page.
Example
Retrieve the uid of a single news record:
gp:tx_ttnews|tt_news
vars¶
Gets a value from "internal" variables variables. This depends on what is loaded here by the extension that users the parser. This is meant to be equivalent to a traditional's plugin "piVars".
Example
Retrieve the "showUid" variable from the internal variables:
vars:showUid
extra¶
Same as above but for so-called "external" variables.
Note
This is done, for example, by the context extension to make context values accessible.
Example
Retrieve the value of "category" from the context:
extra:category
date¶
Gets values related to the current time, using formats from the PHP date() function.
Example
Retrieve the current year (4 digits):
date:Y
strtotime¶
Gets a timestamp by interpreting a human-readable date, as per the capacities of PHP's function strtotime().
Examples
Retrieve the timestamp corresponding to Jan 1, 2009:
strtotime:2009-01-01
Retrieve the timestamp corresponding to tomorrow, same time:
strtotime:tomorrow
session¶
Gets values from some structure stored in the temporary session (i.e. "ses" and not "user").
The first item (after the "session:" key) has a special meaning. It corresponds to the key that was used to store into the session. The following indices are used normally.
Example
Retrieve index "bob" of array dummy stored into the session:
session:dummy|bob
env¶
Get values from the environment variables, via the use of
\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv()
.
Please refer to that method for available values.
Note
\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv()
expects values to be uppercase.
The expressions parser takes care of uppercasing any incoming value, so
there's no need to worry about that.
Example
Retrieve the host name:
env:http_host