Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <ol class="breadcrumb">
  2. {% set crumbs = [] %}
  3. {% set current = {'crumb': this} %}
  4. {% for i in this._path.split("/") %}
  5. {% if current.crumb is not none %}
  6. {% if crumbs.insert(0, current.crumb) %}{% endif %}
  7. {% if current.update({"crumb": current.crumb.parent}) %}{% endif %}
  8. {% endif %}
  9. {% endfor %}
  10. {% for crumb in crumbs %}
  11. {% if this._path == crumb._path %}
  12. <li class="active">{{ crumb.title }}</li>
  13. {% else %}
  14. <li><a href="{{ crumb|url }}">{{ crumb.title }}</a></li>
  15. {% endif %}
  16. {% endfor %}
  17. </ol>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement