@register.inclusion_tag('bootstrap/breadcrumb.html', takes_context=True)
def breadcrumb_nav(context):
 breadcrumb = []
 dashboard = context.request.horizon['dashboard']
 try:
  panel_groups = dashboard.get_panel_groups()
 except KeyError:
  panel_groups = None
 panel_group = None
 panel = context.request.horizon['panel']
 if panel_groups:
  for group in panel_groups.values():
   if ((panel.slug in group.panels) and (group.slug != 'default')):
    panel_group = group
    break
 if (panel.get_absolute_url() == context.request.path):
  panel = None
 custom_breadcrumb = context.get('custom_breadcrumb')
 breadcrumb.append((dashboard.name, None))
 if panel_group:
  breadcrumb.append((panel_group.name, None))
 if panel:
  breadcrumb.append((panel.name, panel.get_absolute_url()))
 if custom_breadcrumb:
  breadcrumb.extend(custom_breadcrumb)
 breadcrumb.append((context.get('page_title'), None))
 return {'breadcrumb': breadcrumb}

@ register . inclusion_tag ( 'bootstrap/breadcrumb.html' , takes_context = True ) def breadcrumb_nav ( context ) : breadcrumb = [ ] dashboard = context . request . horizon [ 'dashboard' ] try : panel_groups = dashboard . get_panel_groups ( ) except KeyError : panel_groups = None panel_group = None panel = context . request . horizon [ 'panel' ] if panel_groups : for group in panel_groups . values ( ) : if ( ( panel . slug in group . panels ) and ( group . slug != 'default' ) ) : panel_group = group break if ( panel . get_absolute_url ( ) == context . request . path ) : panel = None custom_breadcrumb = context . get ( 'custom_breadcrumb' ) breadcrumb . append ( ( dashboard . name , None ) ) if panel_group : breadcrumb . append ( ( panel_group . name , None ) ) if panel : breadcrumb . append ( ( panel . name , panel . get_absolute_url ( ) ) ) if custom_breadcrumb : breadcrumb . extend ( custom_breadcrumb ) breadcrumb . append ( ( context . get ( 'page_title' ) , None ) ) return { 'breadcrumb' : breadcrumb }
a logic heavy function for automagically creating a breadcrumb .