Breadcrumb navigation tags

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 titletitle titleParameters can set whether the document details breadcrumbs display the document title. If settitle=falseThe title is not displayed.title=trueIf 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 Nameindex indexThe 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 IDsiteId siteIdGenerally, 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 itsiteIdTo implement the data calling the specified site.

crumbs is an array object, so it needs to be usedforLoop to output

item is the variable within the for loop, the available fields are:)

  • 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>