Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Clarify constants do not work in constant conditions #1294

Merged
merged 4 commits into from
Jul 7, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Documentation/Conditions/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,16 @@ site()
# ...
[END]

Site settings can also be used in the conditions in TypoScript constants:

.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/constants.typoscript

my.constant = myValue
[traverse(site('configuration'), 'settings/some/setting') == 'someValue']
# This works but is rather ugly to rely on
other.constant = otherValue
[global]
linawolf marked this conversation as resolved.
Show resolved Hide resolved

.. index:: Conditions; siteLanguage
.. _condition-functions-in-frontend-context-function-siteLanguage:
Expand Down Expand Up @@ -1348,6 +1358,14 @@ TypoScript constants can be used in conditions with the
page.10.value = The feature 1 of my_extension is not enabled.
[END]

.. note::
TypoScript constants can be used in frontend TypoScript *setup* conditions,
but not in Frontend TypoScript *constants* conditions. At the time of
evaluation the constants are not yet available in constants conditions.

It is, however, possible to use :confval:`site setttings <condition-site>`
froemken marked this conversation as resolved.
Show resolved Hide resolved
in constant conditions.

.. _condition-examples-constant-strict-types:

Compare constant with strict types
Expand Down