Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit fe1885c

Browse files
committed
tweaks on the cmf_embed_blocks filter doc
1 parent 5c5c3a6 commit fe1885c

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tutorials/using_blockbundle_and_contentbundle.rst

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,20 +525,23 @@ might be a CMF bundle at some point for this).
525525
{# template.twig.html #}
526526
{{ page.content|cmf_embed_blocks }}
527527
528-
When you apply the filter, your users can use this tag to embed a block in
529-
their HTML content:
528+
Make sure to only place this filter where you display the content and not where
529+
editing it, as otherwise your users would start to edit the rendered output of
530+
their blocks. When you apply the filter, your users can use this tag to embed a
531+
block in their HTML content:
530532

531533
.. code-block:: html
532534

533535
<span>%embed-block:"/absolute/path/to/block"%</span>
534536

535537
<span>%embed-block:"local-block"%</span>
536538

537-
The path to the block is either absolute or relative to the current main content.
538-
The actual path to the block must be enclosed with double quotes ``"``. But the
539-
prefix and postfix are configurable. The default prefix is ``<span>%embed-block:``
540-
and the default postfix is ``%</span>``. Say you want to write
541-
``%%%block:"/absolute/path"%%%`` and no ``<span>`` tag then you do:
539+
The path to the block is either absolute or relative to the current main
540+
content. The actual path to the block must be enclosed with double quotes
541+
``"``. But the prefix and postfix are configurable. The default prefix is
542+
``<span>%embed-block:`` and the default postfix is ``%</span>``. Say you want
543+
to use ``%%%block:"/absolute/path"%%%`` and no ``<span>`` tag to avoid
544+
problems with a wysiwyg editor, then you do:
542545

543546
.. configuration-block::
544547

@@ -553,11 +556,17 @@ and the default postfix is ``%</span>``. Say you want to write
553556
554557
.. caution::
555558

556-
Currently there is no limitation built into this feature. Only enable it
557-
on content for which you are sure only trusted users may edit it.
559+
Currently there is no security built into this feature. Only enable the
560+
filter for content for which you are sure only trusted users may edit it.
558561
Restrictions about what block can be where that are built into an admin
559562
interface are not respected here.
560563

564+
.. note::
565+
566+
The block embed filter ignores all errors that might occur when rendering a
567+
block and returns an empty string for each failed block instead. The errors
568+
are logged at level WARNING.
569+
561570
Next Steps
562571
----------
563572

0 commit comments

Comments
 (0)