From 410115d6ad54e00a7b861f6183c96ed21dd1e67b Mon Sep 17 00:00:00 2001 From: Oliver Davies <oliver@oliverdavies.co.uk> Date: Tue, 25 Nov 2014 16:54:16 +0000 Subject: [PATCH] Issue #2060691: Render mentors in an unordered list --- template.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/template.php b/template.php index 58e661b8..7672ca2b 100644 --- a/template.php +++ b/template.php @@ -72,3 +72,27 @@ function bluecheese_menu_local_tasks(&$variables) { return $output; } + +/** + * Implements theme_field__field_type(). + */ +function bluecheese_field__field_mentors($variables) { + $output = ''; + + // Render the label, if it's not hidden. + if (!$variables['label_hidden']) { + $output .= '<h3 class="field-label">' . $variables['label'] . ': </h3>'; + } + + // Render the items. + $output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul class="links">'; + foreach ($variables['items'] as $delta => $item) { + $output .= '<li class="field-mentors-' . $delta . '"' . $variables['item_attributes'][$delta] . '>' . drupal_render($item) . '</li>'; + } + $output .= '</ul>'; + + // Render the top-level DIV. + $output = '<div class="' . $variables['classes'] . (!in_array('clearfix', $variables['classes_array']) ? ' clearfix' : '') . '">' . $output . '</div>'; + + return $output; +} -- GitLab