You are here

function crumbs_get_trail in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 6.2 crumbs.module \crumbs_get_trail()
  2. 6 crumbs.module \crumbs_get_trail()
  3. 7.2 crumbs.module \crumbs_get_trail()

Returns the trail for the provided path.

Parameters

$path: The path for which the trail is built. If NULL, the url of the current page is assumed.

Return value

An associative array containing the trail, with the paths as the keys, and the router items (as received from crumbs_get_router_item()) as the values.

See also

crumbs_TrailFinder

2 calls to crumbs_get_trail()
crumbs_get_breadcrumb_data in ./crumbs.module
Returns the breadcrumb data for the current page.
_crumbs_themekey_path2trailpaths in ./crumbs.module
Callback for themekey integration.

File

./crumbs.module, line 268
Provides an API for building breadcrumbs.

Code

function crumbs_get_trail($path = NULL) {
  static $trails = array();
  if (!isset($path)) {
    $path = $_GET['q'];
  }
  $path = drupal_get_normal_path($path);
  if (!isset($trails[$path])) {
    $finder = crumbs_get_trail_finder();
    $trails[$path] = $finder
      ->buildTrail($path);
  }
  return $trails[$path];
}