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
titletitleThe parameter can be set to whether the document title is displayed in the document detail breadcrumb. If it is set totitle=falsethen the title will not be displayed,title=trueWhen 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
indexindexParameters 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
siteIdsiteIdGenerally, 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 specifyingsiteIdTo implement the call to data from a specified site.
Crumbs is an array object, so you need to useforin 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>