You are here

function _pathauto_CrumbsPlugin::findParent__node__ in Crumbs, the Breadcrumbs suite 6

File

plugins/crumbs.pathauto.inc, line 23

Class

_pathauto_CrumbsPlugin
Implementation of class hook class_CrumbsParentFinder on the behalf of path module.

Code

function findParent__node__($path, $item) {
  $node = $item['page_arguments'][0];
  if (is_object($node)) {
    $placeholders = pathauto_get_placeholders('node', $node);
    $alias = pathauto_create_alias('node', 'return', $placeholders, $path, $node->nid, $node->type, $node->language);
    $fragments = explode('/', $alias);
    if (count($fragments) > 1) {
      array_pop($fragments);
      return implode('/', $fragments);
    }
  }
}