thormeier/breadcrumb-bundle

add default breadcrump template for twitter bootstrap

Closed this issue · 2 comments

Do you like to have a PR for support of bootstrap template so that users are able to simple enable it via config?
See e.g. http://getbootstrap.com/components/#breadcrumbs

# app/config/config.yml
thormeier_breadcrumb:
    template: 'breadcrumbs_bootstrap.html.twig'
{# vendor/thormeier/breadcrumb-bundle/Resources/views/breadcrumbs_bootstrap.html.twig #}
{%- if breadcrumbs|length -%}
    <ol class="breadcrumb">
        {%- for crumb in breadcrumbs -%}
            {%- set crumbText = crumb.label|replace('%%', '%')|trans(crumb.labelParameters) -%}
            {%- if crumb.route == app.request.get('_route') -%}
                <li class="active">
                    {{- crumbText -}}
                </li>
            {%- else -%}
                {%- set crumbPath = path(crumb.route, crumb.routeParameters) -%}
                <li>
                    <a href="{{ crumbPath }}" title="{{ crumbText }}">{{ crumbText }}</a>
                </li>
            {%- endif -%}
        {%- endfor -%}
    </ol>
{% endif -%}

Another option would be to provide default implementations for schema markup.
I can open one or more issues for Microdata, RDFa and JSON-LD if you mind.
See http://schema.org/breadcrumb and http://schema.org/breadcrumbList for implementation details.

I think this would be a great addition to this bundle, since bootstrap was added as a form template since SF2.6 already. If you'd like to contribute, feel free to open issues and PRs.

Added such a template and usage exmaple in README in https://github.com/thormeier/breadcrumb-bundle/tree/2.2.0