You are here

function tvi_menu_alter in Taxonomy Views Integrator 7

Same name and namespace in other branches
  1. 6 tvi.module \tvi_menu_alter()

Implements hook_menu_alter().

File

./tvi.module, line 100
Allow to define views to be used instead of default drupal behavior on taxonomy terms pages.

Code

function tvi_menu_alter(&$items) {
  $items['taxonomy/term/%taxonomy_term']['page callback'] = 'tvi_render_view';
  $items['taxonomy/term/%taxonomy_term']['page arguments'] = array(
    2,
  );
  $items['taxonomy/term/%taxonomy_term']['access callback'] = 'tvi_render_view_access';
  $items['taxonomy/term/%taxonomy_term']['access arguments'] = array(
    2,
  );

  // Avoid views to override tvi.
  unset($items['taxonomy/term/%']);

  // Views might have completely wiped the original title callback, so restore
  // it. This is useful for breadcrumb-generating modules such as Crumbs or
  // Easy breadcrumbs.
  $items['taxonomy/term/%taxonomy_term']['title callback'] = 'taxonomy_term_title';
  $items['taxonomy/term/%taxonomy_term']['title arguments'] = array(
    2,
  );
}