forum_node_view

Versions
7
forum_node_view($node, $build_mode)

Implement hook_node_view().

Code

modules/forum/forum.module, line 166

<?php
function forum_node_view($node, $build_mode) {
  $vid = variable_get('forum_nav_vocabulary', 0);
  $vocabulary = taxonomy_vocabulary_load($vid);
  if (_forum_node_check_node_type($node)) {
    if ((bool)menu_get_object()) {
      // Breadcrumb navigation
      $breadcrumb[] = l(t('Home'), NULL);
      $breadcrumb[] = l($vocabulary->name, 'forum');
      if ($parents = taxonomy_get_parents_all($node->forum_tid)) {
        $parents = array_reverse($parents);
        foreach ($parents as $parent) {
          $breadcrumb[] = l($parent->name, 'forum/' . $parent->tid);
        }
      }
      drupal_set_breadcrumb($breadcrumb);

    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.