You are here

function theme_styleguide_item in Style Guide 7

Same name and namespace in other branches
  1. 6 styleguide.theme.inc \theme_styleguide_item()

Theme a display item.

Parameters

$variables: The theme variables array, including: -- 'key' a unique string indicating the name of the item. -- 'item' an array of data about the item. -- 'content' the content to display for this item.

See also

hook_styleguide()

1 theme call to theme_styleguide_item()
styleguide_page in ./styleguide.module
The styleguide page.

File

./styleguide.theme.inc, line 42
Theme file for Style Guide module.

Code

function theme_styleguide_item($variables) {
  $key = $variables['key'];
  $item = $variables['item'];
  $content = $variables['content'];
  $output = '';
  $output .= "<a name=\"{$key}\"></a>";
  $output .= '<h2 class="styleguide">' . $item['title'] . '</h2>';
  if (!empty($item['description'])) {
    $output .= '<p class="styleguide-description">';
    $output .= $item['description'];
    $output .= '</p>';
  }
  $output .= '<div class="styleguide">';
  $output .= $content;
  $output .= '</div>';
  $output .= l(t('Back to top'), '', array(
    'external' => TRUE,
    'attributes' => array(
      'class' => array(
        'styleguide-top',
      ),
    ),
  ));
  return $output;
}