Document Tag List Tag

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 IDitemId itemIdIf 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 callslimitIf not specified, the default maximum number of items displayed is 10, the range that can be set is 1 to 100.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".
  • Index lettersletterThe range of values ​​that can be filled in is A-Z
  • Tag Category IDcategoryIdIf 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 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.

tags is an array object, so it needs to be usedforLoop to output

item is the variable within the for loop, the available fields are:)

  • TagIDId
  • Tag titleTitle
  • Tag linkLink
  • Tag DescriptionDescription
  • Tag Index LetterFirstLetter
  • Tag Classification IDCategoryId

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.htmlEffective 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>