Loading easy_breadcrumb.module +18 −16 Original line number Diff line number Diff line Loading @@ -41,10 +41,11 @@ function easy_breadcrumb_help($route_name) { } /** * Implements hook_block_view_BASE_BLOCK_ID_alter(). * Implements hook_preprocess_HOOK(). */ function easy_breadcrumb_block_view_system_breadcrumb_block_alter(array &$build, BlockPluginInterface $block) { function easy_breadcrumb_preprocess_block(&$variables) { if($variables['plugin_id'] == 'system_breadcrumb_block') { // Get JSON-LD. if ($json_ld = \Drupal::service('easy_breadcrumb.structured_data_json_ld') ->value()) { Loading @@ -57,9 +58,10 @@ function easy_breadcrumb_block_view_system_breadcrumb_block_alter(array &$build, ]; // Add script tag. $build['#attached']['html_head'][] = [ $variables['#attached']['html_head'][] = [ $structured_data, 'easy_breadcrumb_structured_data_json_ld', ]; } } } Loading
easy_breadcrumb.module +18 −16 Original line number Diff line number Diff line Loading @@ -41,10 +41,11 @@ function easy_breadcrumb_help($route_name) { } /** * Implements hook_block_view_BASE_BLOCK_ID_alter(). * Implements hook_preprocess_HOOK(). */ function easy_breadcrumb_block_view_system_breadcrumb_block_alter(array &$build, BlockPluginInterface $block) { function easy_breadcrumb_preprocess_block(&$variables) { if($variables['plugin_id'] == 'system_breadcrumb_block') { // Get JSON-LD. if ($json_ld = \Drupal::service('easy_breadcrumb.structured_data_json_ld') ->value()) { Loading @@ -57,9 +58,10 @@ function easy_breadcrumb_block_view_system_breadcrumb_block_alter(array &$build, ]; // Add script tag. $build['#attached']['html_head'][] = [ $variables['#attached']['html_head'][] = [ $structured_data, 'easy_breadcrumb_structured_data_json_ld', ]; } } }