Description: Used to get the breadcrumbs navigation list
Usage:{% breadcrumb 变量名称 with index="首页" title=true %}
If the variable is defined as crumbs{% breadcrumb crumbs with index="首页" title=true %}...{% endbreadcrumb %}
.
breadcrumb supports 3 parameters:
- Whether to display the title
title
title
The parameter can be set to whether the document title is displayed in the document detail breadcrumb. If it is set totitle=false
then the title will not be displayed,title=true
When specified, it displays the full document title; if 'title' is set to other specific values, it displays according to the set value, such astitle="文章详情"
then 'Article Details' is displayed, the default value istitle=true
. - Home Page Name
index
index
Parameters can be set for the home page display name, the default value is Home Page, and you can set it to other names if desired.index="我的博客"
. - Site ID
siteId
siteId
Generally, it is not necessary to fill in. If you have created multiple sites using the multi-site management on the backend and want to call data from other sites, you can do so by specifyingsiteId
To implement the call to data from a specified site.
Crumbs is an array object, so you need to usefor
in a loop to output
item is the variable within the for loop, available fields include:
- 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>