Created
October 7, 2012 17:32
-
-
Save mortendk/3849013 to your computer and use it in GitHub Desktop.
twig breadcrumbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
/** | |
* @file | |
* Returns HTML for a breadcrumb trail. | |
* | |
* @param $variables | |
* An associative array containing: | |
* - breadcrumb: An array containing the breadcrumb links. | |
* | |
* @ingroup themeable | |
*/ | |
#} | |
{% if breadcrumb is defined %} | |
<nav class="breadcrumb" role="navigation"> | |
<h2 class="element-invisible">{{ 'You are here'|t }}</h2> | |
<ol> | |
{% for item in breadcrumb %} | |
{% if loop.first %} | |
<li>{{ item }} » </li> | |
{% elseif loop.last %} | |
<li>{{ item }}</li> | |
{% else %} | |
<li>{{ item }} » </li> | |
{% endif %} | |
{% endfor %} | |
</ol> | |
</nav> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment