Note: After we type various tags into the document, we can use the document tag list tag to call these tags.
How to use:{% tagList 变量名 with limit="10" %}
If variables are defined as tags{% tagList tags with limit="10" %}...{% endtagList %}
The supported parameters of tagList are:
- Document ID
itemId
itemId
If not specified, the ID of the current document is read by default. You can also manually specify it to read the tag list of the specified document. If you want to display all tags without automatically reading the tag of the current document ID, setitemId="0"
- Number of calls
limit
If not specified, up to 10 are displayed by default, and the range that can be set is 1~100.limit
When it is not a paging list, supportoffset
Mode, that is,
Separation mode, if you want to get 10 pieces of data from item 2, you can set it tolimit="2,10"
. - Index letters
letter
The range of values that can be filled in is A-Z - Tag Class ID
categoryId
If you need to display the tag of the specified category, you can usecategoryId="分类ID"
To specify. If you need to specify multiple classification IDs, you can use English,
Separate. likecategoryId="1,2,3"
. - 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.
tags is an array object, so it needs to be usedfor
Loop to output
item is a variable in the for loop body. The available fields are:
- TagID
Id
- Tag title
Title
- Tag link
Link
- Tag Description
Description
- Tag index letters
FirstLetter
- Tag's classification ID
CategoryId
Code Example
<div>
文档Tag:
{% tagList tags with limit="10" %}
{% for item in tags %}
<a href="{{item.Link}}">{{item.Title}}</a>
{% endfor %}
{% endtagList %}
</div>
Document Tag List Pagination Display
Document Tag list supports pagination, but only in templatestag/index.html
Effective within.
<div>
{% tagList tags with type="page" limit="20" %}
<ul>
{% for item in tags %}
<li>
<a href="{{item.Link}}">
<h5>{{item.Title}}</h5>
<div>{{item.Description}}</div>
</a>
</li>
{% empty %}
<liå>
该列表没有任何内容
</li>
{% endfor %}
</ul>
{% endtagList %}
</div>
{# 分页代码 #}
<div>
{% pagination pages with show="5" %}
{# 首页 #}
<a class="{% if pages.FirstPage.IsCurrent %}active{% endif %}" href="{{pages.FirstPage.Link}}">{{pages.FirstPage.Name}}</a>
{# 上一页 #}
{% if pages.PrevPage %}
<a href="{{pages.PrevPage.Link}}">{{pages.PrevPage.Name}}</a>
{% endif %}
{# 中间多页 #}
{% for item in pages.Pages %}
<a class="{% if item.IsCurrent %}active{% endif %}" href="{{item.Link}}">{{item.Name}}</a>
{% endfor %}
{# 下一页 #}
{% if pages.NextPage %}
<a href="{{pages.NextPage.Link}}">{{pages.NextPage.Name}}</a>
{% endif %}
{# 尾页 #}
<a class="{% if pages.LastPage.IsCurrent %}active{% endif %}" href="{{pages.LastPage.Link}}">{{pages.LastPage.Name}}</a>
{% endpagination %}
</div>
</div>