uiowa / uiowa

The base application on Acquia Cloud for the University of Iowa.
11 stars 9 forks source link

HTML Markup field in forms are not styled / Preferred method for instructional text above form? #3133

Closed mark-bennett-uiowa closed 3 years ago

mark-bennett-uiowa commented 3 years ago

Problem

When creating a form for an information session to reproduce this page: https://clas.uiowa.edu/socialwork/undergraduate-program/ba-programs/iowa-city-ba-program/information-sessions, what is the preferred method moving forward in Drupal 8? Attach the form as a block in a basic page? Add a HTML Markup field above form so that both instructional text and form can be edited in the same window vs two? Third option?

Problem 1: HTML markup fields do not have a text format option, so styling does not carry over. The problem arises from the use of a HTML markup field in the form. The first screenshot shown below is what this HTML Markup field looks like live:

Screen Shot 2021-02-24 at 2 40 55 AM

This second screenshot is what it looks like when a Message field is used:

Screen Shot 2021-02-24 at 2 41 08 AM

Should I be embedding this form as a block inside another page instead?

Steps to reproduce

Create a basic form, and add a HTML Markup field to the form. No text formats are available, so no styling is available.

Proposed solution

Allow Plain text and Filtered HTML text formats on the HTML Markup field? Embed form as block in separate page? Preferred method determined?

joewhitsitt commented 3 years ago

We can update these default webform settings to be more inline with the allowed minimal text format:

Screen Shot 2021-02-24 at 9 29 02 AM Screen Shot 2021-02-24 at 9 29 18 AM

https://github.com/uiowa/uiowa/blob/main/config/default/filter.format.minimal.yml#L50

mark-bennett-uiowa commented 3 years ago

@joewhitsitt I followed your lead here; I unchecked Tidy HTML markup (to prevent it from stripping paragraph tags, I changed the Element text format to Filtered HTML, and tried turning on the Advanced HTML/Text element type option.

By changing the Element text format to Filtered HTML, it immediately fixed the issue. By using the Advanced HTML/Text, this also fixed it, but it raised two alerts and ends up being unnecessary if the standard HTML Markup field gets the job done. Unchecking Tidy HTML did nothing, so I left that checked.

TL;DR: By simply changing the Element text editor to Filtered HTML, it solved the problem. Closing issue. Thanks again Joe!! https://socialwork.prod.drupal.uiowa.edu/undergraduate/ba-social-work/information-sessions/iowa-city Screen Shot 2021-02-25 at 4 40 32 PM

BTW, here is the screenshot of the two alerts that were raised by enabling the Advanced HTML/Text field option: Screen Shot 2021-02-25 at 4 24 40 PM

joewhitsitt commented 3 years ago

Hey @mark-bennett-uiowa, unless you somehow changed this on the specific form, this is tracked as configuration for our webform settings and I believe will have to be address in a PR or it will revert on the next deploy.

mark-bennett-uiowa commented 3 years ago

You're exactly right @joewhitsitt. Just submitted a PR (#3178) with this small change included to add this feature.