Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Schema Breadcrumb Bundle Laravel Package

exs/schema-breadcrumb-bundle

Symfony bundle that generates schema.org BreadcrumbList JSON-LD script tags from Twig. Pass an ordered array of breadcrumb items with name, URL, and optional image to the getJsonBreadcrumb() function to output valid structured data for search engines.

View on GitHub
Deep Wiki
Context7

EXS-Schema-BreadcrumbBundle

Build Status

What is this bundle doing ?

This bundle generates the <script> tag containing the json object required to define the BreadcrumbList object as defined by schema.org

Source: http://schema.org/BreadcrumbList

Installation

Add the bundle with composer :

$ composer require exs/schema-breadcrumb-bundle

Enable the bundle in the kernel :

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new EXS\SchemaBreadcrumbBundle\EXSSchemaBreadcrumbBundle(),
        // ...
    );
}

Usage

Example :

<!DOCTYPE html>
<html>
    <head>
        ...
        {{ getJsonBreadcrumb([
            {
                'name': 'Category One',
                'url': 'http://www.test.tld/category-one',
                'image': 'http://www.test.tld/images/category-one.png'
            },
            {
                'name': 'Subcategory Two',
                'url': 'http://www.test.tld/category-one/subcategory-two'
            },
            {
                'name': 'Element Three',
                'url': 'http://www.test.tld/category-one/subcategory-two/element-three'
            }
        ]) }}
    </head>
    <body>
        ...
    </body>
</html>

The order of the elements in the array is used to define the order of elements in the breadcrumb.

The example above will generate the ld+json tag as :

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "item": {
                "@id": "http://www.test.tld/category-one",
                "name": "Category One",
                "image": "http://www.test.tld/images/category-one.png"
            }
        },
        {
            "@type": "ListItem",
            "position": 2,
            "item": {
                "@id": "http://www.test.tld/category-one/subcategory-two",
                "name": "Subcategory Two"
            }
        },
        {
            "@type": "ListItem",
            "position": 3,
            "item": {
                "@id": "http://www.test.tld/category-one/subcategory-two/element-three",
                "name": "Element Three"
            }
        }
    ]
}
</script>

And will be interpreted by search engines as a breadcrumb like :

Category One > Subcategory Two > Element Three
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource