You are here

function forum_CrumbsMonoPlugin_forumTermName::findTitle__forum_x in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 7.2 plugins/crumbs.forum.inc \forum_CrumbsMonoPlugin_forumTermName::findTitle__forum_x()

Forums get their parent forums as breadcrumb parent. The method name matches the router path "forum/%". Forums are actually taxonomy terms, just the path is different.

File

plugins/crumbs.forum.inc, line 67

Class

forum_CrumbsMonoPlugin_forumTermName

Code

function findTitle__forum_x($path, $item) {
  $term = $item['map'][1];

  // Load the forum term,
  // if it hasn't been loaded due to a missing wildcard loader.
  // We could use forum_forum_load() instead, but this looks too scary
  // performance-wise, and we don't actually need it.
  // So we just use taxonomy_term_load() instead.
  $term = is_numeric($term) ? taxonomy_term_load($term) : $term;
  if (!empty($term) && !empty($term->name)) {
    return $term->name;
  }
}