-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
core-bundle/contao/templates/twig/component/_rich_text.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{# | ||
This component outputs rich text content, that was typically composed by | ||
an editor in the backend using the tinyMCE editor. | ||
<div class="rte"> | ||
<p>Lorem ipsum</p> | ||
</div> | ||
Mandatory variables: | ||
@var string text | ||
Optional variables: | ||
@var \Contao\CoreBundle\String\HtmlAttributes attributes | ||
Note: | ||
You can either group all variables in an object named "rich_text" or | ||
all directly in the context. Grouping under an object has precedence. | ||
#} | ||
|
||
{% trans_default_domain "contao_default" %} | ||
|
||
{% block rich_text_component %} | ||
{% set rich_text = rich_text|default(_context) %} | ||
|
||
{% set rich_text_attributes = attrs(rich_text.attributes|default) | ||
.addClass('rte') | ||
.mergeWith(rich_text_attributes|default) | ||
%} | ||
<div{% block rich_text_attributes %}{{ rich_text_attributes }}{% endblock %}> | ||
{% block rich_text_inner %} | ||
{{ rich_text.text|csp_inline_styles|insert_tag|encode_email|raw }} | ||
{% endblock %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters