Problem/Motivation

Even though, #markup renders without any problem. There is no way to manage this markup

Proposed resolution

Creating a #markup render element will allow the YAML form module to control the display and rendering of all markup. This would allow HTML to be convert to plain text for emails.

Remaining tasks

  • Create YamlFormMarkup render element.
  • Create YamlFormMarkup element handler
  • Convert HTML to plain text
  • Add element['#display_on'] [form, submission, both]
  • Allow markup to be included in submission and/or email.
  • Update examples
  • Write test

Development Notes

  • Branch Name: 2721587-markup-element
  • Patch Name: yamlform-markup-element-2721587-XX.patch
  • Commit message: Issue #2721587: Add markup element.

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Issue summary: View changes

  • jrockowitz committed d483ea8 on 2721587-markup-element
    Issue #2721587: Add markup element.
    
jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new10.84 KB

jrockowitz’s picture

Status: Needs review » Fixed
NetNerdy’s picture

Status: Fixed » Needs work

drupal 8.1.1 , yamlform dev (from 2016-05-09) after the patch above #4:

i have added the element -> '#display_on': '[submission]'
...without any result.

?!

jrockowitz’s picture

I just implemented this feature a few hours ago.

There is an example in /form/example-inputs-extras and below is the code snippet.

markup:
  '#markup': '<p>This is normal markup</p>'
markup_form:
  '#type': 'markup'
  '#markup': '<p>This is only displayed on the form view. (''display_on:'': form).</p>'
  '#display_on': form
markup_view:
  '#type': 'markup'
  '#markup': '<p>This is only displayed on the submission view. (''display_on:'': view).</p>'
  '#display_on': view
markup_both:
  '#type': 'markup'
  '#markup': '<p>This is only displayed on the both the form and submission view. (''display_on:'': both)</p>'
  '#display_on': both

Moving forward, I will start updating my tickets with better examples and URLs.

NetNerdy’s picture

Status: Needs work » Fixed

ok...i have installed by drush: yamlform alpha-9 + patch #4, drupal 8.1.1, php 7

i'm understanding the "markup type"...now. i can use html/text direkt in the form...very nice feature!
i can't using tokens in this way like [current-page:title]...right?! so i have to have some fields (e.g. 'textfield') for token support.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.