filter.overview.html.twig

Same filename in other branches
  1. 9 core/modules/help_topics/help_topics/filter.overview.html.twig
  2. 10 core/modules/filter/help_topics/filter.overview.html.twig
---
label: 'Managing text filters and text formats'
related:
  - core.security
  - core.content_structure
  - field_ui.manage_form
  - field_ui.manage_display
  - field_ui.add_field
---
{% set overview_link_text %}{% trans %}Text formats and editors{% endtrans %}{% endset %}
{% set overview_link = render_var(help_route_link(overview_link_text, 'filter.admin_overview')) %}
<h2>{% trans %}Goal{% endtrans %}</h2>
<p>{% trans %}Configure text formats on the site.{% endtrans %}</p>
<h2>{% trans %}What are text filters and text formats?{% endtrans %}</h2>
<p>{% trans %}A text filter is a processing step that can be applied to text, either to transform it in some way (such as converting URLs in the text into HTML links), or to defend against potentially-dangerous input from site users. A text format is an ordered sequence of text filters. Text filters are provided by modules; text formats are managed by the core Filter module.{% endtrans %}</p>
<p>{% trans %}Text fields that have "formatted" in the field type name, such as <em>Text (formatted)</em>, use text formats. Users choose the text format when editing the field text; when the field text is shown on the site, it is processed by the chosen text format. Administrators can configure text formats and assign permissions for who can use each format. If the core Text Editor module is enabled, administrators can also associate visual editors with text formats.{% endtrans %}</p>
<h2>{% trans %}What text filters are available?{% endtrans %}</h2>
<p>{% trans %}Some of the more commonly used text filters are:{% endtrans %}</p>
<dl>
  <dt>{% trans %}Limit allowed HTML tags and correct faulty HTML{% endtrans %}</dt>
  <dd>{% trans %}Limits which HTML tags can be used; useful both for site security and enforcing site design.{% endtrans %}</dd>
  <dt>{% trans %}Convert line breaks into HTML{% endtrans %}</dt>
  <dd>{% trans %}Line breaks in HTML source are displayed as horizontal spaces. This filter converts line breaks into HTML paragraph and line break tags.{% endtrans %}</dd>
  <dt>{% trans %}Convert URLs into links{% endtrans %}</dt>
  <dd>{% trans %}Takes plain URLs in text and turns them into HTML links.{% endtrans %}</dd>
  <dt>{% trans %}Restrict images to this site{% endtrans %}</dt>
  <dd>{% trans %}For text formats that allow HTML image tags, restricts images to URLs within this site.{% endtrans %}</dd>
</dl>
<h2>{% trans %}Steps{% endtrans %}</h2>
<ol>
  <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>Configuration</em> &gt; <em>Content Authoring</em> &gt; <em>{{ overview_link }}</em>. If you do not have the core Text Editor module installed, the menu link and page title will instead be <em>Text formats</em>.{% endtrans %}</li>
  <li>{% trans %}Click <em>Configure</em> to configure an existing text format, or <em>+ Add text format</em> to create a new text format.{% endtrans %}</li>
  <li>{% trans %}Enter the desired <em>Name</em> for the text format.{% endtrans %}</li>
  <li>{% trans %}Check the <em>Roles</em> that can use this text format. Some HTML tags allow users to embed malicious links or scripts in text. To ensure security, anonymous and untrusted users should only have access to text formats that restrict them to either plain text or a safe set of HTML tags. <strong>Improper text format configuration is a security risk.</strong>{% endtrans %}</li>
  <li>{% trans %}If the core Text Editor module is installed, see the related topic to connect a text editor to this text format.{% endtrans %}</li>
  <li>{% trans %}Under <em>Enabled filters</em>, check the text filters that you want to use.{% endtrans %}</li>
  <li>{% trans %}Under <em>Filter processing order</em>, drag the filters to the correct order. Choose the order carefully; for example, if you have a filter that results in a particular HTML tag being added to the text, that should run after a filter that restricts HTML tags, to avoid deleting the new tags the first filter added.{% endtrans %}</li>
  <li>{% trans %}Under <em>Filter settings</em>, verify and adjust the settings for each active filter that has configuration options.{% endtrans %}</li>
  <li>{% trans %}Click <em>Save configuration</em>, which will return you to the <em>Text formats and editors</em> page.{% endtrans %}</li>
  <li>{% trans %}Repeat these steps if you have additional text formats to configure.{% endtrans %}</li>
</ol>

File

core/modules/filter/help_topics/filter.overview.html.twig

View source
  1. ---
  2. label: 'Managing text filters and text formats'
  3. related:
  4. - core.security
  5. - core.content_structure
  6. - field_ui.manage_form
  7. - field_ui.manage_display
  8. - field_ui.add_field
  9. ---
  10. {% set overview_link_text %}{% trans %}Text formats and editors{% endtrans %}{% endset %}
  11. {% set overview_link = render_var(help_route_link(overview_link_text, 'filter.admin_overview')) %}
  12. <h2>{% trans %}Goal{% endtrans %}</h2>
  13. <p>{% trans %}Configure text formats on the site.{% endtrans %}</p>
  14. <h2>{% trans %}What are text filters and text formats?{% endtrans %}</h2>
  15. <p>{% trans %}A text filter is a processing step that can be applied to text, either to transform it in some way (such as converting URLs in the text into HTML links), or to defend against potentially-dangerous input from site users. A text format is an ordered sequence of text filters. Text filters are provided by modules; text formats are managed by the core Filter module.{% endtrans %}</p>
  16. <p>{% trans %}Text fields that have "formatted" in the field type name, such as <em>Text (formatted)</em>, use text formats. Users choose the text format when editing the field text; when the field text is shown on the site, it is processed by the chosen text format. Administrators can configure text formats and assign permissions for who can use each format. If the core Text Editor module is enabled, administrators can also associate visual editors with text formats.{% endtrans %}</p>
  17. <h2>{% trans %}What text filters are available?{% endtrans %}</h2>
  18. <p>{% trans %}Some of the more commonly used text filters are:{% endtrans %}</p>
  19. <dl>
  20. <dt>{% trans %}Limit allowed HTML tags and correct faulty HTML{% endtrans %}</dt>
  21. <dd>{% trans %}Limits which HTML tags can be used; useful both for site security and enforcing site design.{% endtrans %}</dd>
  22. <dt>{% trans %}Convert line breaks into HTML{% endtrans %}</dt>
  23. <dd>{% trans %}Line breaks in HTML source are displayed as horizontal spaces. This filter converts line breaks into HTML paragraph and line break tags.{% endtrans %}</dd>
  24. <dt>{% trans %}Convert URLs into links{% endtrans %}</dt>
  25. <dd>{% trans %}Takes plain URLs in text and turns them into HTML links.{% endtrans %}</dd>
  26. <dt>{% trans %}Restrict images to this site{% endtrans %}</dt>
  27. <dd>{% trans %}For text formats that allow HTML image tags, restricts images to URLs within this site.{% endtrans %}</dd>
  28. </dl>
  29. <h2>{% trans %}Steps{% endtrans %}</h2>
  30. <ol>
  31. <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>Configuration</em> &gt; <em>Content Authoring</em> &gt; <em>{{ overview_link }}</em>. If you do not have the core Text Editor module installed, the menu link and page title will instead be <em>Text formats</em>.{% endtrans %}</li>
  32. <li>{% trans %}Click <em>Configure</em> to configure an existing text format, or <em>+ Add text format</em> to create a new text format.{% endtrans %}</li>
  33. <li>{% trans %}Enter the desired <em>Name</em> for the text format.{% endtrans %}</li>
  34. <li>{% trans %}Check the <em>Roles</em> that can use this text format. Some HTML tags allow users to embed malicious links or scripts in text. To ensure security, anonymous and untrusted users should only have access to text formats that restrict them to either plain text or a safe set of HTML tags. <strong>Improper text format configuration is a security risk.</strong>{% endtrans %}</li>
  35. <li>{% trans %}If the core Text Editor module is installed, see the related topic to connect a text editor to this text format.{% endtrans %}</li>
  36. <li>{% trans %}Under <em>Enabled filters</em>, check the text filters that you want to use.{% endtrans %}</li>
  37. <li>{% trans %}Under <em>Filter processing order</em>, drag the filters to the correct order. Choose the order carefully; for example, if you have a filter that results in a particular HTML tag being added to the text, that should run after a filter that restricts HTML tags, to avoid deleting the new tags the first filter added.{% endtrans %}</li>
  38. <li>{% trans %}Under <em>Filter settings</em>, verify and adjust the settings for each active filter that has configuration options.{% endtrans %}</li>
  39. <li>{% trans %}Click <em>Save configuration</em>, which will return you to the <em>Text formats and editors</em> page.{% endtrans %}</li>
  40. <li>{% trans %}Repeat these steps if you have additional text formats to configure.{% endtrans %}</li>
  41. </ol>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.