@register.function
@jinja2.contextfunction
def mkt_breadcrumbs(context, product=None, items=None, crumb_size=40, add_default=True, cls=None):
 if add_default:
  crumbs = [(reverse('home'), _('Home'))]
 else:
  crumbs = []
 if product:
  if items:
   url_ = product.get_detail_url()
  else:
   url_ = None
  crumbs += [(None, _('Apps')), (url_, product.name)]
 if items:
  crumbs.extend(items)
 if (len(crumbs) == 1):
  crumbs = []
 crumbs = [(u, truncate(label, crumb_size)) for (u, label) in crumbs]
 t = env.get_template('site/helpers/breadcrumbs.html').render({'breadcrumbs': crumbs, 'cls': cls})
 return jinja2.Markup(t)

@ register . function @ jinja2 . contextfunction def mkt_breadcrumbs ( context , product = None , items = None , crumb_size = 40 , add_default = True , cls = None ) : if add_default : crumbs = [ ( reverse ( 'home' ) , _ ( 'Home' ) ) ] else : crumbs = [ ] if product : if items : url_ = product . get_detail_url ( ) else : url_ = None crumbs += [ ( None , _ ( 'Apps' ) ) , ( url_ , product . name ) ] if items : crumbs . extend ( items ) if ( len ( crumbs ) == 1 ) : crumbs = [ ] crumbs = [ ( u , truncate ( label , crumb_size ) ) for ( u , label ) in crumbs ] t = env . get_template ( 'site/helpers/breadcrumbs.html' ) . render ( { 'breadcrumbs' : crumbs , 'cls' : cls } ) return jinja2 . Markup ( t )
wrapper function for breadcrumbs .