What's next? verify your email address for reply notifications!
Wow, that was dead simple man! Thanks for the little tutorial!
I was thinking of integrating your solution with Twitter Bootstrap's Bread crumb ui.
Hey Mark, thank you for your kind comments. Feel free to show off the twitter bootstrap integration!
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 !
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.
| n
I updated the example above to be more correct.
Hi Russell,
Thanks for your answer !
btw, you solved another problem I faced with this | n tip :).
Comments
Wow, that was dead simple man! Thanks for the little tutorial!
I was thinking of integrating your solution with Twitter Bootstrap's Bread crumb ui.
Hey Mark, thank you for your kind comments. Feel free to show off the twitter bootstrap integration!
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 :
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> / % endforThanks again for this useful tool !
Julien
The problem wasn't with the links method, the problem was with my example mako template code:
Newer versions of pyramid escape HTML. To prevent escaping HTML (to send HTML into your template from your view) use the
| nfilter.I updated the example above to be more correct.
Hi Russell,
Thanks for your answer !
btw, you solved another problem I faced with this
| ntip :).Julien