Skip to content

Commit

Permalink
Change links to TypoScript syntax
Browse files Browse the repository at this point in the history
* No longer link to "TypoScript syntax and in depth study"
* Link to "Typo3 Explained"
  • Loading branch information
sypets committed Jan 26, 2020
1 parent 17c7275 commit 8c0a5cf
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Documentation/Conditions/Index.rst
Expand Up @@ -11,8 +11,8 @@ Conditions
.. seealso::

For full explanations about conditions, especially about condition
syntax, please refer to :ref:`the according chapter in "TypoScript
Syntax and In-depth Study" <t3tssyntax:conditions>`.
syntax, please refer to :ref:`the according chapter in
"TYPO3 Explained" <t3coreapi:typoscript-syntax-conditions>`.


.. _condition-syntax:
Expand Down
96 changes: 96 additions & 0 deletions Documentation/Conditions/Syntax/Index.rst
@@ -0,0 +1,96 @@
.. include:: ../../Includes.txt
.. highlight:: typoscript

.. _conditions-about-the-syntax:

==============================
About The Syntax Of Conditions
==============================

.. seealso::

For full explanations about conditions, especially about condition
syntax, please refer to :ref:`the according chapter in
"TYPO3 Explained" <t3coreapi:typoscript-syntax-conditions>`.


.. _condition-syntax:

General syntax
==============

Each condition is encapsulated by square brackets. For a list of
available conditions see below.

`[ELSE]` is available as else operator. It is a condition, which will
return TRUE, if the previous condition returned FALSE.

Each condition block is ended with `[END]`.


`[GLOBAL]` is a condition by itself that always returns "true".
It ensures that the following TypoScript code is located in the
global scope. So you can be sure that it's not affected by previous
TypoScript, for example if a closing bracket is missing.
The *Template Analyzer* shows this very well: TYPO3 places a
`[GLOBAL]` condition at the beginning of each TypoScript file.

As a developer you can use `[GLOBAL]` for testing purposes
to ensure that your own condition works as expected.
See
:ref:`the according chapter in "TYPO3 Explained" <t3coreapi:typoscript-syntax-conditions>`
for additional documentation.


Example
-------

Test day of month::

[dayofmonth = 9]
# TypoScript for the ninth day of the month.
[ELSE]
# TypoScript for other days.
[END]


.. _condition-general-notes:

Trimming, braces and condition operators
========================================

Values are normally trimmed before comparison, so leading and trailing
blanks are not taken into account.

Note that conditions cannot be used inside of curly brackets.

You may combine several conditions with two operators: && (and), \|\|
(or). Alternatively you may use "AND" and "OR" instead of "&&" and
"\|\|". The AND operator always takes higher precedence over OR. If no
operator has been specified, it will default to OR.


Examples
--------

Test day of month and month
~~~~~~~~~~~~~~~~~~~~~~~~~~~

This condition will match on May 9th::

[dayofmonth = 9] && [month = 5]

Test day of month
~~~~~~~~~~~~~~~~~

This will match on either the ninth or the tenth of a month::

[dayofmonth = 9] || [dayofmonth = 10]

Test month and day of month
~~~~~~~~~~~~~~~~~~~~~~~~~~~

This will match in either June or May. In case of
May, the day of the month must be above 8::

[month = 6] || [month = 5] && [dayofmonth => 8]
6 changes: 5 additions & 1 deletion Documentation/Index.rst
Expand Up @@ -60,10 +60,14 @@ About This Manual
This document is a complete reference to all objects types and properties of
TypoScript as used in frontend TypoScript templates, and not in :ref:`TSconfig <t3tsconfig:start>`.

The :ref:`introduction` chapter in this manuals contains an introduction
into the topic TypoScript.

.. seealso::

* For explanations about the syntax of TypoScript itself,
please refer to :ref:`t3tssyntax:start`
please refer to
:ref:`t3coreapi:typoscript-syntax-start` in "TYPO3 Explained"!
* For an introduction to TypoScript Templates, see :ref:`t3ts45:start`


Expand Down
3 changes: 2 additions & 1 deletion Documentation/Settings.cfg
Expand Up @@ -60,6 +60,7 @@ t3tca = https://docs.typo3.org/m/typo3/reference-tca/7.6/en-us/
t3templating = https://docs.typo3.org/m/typo3/tutorial-templating/7.6/en-us/
t3tsconfig = https://docs.typo3.org/m/typo3/reference-tsconfig/7.6/en-us/
t3ts45 = https://docs.typo3.org/m/typo3/tutorial-typoscript-in-45-minutes/7.6/en-us/
t3tssyntax = https://docs.typo3.org/m/typo3/reference-typoscript-syntax/7.6/en-us/

# t3tssyntax should no longer be linked to. Link to respective chapters in "TYPO3 Explained" or "TypoScript reference"
#t3tssyntax = https://docs.typo3.org/m/typo3/reference-typoscript-syntax/7.6/en-us/

3 changes: 1 addition & 2 deletions Documentation/Setup/Constants/Index.rst
Expand Up @@ -44,8 +44,7 @@ maintain it easily.
The constants defined here are **not** the ones, which can be defined
in the constants section of your template and which then in the setup
section can be used as :ts:`{$myconstant}`. For these constants see
:ref:`the according chapter in "TypoScript Syntax and In-depth Study"
<t3tssyntax:constants>`.
:ref:`the according chapter :ref:`typoscript-syntax-what-are-constants`.

.. only:: html

Expand Down

0 comments on commit 8c0a5cf

Please sign in to comment.