Tag Document List Tag

Description: Used to get the document list for a specified Tag

How to use:{% tagDataList 变量名称 with tagId="1" %}If you define a variable as archives{% tagDataList archives with tagId="1" %}...{% endtagDataList %}

The supported parameters of tagDataList are:

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

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

  • Model IDmoduleId moduleIdYou can get a list of documents for a specified document model, such asmoduleId="1"Get a list of documents for the article model.
  • sort byorder orderYou can specify the sorting rules for document display, and support sorting by latest documentorder="id desc", the most views document sortingorder="views desc", custom sort by backgroundorder="sort desc", by default, sorted by custom, you don't need to fill in it.
  • Display quantitylimit limitYou can specify the number of displays and paging them by the number, for examplelimit="10"It will only display 10 items.,limitWhen it is not a paging list, supportoffsetMode, that is,Separator mode, if you want to start from the 2nd entry and get 10 entries, you can set it tolimit="2,10".
  • List Typetype typeSupports listing in page and list modes. The default value is list.type="list"When the specified limit is displayed, only the specified number of limit is specified, iftype="page"Resume laterpaginationTo organize pagination display{% pagination pages with show="5" %}.
  • Pagination Tagspagination paginationTo organize pagination display{% pagination pages with show="5" %}.
  • Site IDsiteId siteIdGenerally, 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 itsiteIdTo implement the data calling 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 keywordsKeywords
  • Document descriptionDescription
  • Document Model IDModuleId
  • Document Category IDCategoryId
  • Document specification linkCanonicalUrl
  • document user IDUserId
  • pricePrice
  • in stockStock
  • Document reading levelReadLevel
  • Original link to the documentOriginUrl
  • Document view countViews
  • Document cover pictureImages
  • First image of the document coverLogo
  • Document cover thumbnailThumb
  • Number of document commentsCommentCount
  • Document addition timeCreatedTimeTime stamp, need to use formatted timestamps as date format{{stampToDate(item.CreatedTime, "2006-01-02")}}
  • Document update timeUpdatedTimeTime stamp, need to use formatted timestamps as date format{{stampToDate(item.UpdatedTime, "2006-01-02 15:04:05")}}
  • Document tags
  • Document extra 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>