Subheading

Component ID

2027911

Component name

Subheading

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Provides a consistent interface for dealing with subtitles. Instead of having to override the way a field looks with a tpl, configuring Display Suite per field, etc. a simple theme function can be called or a field formatter can be used.

Usage

This module can be used one of two ways:

The simplest is to call theme('subheading', array('subheading' => 'This is my text')); directly. Any missing options will have sensible defaults added.

Examples:

  // The following are equivalent in functionality after being rendered.
  
  $subheading = theme('subheading', array(
    'subheading' => '<p>' . t('An example subheading.') . '</p>',
    'html_tag' => 'div',
  ));

  // Subheading as a render array.
  $page['subheading'] = array(
    '#theme' => 'subheading',
    '#html_tag' => 'div',
    '#subheading' => '<p>' . t('An example subheading.') . '</p>',
  );

  $subheading = drupal_render($page['subheading']);

There is also a new field formatter that applies to text, long text, and text with summary fields.

This project has been sponsored by:

McMurry/TMG
McMurry/TMG is a world-leading, results-focused content marketing firm. We leverage the power of world-class content — in the form of the broad categories of video, websites, print and mobile — to keep our clients’ brands top of mind with their customers. Visit http://www.mcmurrytmg.com for more information.