function crumbs_get_trail in Crumbs, the Breadcrumbs suite 7
Same name and namespace in other branches
- 6.2 crumbs.module \crumbs_get_trail()
- 6 crumbs.module \crumbs_get_trail()
- 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
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];
}