Overview
This tag looks at the current URL and look for any entries that match each segment. Let's say you visit /italian/articles/dance
. The logic works like this:
- Looks for an entry with a URL of /italian/articles/dance.
- Pops the last segment off (
dance
) and look for an entry with a url of/italian/articles
- Do the same for
/italian
- If
include_home
is set totrue
, look an entry with a url of/
.
If any of the URLs don't match an entry in the current site, they will be skipped, so be sure to create translations for parent pages you if you're working on a multisite.
Breadcrumbs don't follow structures, they follow the current URL hierarchy.
Example
Here's an example of what breadcrumbs might look like, as well as a code example in use.
<ul class="breadcrumbs"> {{ nav:breadcrumbs }} <li{{ if is_current }} class="current"{{ /if }}> <a href="{{ url }}">{{ title }}</a> </li> {{ /nav:breadcrumbs }}</ul>
<ul class="breadcrumbs"> <s:nav:breadcrumbs> <li @if ($is_current) class="current" @endif > <a href="{{ $url }}">{{ $title }}</a> </li> </s:nav:breadcrumbs></ul>
Parameters
include_home
Include the home page as the first breadcrumb. Default: true
.
reverse
Reverse the order of links.
trim
Trim the whitespace from each iteration of the loop. Default: true
.
Variables
Variable | Type | Description |
---|---|---|
is_current |
boolean |
|
data/content |
mixed |
All data and variables are available for each item in the list. |