Tag Document List Label

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:

  • TagIDtagId tagIdCan get the document list for a specified Tag such astagId="1"Get the document list for TagID 1.

If not specifiedtagIdIt tries to read the current Tag page's TagID.

  • Model IDmoduleId moduleIdCan get the document list of a specified document model such asmoduleId="1"Get the document list of the article model.
  • Sorting methodorder orderCan 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 quantitylimit limitYou 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 typetype typeSupport 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 Labelpagination paginationTo organize the pagination display{% pagination pages with show="5" %}.
  • Site IDsiteId siteIdGenerally, 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 IDId
  • Document titleTitle
  • Document SEO TitleSeoTitle
  • Document linkLink
  • Document keywordKeywords
  • Document descriptionDescription
  • Document Model IDModuleId
  • Document Category IDCategoryId
  • Documentation specification linkCanonicalUrl
  • Documentation user IDUserId
  • PricePrice
  • InventoryStock
  • Document Reading LevelReadLevel
  • Original Document LinkOriginUrl
  • Document ViewsViews
  • Document cover imageImages
  • Document cover first imageLogo
  • Document cover thumbnailThumb
  • Document comment countCommentCount
  • Document add timeCreatedTimeTimestamp, needs to be formatted as a date{{stampToDate(item.CreatedTime, "2006-01-02")}}
  • Document Update TimeUpdatedTimeTimestamp, 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>