panels_breadcrumbs.module in Panels Breadcrumbs 8
Same filename and directory in other branches
Module file for panels breadcrumbs module.
File
panels_breadcrumbs.moduleView source
<?php
/**
* @file
* Module file for panels breadcrumbs module.
*/
use Drupal\panels_breadcrumbs\Form\PageVariantBreadcrumbsForm;
/**
* Implements hook_page_manager_variant_operations_alter().
*/
function panels_breadcrumbs_page_manager_variant_operations_alter(&$operations) {
$operations['breadcrumbs'] = [
'title' => t('Breadcrumbs'),
'form' => PageVariantBreadcrumbsForm::class,
];
}
/**
* Implements hook_system_breadcrumb_alter().
*/
function panels_breadcrumbs_system_breadcrumb_alter(&$breadcrumb, &$route_match, &$context) {
if ($page_variant = $route_match
->getParameter('page_manager_page_variant')) {
$variant_settings = $page_variant
->get('variant_settings');
if (array_key_exists('panels_breadcrumbs', $variant_settings) && $variant_settings['panels_breadcrumbs']['state'] == 1) {
$breadcrumb = \Drupal::service('panels_breadcrumbs.breadcrumb')
->build($route_match);
}
}
}
Functions
Name | Description |
---|---|
panels_breadcrumbs_page_manager_variant_operations_alter | Implements hook_page_manager_variant_operations_alter(). |
panels_breadcrumbs_system_breadcrumb_alter | Implements hook_system_breadcrumb_alter(). |