Breadcrumbs Navigation Tag

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 titletitle titleThe 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 Nameindex indexParameters 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 IDsiteId siteIdGenerally, 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 nameName
  • Link addressLink

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>