Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Good day
Thanks fo Theme
How change field labels "h2" to "div"
I change in template.php
// Render the label, if it's not hidden.
if (!$vars['label_hidden']) {
$output .= '<div class="field-label"' . $vars['title_attributes'] . '>' . $vars['label'] . ': </div>';
}
// Render the items.
$output .= '<div class="field-items"' . $vars['content_attributes'] . '>';
foreach ($vars['items'] as $delta => $item) {
$classes = 'field-item ' . ($delta % 2 ? 'odd' : 'even');
$output .= '<div class="' . $classes . '"' . $vars['item_attributes'][$delta] . '>' . drupal_render($item) . '</div>';
}
$output .= '</div>';
// Render the top-level wrapper element.
$tag = $vars['tag'];
$output = "<$tag class=\"" . $vars['classes'] . '"' . $vars['attributes'] . '>' . $output . "</$tag>";
return $output;
}
But, only name of taxonomy voc-ry changed, another field name - without change
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedTaxonomy field has its own template in the core theme, override that also.
Comment #2
manoloka CreditAttribution: manoloka commentedWhen I use the code above I get a blank screen :(
Dreamweaver tells me that there's 2 errors in the code (sorry I'm not a programmer so I don't know which ones are)
one in this line (2nd from bottom)
$output = "<$tag class="" . $vars['classes'] . '"' . $vars['attributes'] . '>' . $output . "</$tag>";
another one on the last closing brace
}