Drupal 7: Markup Module

David G - DrupalWhile creating websites for clients I always have the difficult task of attempting to make the end product I hand the client simple to use. Simplicity is an attribute that is difficult to attain. Oftentimes I find needing to include some sort of Directions or Instruction Manual for a website — and I find that providing a paper manual or PDF falls short because they get lost! Occassionaly I resort to using Panels and creating an admin panel that is solely directions for website usage. Recently I stumbled across what I thought was a new module on drupal.org but turns out to be a rather old module to aide in site documentation. The Markup module for Fields.

The markup module provides a Drupal field for site creators to include essentially HTML markup as a field within any Content Type. Sure by default there is the Help item for any custom field — and there is the Advanced Help module to aide in site documentation. But, the Markup module provides a nice mechanism to include some inline documentation to custom content types you create.

After installing the module as you would any other module you then have the option to add a Markup field to a content type.

After installation you have access to a Markup field.

After installation you have access to a Markup field.

This field, as any other field can be placed anywhere on the content type form, it will display whatever HTML you want (it’s markup). For example if you installed the Field Group module you could add a field of Markup to the top of fieldgroup, vertical tab or other group you create using Field Group. If you were good with JS, or expertly using Field Groups, you could for example add some Javascript to your pages that allowed you to show or hide this additional markup text.

After adding the field to your content type you can add whatever HTML or verbiage you want to the field. It’s recommended you add DIVs around your Markup content so Drupal treats the field as any other Form API field attached to a form:

<div class="form-item"><div>

Then you can configure your Markup with whatever HTML markup you require:

Example of a simple Markup field's content.

Example of a simple Markup field’s content.

As you can see, the end result is your Markup field inline with the general form items of the content type:

Example markup field in an Article content type. It is the sentence after the Title field.

Example markup field in an Article content type. It is the sentence after the Title field.

Since this is a drupal Field it is exportable via Features. This is one big reason I say it’s appropriate to consider this module if you want to bundle directions inline to the custom content types you create on websites. I hope you see how useful this module could be to your workflows!

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , | Posted under Drupal | RSS 2.0

Author Spotlight

David Gurba

I am a web programmer currently employed at UCSB. I have been developing web applications professionally for 8+ years now. For the last 5 years I’ve been actively developing websites primarily in PHP using Drupal. I have experience using LAMP and developing data driven websites for clients in aviation, higher education and e-commerce. If you’d like to contact me I can be reached at david.gurba@arvixe.com

Leave a Reply

Your email address will not be published. Required fields are marked *