Using the Markup module to add content to your entity forms

Published May 19, 2018

Have you ever been building a form and found yourself wishing that you could insert additional help text - or even other forms of content (images, video) inline with the form? While each field's "Description" field is useful, sometimes it isn't enough.

The Markup module solves this problem in an elegant way by providing a new "Markup" field type.

Markup field type

 

This field doesn't expose any input widgets to the end user, rather it just allows for site builders to add additional markup (content) to an entity form.

Editing a Markup field.

 

The markup isn't saved with the resulting entity - it's just there to provide additional information to the user filling out the form.

Granted, this has always been possible by writing a small custom module utilizing hook_form_alter(), but having it as a field type makes it much more convenient to use.

 

Comments

Just wondering why not just use "Help Text" text area on field settings on the content type fields page?

Submitted by Jon Firebaugh (not verified) on Thu, 07/19/2018 - 08:38

Author comment

You can absolutely use the help text when appropriate. I often use this module when I want some introductory text at the very top of a form.

 

Submitted by ultimike on Thu, 07/19/2018 - 17:09

In reply to by Jon Firebaugh (not verified)

Sign up to receive email notifications of whenever we publish a new blog post or quicktip!

Name
CAPTCHA