How to generate breadcrums

20 views
Skip to first unread message

MH

unread,
Apr 16, 2020, 9:15:18 AM4/16/20
to Django users
Hi there

I need some advice how to implement breadcrumbs in a base.html.

I have already installed django-bootstrap-breadcrumbs, registered it in the apps and so on. So far I would say, it's working,

Just for testing purposes it looks like this:
 <nav aria-label="breadcrumb" class="nav navbar-nav navbar-left">        
 {% load django_bootstrap_breadcrumbs %}
 {% block breadcrumbs %}
 {% clear_breadcrumbs %}
 {% breadcrumb "Home" "/" %}
 {% breadcrumb "Users and groups" "dummy" %}
 {% breadcrumb "tbd" "mockupview.index" %}
 {% endblock %}
 {% render_breadcrumbs %}
 
</nav>


However, I would like to generate the breadcrumbs based on which view is extending the base.html file. And I do not know how to achieve that.

Do you have any advice for me?

MH

unread,
Apr 16, 2020, 9:23:10 AM4/16/20
to Django users
PS: I was just asking myself if I could somehow tell django what the hierarchy of views might be instead of defining the breadcrumbs for each view manually.
Reply all
Reply to author
Forward
0 new messages