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
If set, then the full document title is displayed, if title is set to other specific values, it is displayed according to the set value, 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 the variable within the for loop, 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>