Reputation: 99
I created a custom view in Sonata Admin following recipe from official doc (here).
Everything is working good, but breadcrumb is empty (the same in last screenshot of recipe).
I googled a lot without success... Isn't it possible to display breadcrumbs with custom views in Sonata Admin?
Upvotes: 0
Views: 421
Reputation: 541
Another option to show a custom breadcrumb is to define a block for it, like this:
{% extends '@SonataAdmin/standard_layout.html.twig' %}
{% block breadcrumb %}
<li>
<a href="/admin/dashboard">
<i class="fa fa-home"></i>
</a>
</li>
<li class="active">
<span>My Profile</span>
</li>
{% endblock %}
{#
More HTML/Twig code
#}
Upvotes: 0
Reputation: 99
I achieved this by extending sonata_breadcrumb block:
{% block sonata_breadcrumb %}
<div class="hidden-xs">
<ol class="nav navbar-top-links breadcrumb">
<li>
<a href="/admin">
<i class="fa fa-home"></i>
</a>
</li>
<li class="active">
<span>My Custom View</span>
</li>
</ol>
</div>
{% endblock sonata_breadcrumb %}
Can someone confirm it's the right way to do it?
Upvotes: 1