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.

Expressions in queries

It is possible to use expressions inside a query. Consider the following:

SELECT cn_short_{config:language} FROM static_countries

The expression refers to the config.language TypoScript value. If that value is “en”, the query will select the “cn_short_en” field. If it’s “fr”, it will be “cn_short_fr”.

This is a very convenient way to dynamically modify a query.

Expressions can be used anywhere inside a query, but should not be used in the WHERE clause. Instead Data Filters should be used in this case. This is not a limitation per se, just a best practice.

For more information on expressions, please refer to the extension manual.