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] Migrate Fluid comments from Extbase book #1963

Merged
Merged
Changes from all 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
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>