Related Document Tags

How to use:{% archiveList 变量名称 with type="related" limit="10" %}If you define a variable as archives{% archiveList archives with type="related" limit="10" %}...{% endarchiveList %}

typeIf the value of related, the order parameter is not supported.

type

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 linkLink
  • Document keywordsKeywords
  • Document descriptionDescription
  • Document Category IDCategoryId
  • 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
  • Other field parameters for document model settings

Code Example

Get relevant document tags, which can only be used on the document details page.

{# related 相关文档列表展示 #}
<div>
{% archiveList archives with type="related" 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 %}
{% endarchiveList %}
</div>