Description: Used to get breadcrumb navigation list
How to use:{% breadcrumb 变量名称 with index="首页" title=true %}
If you define a variable as crumbs{% breadcrumb crumbs with index="首页" title=true %}...{% endbreadcrumb %}
.
breadcrumb supports 3 parameters:
- Whether to display the title
title
title
Parameters can set whether the document details breadcrumbs display the document title. If settitle=false
The title is not displayed.title=true
When the title is set to another specific value, display the complete document title, such astitle="文章详情"
"Article Details" will be displayed, the default value istitle=true
. - Home Page Name
index
index
The parameters can set the home page display name, the default value is Home page. If you need to change it to other settings, such asindex="我的博客"
. - Site ID
siteId
siteId
Generally, there is no need to fill in it. If you use the background multi-site management to create multiple sites and want to call data from other sites, you can specify itsiteId
To implement the data calling the specified site.
crumbs is an array object, so it needs to be usedfor
Loop to output
item is a variable in the for loop body. The available fields are:
- Link name
Name
- Link address
Link
Code Example
{# 默认用法 #}
<div>
{% breadcrumb crumbs %}
<ul>
{% for item in crumbs %}
<li><a href="{{item.Link}}">{{item.Name}}</a></li>
{% endfor %}
</ul>
{% endbreadcrumb %}
</div>
{# 自定义index,不显示标题 #}
<div>
{% breadcrumb crumbs with index="我的博客" title=false %}
<ul>
{% for item in crumbs %}
<li><a href="{{item.Link}}">{{item.Name}}</a></li>
{% endfor %}
</ul>
{% endbreadcrumb %}
</div>