Skip to content

Commit

Permalink
[TASK] Migrate Fluid comments from Extbase book (#1963)
Browse files Browse the repository at this point in the history
  • Loading branch information
sypets authored Jul 13, 2022
1 parent 3b1f56f commit 2a04567
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Documentation/ApiOverview/Fluid/Syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,39 @@ More complex example with chaining:
{post.date -> f:format.date(format: 'Y-m-d') -> f:format.padding(padLength: 40)}


.. _fluid-comments:

Comments
========

As the Fluid syntax is basically XML, you can use CDATA tags to comment
out parts of your template:

.. code-block:: html
:caption: EXT:my_extension/Resources/Private/Templates/SomeTemplate.html

<![CDATA[
This will be ignored by the Fluid parser
]]>

If you want to hide the contents from the browser, you can additionally
encapsulate the part in HTML comments:

.. code-block:: html
:caption: EXT:my_extension/Resources/Private/Templates/SomeTemplate.html

<!--<![CDATA[
This will be ignored by the Fluid parser and by the browser
]]>-->

Note: This way the content will still be transferred to the browser! If
you want to completely skip parts of your template, you can make use of
the **f:comment** view helper. To disable parsing you best combine it
with CDATA tags:

.. code-block:: html
:caption: EXT:my_extension/Resources/Private/Templates/SomeTemplate.html

<f:comment><![CDATA[
This will be ignored by the Fluid parser and won't appear in the source code of the rendered template
]]></f:comment>

0 comments on commit 2a04567

Please sign in to comment.