summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.pages.inc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/taxonomy/taxonomy.pages.inc')
-rw-r--r--modules/taxonomy/taxonomy.pages.inc22
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index 4d2c4e6fc..299c7bb6e 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -14,7 +14,9 @@
* The page content.
*/
function taxonomy_term_page($term) {
- // Assign the term name as the page title.
+ // If there is a menu link to this term, the link becomes the last part of
+ // the active trail, and the link name becomes the page title. Thus, we must
+ // explicitly set the page title to be the term title.
drupal_set_title($term->name);
// Build breadcrumb based on the hierarchy of the term.
@@ -33,17 +35,23 @@ function taxonomy_term_page($term) {
drupal_set_breadcrumb($breadcrumb);
drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);
- // If there is a menu link to this term, the link becomes the last part of
- // the active trail, and the link name becomes the page title. Thus, we must
- // explicitly set the page title to be the node title.
- $uri = entity_uri('taxonomy_term', $term);
-
// Set the term path as the canonical URL to prevent duplicate content.
+ $uri = entity_uri('taxonomy_term', $term);
drupal_add_html_head_link(array('rel' => 'canonical', 'href' => url($uri['path'], $uri['options'])), TRUE);
// Set the non-aliased path as a default shortlink.
drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url($uri['path'], array_merge($uri['options'], array('alias' => TRUE)))), TRUE);
- $build = taxonomy_term_show($term);
+ // Normally we would call taxonomy_term_show() here, but for backwards
+ // compatibility in Drupal 7 we do not want to do that (it produces different
+ // data structures and HTML markup than what Drupal 7 released with). Calling
+ // taxonomy_term_view() directly provides essentially the same thing, but
+ // allows us to wrap the rendered term in our desired array structure.
+ $build['term_heading'] = array(
+ '#prefix' => '<div class="term-listing-heading">',
+ '#suffix' => '</div>',
+ 'term' => taxonomy_term_view($term, 'full'),
+ );
+
if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {
$nodes = node_load_multiple($nids);
$build += node_view_multiple($nodes);