You are here

function hook_taxonomy_menu_block_active_tid_alter in Taxonomy menu block 7

Alter the active tid.

Dynamic trees get built based on this tid: only the subs of this tid will be shown. The active trail is also based on this active tid.

Currently only taxonomy (taxonomy/term/%) and node (node/%) pages are supported. On taxonomy pages the active tid is always the tid of the currently viewed term, on node pages the active tid is the value of any term reference field (if any) that refers to the vocabulary we need to display.

Parameters

int $tid: The currently active tid.

array $config: An array containing configuration of current block.

1 invocation of hook_taxonomy_menu_block_active_tid_alter()
taxonomy_menu_block_build in ./taxonomy_menu_block.module
Function to build our tree.

File

./taxonomy_menu_block.api.php, line 63
Hooks provided by the Taxonomy Menu Block module.

Code

function hook_taxonomy_menu_block_active_tid_alter(&$tid, &$config) {

  // Add support for a custom page we have defined in our Drupal setup, for
  // example with Views: www.site.com/custom/page/tid.
  if (arg(0) == 'custom' && arg(1) == 'page') {
    $tid = arg(2);
  }
}