From eaa00955475016f6a379c637c216eb9280b925c1 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 9 Mar 2020 12:03:43 -0600 Subject: [PATCH 1/9] raw the form label field --- CHANGELOG.md | 6 ++++++ README.md | 10 +++++++++- templates/forms/default/field.html.twig | 2 +- templates/forms/layouts/field.html.twig | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d285e58..cee53f96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v4.0.6 +## mm/dd/2020 + +1. [](#new) + * CHANGE: Form labels are now displayed in `raw` format so you can use HTML in them. + # v4.0.5 ## 03/05/2020 diff --git a/README.md b/README.md index fb9e6821..d171e9e0 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,12 @@ The Learn site has two pages describing how to use the Form Plugin: # Using email -Note: when using email functionality in your forms, make sure you have configured the Email plugin correctly. In particular, make sure you configured the "Email from" and "Email to" email addresses in the Email plugin with your email address +Note: when using email functionality in your forms, make sure you have configured the Email plugin correctly. In particular, make sure you configured the "Email from" and "Email to" email addresses in the Email plugin with your email address. + +# NOTES: + +As of version **Form version 4.0.6**, form labels are now being output with the `|raw` filter. If you wish to show HTML in your form label, ie `Root Folder `, then you need to escape that in your form definition: + +```yaml +label: Root Folder <root> +``` diff --git a/templates/forms/default/field.html.twig b/templates/forms/default/field.html.twig index dcd3e640..e47b2c90 100644 --- a/templates/forms/default/field.html.twig +++ b/templates/forms/default/field.html.twig @@ -91,7 +91,7 @@ {# Field Label #} {% set form_field_label = field.markdown ? field.label|markdown(false) : field.label %} -{% set form_field_label = form_field_label|default(field.name|capitalize)|t|e %} +{% set form_field_label = form_field_label|default(field.name|capitalize)|t %} {# Field Help #} {% if field.help %} diff --git a/templates/forms/layouts/field.html.twig b/templates/forms/layouts/field.html.twig index dd037da8..9d368902 100644 --- a/templates/forms/layouts/field.html.twig +++ b/templates/forms/layouts/field.html.twig @@ -7,7 +7,7 @@