Description: Used to get the document list for a specified Tag
Usage:{% tagDataList 变量名称 with tagId="1" %}If the variable is defined as archives{% tagDataList archives with tagId="1" %}...{% endtagDataList %}
The parameters supported by tagDataList are:
- TagID
tagIdtagIdCan get the document list for a specified Tag such astagId="1"Get the document list for TagID 1.
If not specified
tagIdIt tries to read the current Tag page's TagID.
- Model ID
moduleIdmoduleIdCan get the document list of a specified document model such asmoduleId="1"Get the document list of the article model. - Sorting method
orderorderCan specify the document display sorting rules, supporting sorting by the latest documentsorder="id desc", Sorting by the most viewed documentsorder="views desc", Sorting by custom sorting in the backgroundorder="sort desc"Default sorting according to custom order, it can be left blank. - Show quantity
limitlimitYou can specify the number of items to display, such as how many items to divide the page by.limit="10"Then only 10 items will be displayed.limitSupport when it is not a paginated listoffsetmode, which is,delimiter mode, if you want to start from the second item and get 10 items, you can set it tolimit="2,10". - List type
typetypeSupport listing by page, list. The default value is list,type="list"If, only the specified limit of the specified quantity will be displayedtype="page"Available afterwardspaginationTo organize the pagination display{% pagination pages with show="5" %}. - Pagination Label
paginationpaginationTo organize the pagination display{% pagination pages with show="5" %}. - Site ID
siteIdsiteIdGenerally, it is not necessary to fill in, if you use the multi-site management on the backend to create multiple sites and want to call data from other sites, you can specifysiteIdTo call the data of the specified site.
archives is an array object, so it needs to be usedforloop to output
item is the variable within the for loop, the available fields are:
- Document ID
Id - Document title
Title - Document SEO Title
SeoTitle - Document link
Link - Document keyword
Keywords - Document description
Description - Document Model ID
ModuleId - Document Category ID
CategoryId - Documentation specification link
CanonicalUrl - Documentation user ID
UserId - Price
Price - Inventory
Stock - Document Reading Level
ReadLevel - Original Document Link
OriginUrl - Document Views
Views - Document cover image
Images - Document cover first image
Logo - Document cover thumbnail
Thumb - Document comment count
CommentCount - Document add time
CreatedTimeTimestamp, needs to be formatted as a date{{stampToDate(item.CreatedTime, "2006-01-02")}} - Document Update Time
UpdatedTimeTimestamp, needs to be formatted as a date{{stampToDate(item.UpdatedTime, "2006-01-02 15:04:05")}} - Document Tag
- Document Additional Field Parameters
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>