diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-05-08 15:37:54 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-05-08 15:37:54 -0400 |
commit | 0edd27cb1598db329bc9fa4b912cb1d014308c18 (patch) | |
tree | 837c4e15002429d48fb94e988a7c71269737d1ae /modules/taxonomy/taxonomy.module | |
parent | b84c45a0c3cbe58823bb264648390ef61e8d395c (diff) | |
download | drupal-0edd27cb1598db329bc9fa4b912cb1d014308c18.tar.gz drupal-0edd27cb1598db329bc9fa4b912cb1d014308c18.zip |
- Patch #796692 by dman, cross, andypost, aaronbauman, yched, BarisW: only show the term heading if the term has a description.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index d14a169c875e..f08df601e3b7 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -694,12 +694,15 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) { $build += field_attach_view('taxonomy_term', $term, $view_mode, $langcode); - $build['description'] = array( - '#markup' => check_markup($term->description, $term->format, '', TRUE), - '#weight' => 0, - '#prefix' => '<div class="taxonomy-term-description">', - '#suffix' => '</div>', - ); + // Add term description if the term has one. + if (!empty($term->description)) { + $build['description'] = array( + '#markup' => check_markup($term->description, $term->format, '', TRUE), + '#weight' => 0, + '#prefix' => '<div class="taxonomy-term-description">', + '#suffix' => '</div>', + ); + } $build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css'; @@ -727,6 +730,7 @@ function template_preprocess_taxonomy_term(&$variables) { $variables = array_merge((array) $term, $variables); // Helpful $content variable for templates. + $variables['content'] = array(); foreach (element_children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key]; } |