Hi All, i am able to see breadcrumb schema in head tag of the page. We just n...

Contribution Date
Technology
Contribution Project
Contribution Details

Hi All, i am able to see breadcrumb schema in head tag of the page. We just need to check this checkbox. Below code is responsible to add schema.

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()) { // Prepare script tag. $structured_data = [ '#tag' => 'script', '#attributes' => ['type' => 'application/ld+json'], '#value' => $json_ld, ]; // Add script tag. $variables['#attached']['html_head'][] = [ $structured_data, 'easy_breadcrumb_structured_data_json_ld', ]; } } }

You can debug through it, what's wrong with you.

Contribution Author
Files count
0
Patches count
0