Issue #1106344 by mgifford, BarisW: Taxonomy term reference field headers always should be rendered with a HTML header (invisible or not).

8.0.x
webchick 2013-11-05 09:19:50 -08:00
parent a72877411d
commit e04d6380cd
2 changed files with 4 additions and 5 deletions

View File

@ -630,7 +630,7 @@ function template_preprocess_field(&$variables, $hook) {
// label, it needs to supply a preprocess function that sets it to the
// sanitized element title or whatever else is wanted in its place.
$variables['label_hidden'] = ($element['#label_display'] == 'hidden');
$variables['label'] = $variables['label_hidden'] ? NULL : check_plain($element['#title']);
$variables['label'] = check_plain($element['#title']);
// We want other preprocess functions and the theme implementation to have
// fast access to the field item render arrays. The item render array keys

View File

@ -178,10 +178,9 @@ function bartik_menu_tree__shortcut_default($variables) {
function bartik_field__taxonomy_term_reference($variables) {
$output = '';
// Render the label, if it's not hidden.
if (!$variables['label_hidden']) {
$output .= '<h3 class="field-label">' . $variables['label'] . ': </h3>';
}
// Render the label either as a visible list or make it visually hidden for accessibility.
$hidden_class = empty($variables['label_hidden']) ? '' : ' visually-hidden';
$output .= '<h3 class="field-label' . $hidden_class . '">' . $variables['label'] . ': </h3>';
// Render the items.
$output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul class="links">';