--- faq.module 28 Mar 2007 10:44:07 -0000 1.1.4.25
+++ faq.module 29 Mar 2007 14:10:22 -0000
@@ -181,6 +181,42 @@
   return $form;
 }

+function faq_view($node, $teaser = FALSE, $page = FALSE) {
+
+  if ($page) {
+    $breadcrumb = array();
+    $breadcrumb[] = array('path' => 'node/'. $node->nid);
+
+    if (module_exists("taxonomy") && $node->taxonomy) {
+      foreach ($node->taxonomy as $term) {
+        $current = $term;
+        continue;
+      }
+      $breadcrumb[] = array(
+        'path' => 'faq/'. $current->tid,
+        'title' => $current->name,
+      );
+      while ($parents = taxonomy_get_parents($current->tid)) {
+        $current = array_shift($parents);
+        $breadcrumb[] = array(
+          'path' => 'faq/'. $current->tid,
+          'title' => $current->name,
+        );
+      }
+    }
+    $breadcrumb[] = array(
+      'path' => 'faq',
+      'title' => variable_get('faq_title', t('Frequently Asked Questions')),
+    );
+    $breadcrumb = array_reverse($breadcrumb);
+    menu_set_location($breadcrumb);
+  }
+
+  $node = node_prepare($node, $teaser);
+
+  return $node;
+}
+
 function faq_settings_page($op = NULL, $aid = NULL) {
   $output .= drupal_get_form('faq_general_settings_form');
@@ -365,6 +401,30 @@
 function faq_page($tid = 0) {
   drupal_add_css(drupal_get_path('module', 'faq') .'/faq.css');
   drupal_set_title(variable_get('faq_title', t('Frequently Asked Questions')));
+  if (!module_exists("taxonomy")) {
+    $tid = 0;
+  }
+
+  // configure the breadcrumb trail
+  $breadcrumb = array();
+
+  if (!empty($tid)) {
+    $current = taxonomy_get_term($tid);
+    $breadcrumb[] = array('path' => 'faq/'. $tid, 'title' => $current->name);
+    while ($parents = taxonomy_get_parents($current->tid)) {
+      $current = array_shift($parents);
+      $breadcrumb[] = array('path' => 'faq/'. $current->tid,
+        'title' => $current->name,
+      );
+    }
+    $breadcrumb[] = array('path' => 'faq',
+      'title' => variable_get('faq_title', t('Frequently Asked Questions')),
+    );
+    $breadcrumb = array_reverse($breadcrumb);
+    menu_set_location($breadcrumb);
+  }
+
+

   // get page layout
   $faq_display = variable_get('faq_display', 'questions_top');
