Hi ! Your breadcrumbs solution is the best I've found so far. After implementing it in my Pyramid application, it happens that link are displayed without being interpreted in HTML:
"localhost:6543 / (...)"
Did I miss something ?
Thanks,
Julien
@update :
I solved my error by tweaking a bit your links function :
def links( self ): links = [] for count, crumb in enumerate( self.crumbs, start = 1 ): crumb_uri = self._protocol + '/'.join( self.crumbs[ 0:count ] ) links.append({'uri':crumb_uri, 'crumb':crumb}) return links
I also embedded it in a Bootstrap breadcrumb (as suggested earlier) :
% for link in request.bread.links: <a href="${link['uri']}" rel="nofollow">${link['crumb']}</a> / % endfor
Thanks again for this useful tool !
Julien
The problem wasn't with the links method, the problem was with my example mako template code:
% for link in links: ${link|n} / % endfor
Newer versions of pyramid escape HTML. To prevent escaping HTML (to send HTML into your template from your view) use the | n
filter.
I updated the example above to be more correct.