|
breadcrumb |
|
breadcrumb is a loop used to generate the breadcrumb, which is the trail of category names at the top of each article's permalink page in the default article template.
The basic syntax of the loop is:
{{loop breadcrumb}}
(body of loop goes here)
{{/loop}}
The loop starts with the Main Page category and does one iteration for each category up to and including the current one. For example, if the currently viewed article is in the category Main Page/Sports/Archery, the loop will go through Main Page, then Sports, then Archery.
Within the breadcrumb loop, you can use these variables, whose contents change with each iteration:
| • | label |
The label of the category for the current iteration. The label of a category is the name that is displayed to the blog reader.
| • | name |
The name of the category for the current iteration. The name of a category is the name used internally by the blog system. A category's name is part of its URL.
| • | selected |
A boolean that is true when the category for the current iteration is the current category.
| • | url |
The URL of the page for the category for the current iteration.
Example
Here is an example breadcrumb loop:
{{loop breadcrumb}}
<a href="{{url}}">{{label}} ({{name}})</a>
<br>
{{if selected}}
<strong> :: You are here</strong>
{{/if}}
{{/loop}}
For an article in the category Main Page/Sports/Archery, the breadcrumbs would look like this:
Main Page (mainpage)
Sports (sports)
Archery (archery) :: You are here