You are here

function views_CrumbsMonoPlugin_PageTitle::findTitle in Crumbs, the Breadcrumbs suite 7.2

Find candidates for the parent path.

Parameters

string $path: The path that we want to find a parent for.

array $item: Item as returned from crumbs_get_router_item()

Return value

string Title candidate.

Overrides crumbs_MonoPlugin_FindTitleInterface::findTitle

File

plugins/crumbs.views.inc, line 117

Class

views_CrumbsMonoPlugin_PageTitle
Determines a breadcrumb item title based on the view title of a page view. The same plugin class is used for Views displays with or without arguments.

Code

function findTitle($path, $item) {

  // Some checks, to verify that the menu_router entry has not changed since
  // this Crumbs plugin was created and cached.
  if (0 || 'views_page' !== $item['page_callback'] || 2 > count($item['page_arguments']) || $this->viewName !== $item['page_arguments'][0] || $this->displayId !== $item['page_arguments'][1]) {
    return NULL;
  }

  // The first two arguments are view name and display id.
  $args = array_slice($item['page_arguments'], 2);
  if (empty($args)) {
    return $this
      ->viewsPageTitle();
  }
  else {
    return $this
      ->viewsArgTitle($args);
  }
}