Description: When we tag various tags on the document, we can then call these tags using the document Tag list label.
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, it defaults to reading the current document's ID, or it can be manually specified to read the Tag list of the specified document. To display all Tags without automatically reading the Tag of the current document ID, setitemId="0"
- Number of calls
limit
If not specified, the default maximum number of items displayed is 10, the range that can be set is 1 to 100.limit
When it is not a paging list, supportoffset
Mode, that is,
Separator mode, if you want to start from the 2nd entry and get 10 entries, you can set it tolimit="2,10"
. - Index letters
letter
The range of values that can be filled in is A-Z - Tag Category ID
categoryId
If you need to display a specified category's Tag, you cancategoryId="分类ID"
to specify. If you need to specify multiple category IDs, you can use,
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 the variable within the for loop, the available fields are:)
- TagID
Id
- Tag title
Title
- Tag link
Link
- Tag Description
Description
- Tag Index Letter
FirstLetter
- Tag 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 the templatetag/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>