From cd9f5f232c04e898a185033f001faf1d748c0038 Mon Sep 17 00:00:00 2001 From: Sybille Peters Date: Tue, 12 Jul 2022 17:52:14 +0200 Subject: [PATCH] [TASK] Add inline syntax to Fluid syntax Some content was migrated from the Extbase book but has been considerably shortened. Related: TYPO3-Documentation/TYPO3CMS-Book-ExtbaseFluid#536 --- Documentation/ApiOverview/Fluid/Syntax.rst | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Documentation/ApiOverview/Fluid/Syntax.rst b/Documentation/ApiOverview/Fluid/Syntax.rst index 836952f318..12103791c0 100644 --- a/Documentation/ApiOverview/Fluid/Syntax.rst +++ b/Documentation/ApiOverview/Fluid/Syntax.rst @@ -87,3 +87,50 @@ curly braces: :caption: EXT:site_package/Resources/Private/Templates/SomeTemplate.html Now it is: {date} + +Fluid inline notation +===================== + +.. tip:: + + There is an online converter from tag-based syntax to inline syntax: + `Fluid Converter `__ + +An alternative to the tag based notation used above is inline notation. For +example, compare the 2 identical Fluid constructs: + +.. code-block:: html + :caption: EXT:my_extensions/Resources/Private/Templates/Something.html + + + + + + {f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:bookmark_inactive')} + +Tag based notation and inline notation can be freely mixed within one Fluid +template. + +Inline notation is often a better choice if HTML tags are nested, for example: + +.. code-block:: html + :caption: EXT:my_extensions/Resources/Private/Templates/Something.html + + + + + <-- inline notation --> + + +More complex example with chaining: + +.. code-block:: html + :caption: EXT:my_extensions/Resources/Private/Templates/Something.html + + + {post.date} + + + {post.date -> f:format.date(format: 'Y-m-d') -> f:format.padding(padLength: 40)} + +