You are here

function taxonomy_display_taxonomy_term_page in Taxonomy display 7

Page callback; displays all nodes associated with a term.

Parameters

$term: A term object.

Return value

The page content.

1 call to taxonomy_display_taxonomy_term_page()
taxonomy_display_term_page_display_content_type_render in plugins/content_types/term_context/term_page_display.inc
1 string reference to 'taxonomy_display_taxonomy_term_page'
taxonomy_display_menu_alter in ./taxonomy_display.module
Implements of hook_menu_alter().

File

./taxonomy_display.module, line 351
Hooks for the taxonomy display module.

Code

function taxonomy_display_taxonomy_term_page($term) {

  // Ensure custom display settings for taxonomy term page are enabled before
  // altering.
  $view_mode = field_view_mode_settings('taxonomy_term', $term->vocabulary_machine_name);
  if (empty($view_mode['full']['custom_settings'])) {
    module_load_include('inc', 'taxonomy', 'taxonomy.pages');
    return taxonomy_term_page($term);
  }

  // Expose our $term object to altering.
  drupal_alter('taxonomy_display_term_page_term_object', $term);

  // taxonomy_term_page() sets the title this way, if flexibility is requested
  // it can always be added to the module as a configurable setting.
  drupal_set_title($term->name);

  // Load settings for this vocabulary term.
  $display_settings = taxonomy_display_fetch_taxonomy_display($term->vocabulary_machine_name);

  // Breadcrumb display
  $breadcrumb_display = new $display_settings->breadcrumb_display_plugin();
  $breadcrumb_display
    ->buildBreadcrumb($term);

  // Conditionally add core Drupal feed to page
  if ($display_settings->add_feed) {
    drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);
  }

  // Build our content
  $build = array();

  // Term display
  $term_display = new $display_settings->term_display_plugin();
  $build['term_heading'] = $term_display
    ->displayTerm($term, $display_settings->term_display_options);

  // Associated content display
  $associated_display = new $display_settings->associated_display_plugin();
  $build = array_merge($build, $associated_display
    ->displayAssociated($term, $display_settings->associated_display_options));
  return $build;
}