diff options
Diffstat (limited to 'modules/taxonomy/taxonomy.pages.inc')
-rw-r--r-- | modules/taxonomy/taxonomy.pages.inc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc index 501ebbe10..4d2c4e6fc 100644 --- a/modules/taxonomy/taxonomy.pages.inc +++ b/modules/taxonomy/taxonomy.pages.inc @@ -33,21 +33,24 @@ function taxonomy_term_page($term) { drupal_set_breadcrumb($breadcrumb); drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name); - $build = array(); + // 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); - $build['term_heading'] = array( - '#prefix' => '<div class="term-listing-heading">', - '#suffix' => '</div>', - 'term' => taxonomy_term_view($term, 'full'), - ); + // Set the term path as the canonical URL to prevent duplicate content. + 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); if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) { $nodes = node_load_multiple($nids); $build += node_view_multiple($nodes); $build['pager'] = array( '#theme' => 'pager', '#weight' => 5, - ); + ); } else { $build['no_content'] = array( |