Description: Used to get the document list of a specified Tag
Usage:{% tagDataList 变量名称 with tagId="1" %}If the variable is defined as archives{% tagDataList archives with tagId="1" %}...{% endtagDataList %}
The supported parameters of tagDataList are:
- TagID
tagIdtagIdCan retrieve the document list of a specified Tag such astagId="1"Retrieve the document list of TagID 1.
If not specified
tagIdIt will try to read the current Tag page's TagID.
- Model ID
moduleIdmoduleIdCan retrieve the document list of a specified document model such asmoduleId="1"Retrieve the document list of the article model. - the sorting method
orderorderCan specify the sorting rule for document display, supporting sorting by the latest documentsorder="id desc", documents with the most views sortedorder="views desc", sorted by custom sorting in the backgroundorder="sort desc"The default is to sort by custom order, and it can be left blank. - Show Quantity
limitlimitYou can specify the number of items to display, and paginate by that number, for example,limit="10"It will only display 10 entries.limitSupports pagination mode when it is not a pagination listoffsetThat is to say,,Mode of separation, if you want to start from the 2nd item and get 10 items, you can set it tolimit="2,10". - List type
typetypeSupports listing by page or list. The default value is list.type="list"When, it will only display the specified limit of the specified quantity, iftype="page"Subsequent availablepaginationTo organize pagination display{% pagination pages with show="5" %}. - Page Tag
paginationpaginationTo organize pagination display{% pagination pages with show="5" %}. - 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.
'archives' is an array object, so it needs to be usedforin a loop to output
item is the variable within the for loop, available fields include:
- Document ID
Id - Document Title
Title - Document SEO Title
SeoTitle - Document Link
Link - Document Keywords
Keywords - Document Description
Description - Document Model ID
ModuleId - Document Category ID
CategoryId - Documentation specification link
CanonicalUrl - Document User ID
UserId - Price
Price - Inventory
Stock - Document Reading Level
ReadLevel - The original link of the document
OriginUrl - Document Views
Views - Document Cover Image
Images - Document Cover First Image
Logo - Document cover thumbnail
Thumb - Document comment count
CommentCount - Document added time
CreatedTimeTimestamp, needs to format the timestamp to date format{{stampToDate(item.CreatedTime, "2006-01-02")}} - Document update time
UpdatedTimeTimestamp, needs to format the timestamp to date format{{stampToDate(item.UpdatedTime, "2006-01-02 15:04:05")}} - Document tag
- Additional field parameters for the document
Code example
{# page 分页列表展示 #}
<div>
{% tagDataList archives with type="page" limit="10" %}
{% for item in archives %}
<li>
<a href="{{item.Link}}">
<h5>{{item.Title}}</h5>
<div>{{item.Description}}</div>
<div>
<span>{% categoryDetail with name="Title" id=item.CategoryId %}</span>
<span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
<span>{{item.Views}} 阅读</span>
</div>
</a>
{% if item.Thumb %}
<a href="{{item.Link}}">
<img alt="{{item.Title}}" src="{{item.Thumb}}">
</a>
{% endif %}
</li>
{% empty %}
<li>
该列表没有任何内容
</li>
{% endfor %}
{% endtagDataList %}
{# 分页代码 #}
<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>