Document Details Tags

Description: Used to obtain document details data

How to use:{% archiveDetail 变量名称 with name="字段名称" id="1" %}The variable name is not necessary. After setting the variable name, you can call it through the variable name in the future. Without setting the variable name, the result will be output directly.

The supported parameters of archiveDetail are:

  • Document IDid
    idIt is not necessary, the current document will be retrieved by default. If you need to specify a document, you can set the id to achieve the purpose.
  • Document URL aliastoken
    tokenIt is not necessary, the current document will be retrieved by default. If you need to specify a document, you can set the id or token to achieve the purpose.
  • 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.

Document details page, you can also use it directly{{archive.文档字段}}To call the document field content.

If you are currently under the combined document URL, the URL form:"/{module}/{id}/c-{combine}.html"For example: "/tour/1/c-2.html", it supports multiple document combination comparison, and supports up to 5. If there are multiple, use隔开,like:"/cpu/11/c-12-13-14.html", then you can usecombineIdsorcombineArchivesTo render and compare data.

The fields available for the name parameter are:

  • Document IDId
  • Document titleTitle
  • Document SEO titleSeoTitle
  • Document linkLink
  • Document keywordsKeywords
  • Document descriptionDescription
  • Document contentContentSupport lazy image loading required tagslazy="data-src"
  • Title of document contentContentTitlesReturns an array
  • Document model IDModuleId
  • Document model IDParentId
  • Document Classification IDCategoryId
  • Document specification linkCanonicalUrl
  • Document user IDUserId
  • pricePrice
  • in stockStock
  • Document reading levelReadLevel
  • Original link to the documentOriginUrl
  • Document view countViews
  • Flag properties of a documentFlag
  • Document cover pictureImages
  • First image of the document coverLogo
  • Document cover thumbnailThumb
  • Number of document commentsCommentCount
  • Document classificationCategory
  • 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

Document IDId

Tag usage:{% archiveDetail with name="Id" %}

{# 默认用法,自动获取当前页面文档 #}
<div>分类标题:{% archiveDetail with name="Id" %}</div>
{# 获取指定文档id的文档字段 #}
<div>分类标题:{% archiveDetail with name="Id" id="1" %}</div>
{# 自定义字段名称 #}
<div>分类标题:{% archiveDetail archiveId with name="Id" %}{{archiveId}}</div>
<div>分类标题:{% archiveDetail archiveId with name="Id" id="1" %}{{archiveId}}</div>

Document titleTitle

Tag usage:{% archiveDetail with name="Title" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档标题:{% archiveDetail with name="Title" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档标题:{% archiveDetail with name="Title" id="1" %}</div>
{# 自定义字段名称 #}
<div>文档标题:{% archiveDetail archiveTitle with name="Title" %}{{archiveTitle}}</div>
<div>文档标题:{% archiveDetail archiveTitle with name="Title" id="1" %}{{archiveTitle}}</div>

Document linkLink

Tag usage:{% archiveDetail with name="Link" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档链接:{% archiveDetail with name="Link" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档链接:{% archiveDetail with name="Link" id="1" %}</div>
{# 自定义字段名称 #}
<div>文档链接:{% archiveDetail archiveLink with name="Link" %}{{archiveLink}}</div>
<div>文档链接:{% archiveDetail archiveLink with name="Link" id="1" %}{{archiveLink}}</div>

Document descriptionDescription

Tag usage:{% archiveDetail with name="Description" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档描述:{% archiveDetail with name="Description" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档描述:{% archiveDetail with name="Description" id="1" %}</div>
{# 自定义字段名称 #}
<div>文档描述:{% archiveDetail archiveDescription with name="Description" %}{{archiveDescription}}</div>
<div>文档描述:{% archiveDetail archiveDescription with name="Description" id="1" %}{{archiveDescription}}</div>

Document contentContent

Tag usage:{% archiveDetail with name="Content" %}
The Content field supports lazyload usage of images. Need to uselazy="{定义的src名}"To handle it, for example, the lazyload plugin you use needs to<img src="" />Change to<img data-src="" />, then call it like thislazy="data-src"

After the Content field is enabled, the content will automatically convert the content to html. After closing the Markdown editor, the Content content will not automatically convert the content to html. But you can manually specify whether to convert, you need to addrenderparameter. acceptfalse|trueTwo values.render=falseNo Markdown to html operation is performed.render=trueMake a conversion.

{# 默认用法,自动获取当前页面文档 #}
<div>文档内容:{% archiveDetail with name="Content" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档内容:{% archiveDetail with name="Content" id="1" %}</div>
{# 自定义字段名称 #}
<div>文档内容:{% archiveDetail archiveContent with name="Content" %}{{archiveContent|safe}}</div>
<div>文档内容:{% archiveDetail archiveContent with name="Content" id="1" %}{{archiveContent|safe}}</div>
{# lazyload 替换 #}
<div>文档内容:{% archiveDetail archiveContent with name="Content" lazy="data-src" %}{{archiveContent|safe}}</div>
{# markdown 转 html #}
<div>文档内容:{% archiveDetail archiveContent with name="Content" render=true %}{{archiveContent|safe}}</div>
{# 不进行markdown转换 #}
<div>文档内容:{% archiveDetail archiveContent with name="Content" render=false %}{{archiveContent|safe}}</div>

Title of document contentContentTitles

Tag usage:{% archiveDetail contentTitles with name="ContentTitles" %}

The returned is an array with the objects contained in it:
{Title: "标题", Tag: "标签", Level: 层级, Prefix: "前缀"}

You need to use a loop to call:

{% archiveDetail contentTitles with name="ContentTitles" %}
<div>
{% for item in contentTitles %}
    <div class="{{item.Tag}}" level="{{item.Level}}">{{item.Prefix}} {{item.Title}}</div>
{% endfor %}
</div>


Document Classification IDCategoryId

Tag usage:{% archiveDetail with name="CategoryId" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档分类ID:{% archiveDetail with name="CategoryId" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档分类ID:{% archiveDetail with name="CategoryId" id="1" %}</div>
{# 自定义字段名称 #}
<div>文档分类ID:{% archiveDetail archiveCategoryId with name="CategoryId" %}{{archiveCategoryId}}</div>
<div>文档分类ID:{% archiveDetail archiveCategoryId with name="CategoryId" id="1" %}{{archiveCategoryId}}</div>

Document view countViews

Tag usage:{% archiveDetail with name="Views" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档浏览量:{% archiveDetail with name="Views" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档浏览量:{% archiveDetail with name="Views" id="1" %}</div>
{# 自定义字段名称 #}
<div>文档浏览量:{% archiveDetail archiveViews with name="Views" %}{{archiveViews}}</div>
<div>文档浏览量:{% archiveDetail archiveViews with name="Views" id="1" %}{{archiveViews}}</div>

First image of the document coverLogo

Tag usage:{% archiveDetail with name="Logo" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档封面首图:<img src="{% archiveDetail with name="Logo" %}" alt=""/></div>
{# 获取指定文档id的文档字段 #}
<div>文档封面首图:<img src="{% archiveDetail with name="Logo" id="1" %}" alt=""/></div>
{# 自定义字段名称 #}
<div>文档封面首图:<img src="{% archiveDetail archiveLogo with name="Logo" %}{{archiveLogo}}" alt=""/></div>
<div>文档封面首图:<img src="{% archiveDetail archiveLogo with name="Logo" id="1" %}{{archiveLogo}}" alt=""/></div>

Document cover thumbnailThumb

Tag usage:{% archiveDetail with name="Thumb" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档封面缩略图:<img src="{% archiveDetail with name="Thumb" %}" alt=""/></div>
{# 获取指定文档id的文档字段 #}
<div>文档封面缩略图:<img src="{% archiveDetail with name="Thumb" id="1" %}" alt=""/></div>
{# 自定义字段名称 #}
<div>文档封面缩略图:<img src="{% archiveDetail archiveThumb with name="Thumb" %}{{archiveThumb}}" alt=""/></div>
<div>文档封面缩略图:<img src="{% archiveDetail archiveThumb with name="Thumb" id="1" %}{{archiveThumb}}" alt=""/></div>

Document cover pictureImages

Images is a set of images, so you need to use a custom way to get and loop the output.

Tag usage:{% archiveDetail archiveImages with name="Images" %}

{# 自定义字段名称 #}
<div>文档封面图片:
    {% archiveDetail archiveImages with name="Images" %}
    {% for item in archiveImages %}
        <img src="{{item}}" alt=""/>
    {% endfor %}
</div>
<div>文档封面图片:
    {% archiveDetail archiveImages with name="Images" id="1" %}
    {% for item in archiveImages %}
        <img src="{{item}}" alt=""/>
    {% endfor %}
</div>

Document addition timeCreatedTime

CreatedTime supports preformatted times. use2006-01-02Indicates year-month-day,15:04::05Indicates time, minute and second. If the display format is June 30, 2021, you can write it asformat="2006年01月02日", if the display format is 2021/06/30 12:30, you can write it asformat="2006/01/02 15:04". If format is not set, it will be automatically formatted as2006-01-02.

Tag usage:{% archiveDetail with name="CreatedTime" format="2006-01-02 15:04" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档添加时间:{% archiveDetail with name="CreatedTime" %}</div>
<div>文档添加时间:{% archiveDetail with name="CreatedTime" format="2006-01-02 15:04" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档添加时间:{% archiveDetail with name="CreatedTime" id="1" %}</div>
<div>文档添加时间:{% archiveDetail with name="CreatedTime" id="1" format="2006-01-02 15:04" %}</div>
{# 自定义字段名称 #}
<div>文档添加时间:{% archiveDetail archiveCreatedTime with name="CreatedTime" %}{{archiveCreatedTime}}</div>
<div>文档添加时间:{% archiveDetail archiveCreatedTime with name="CreatedTime" id="1" %}{{archiveCreatedTime}}</div>
<div>文档添加时间:{% archiveDetail archiveCreatedTime with name="CreatedTime" format="2006-01-02" %}{{archiveCreatedTime}}</div>
<div>文档添加时间:{% archiveDetail archiveCreatedTime with name="CreatedTime" id="1" format="2006-01-02 15:04" %}{{archiveCreatedTime}}</div>

Document update timeUpdatedTime

UpdatedTime supports preformatted times. use2006-01-02Indicates year-month-day,15:04::05Indicates time, minute and second. If the display format is June 30, 2021, you can write it asformat="2006年01月02日", if the display format is 2021/06/30 12:30, you can write it asformat="2006/01/02 15:04". If format is not set, it will be automatically formatted as2006-01-02.

Tag usage:{% archiveDetail with name="UpdatedTime" format="2006-01-02 15:04" %}

{# 默认用法,自动获取当前页面文档 #}
<div>文档更新时间:{% archiveDetail with name="UpdatedTime" %}</div>
<div>文档更新时间:{% archiveDetail with name="UpdatedTime" format="2006-01-02 15:04" %}</div>
{# 获取指定文档id的文档字段 #}
<div>文档更新时间:{% archiveDetail with name="UpdatedTime" id="1" %}</div>
<div>文档更新时间:{% archiveDetail with name="UpdatedTime" id="1" format="2006-01-02 15:04" %}</div>
{# 自定义字段名称 #}
<div>文档更新时间:{% archiveDetail archiveUpdatedTime with name="UpdatedTime" %}{{archiveUpdatedTime}}</div>
<div>文档更新时间:{% archiveDetail archiveUpdatedTime with name="UpdatedTime" id="1" %}{{archiveUpdatedTime}}</div>
<div>文档更新时间:{% archiveDetail archiveUpdatedTime with name="UpdatedTime" format="2006-01-02" %}{{archiveUpdatedTime}}</div>
<div>文档更新时间:{% archiveDetail archiveUpdatedTime with name="UpdatedTime" id="1" format="2006-01-02 15:04" %}{{archiveUpdatedTime}}</div>

Document classificationCategory

{% archiveDetail archiveCategory with name="Category" %}
<a href="{{ archiveCategory.Link }}">
    <span>分类ID:{{archiveCategory.Id}}</span>
    <span>分类名称:{{archiveCategory.Title}}</span>
    <span>分类链接:{{archiveCategory.Link}}</span>
    <span>分类描述:{{archiveCategory.Description}}</span>
    <span>上级分类ID:{{archiveCategory.ParentId}}</span>
</a>
<div>缩略图大图:<img src="{{archiveCategory.Logo}}" alt="{{archiveCategory.Title}}" /></div>
<div>缩略图:<img src="{{archiveCategory.Thumb}}" alt="{{archiveCategory.Title}}" /></div>

{# 或者使用categoryDetail方式调用 #}
<span>分类ID:{% categoryDetail with name="Id" id=archive.Id %}</span>
<span>分类名称:{% categoryDetail with name="Title" id=archive.Id %}</span>
<span>分类链接:{% categoryDetail with name="Link" id=archive.Id %}</span>
<span>分类描述:{% categoryDetail with name="Description" id=archive.Id %}</span>
<span>上级分类ID:{% categoryDetail with name="ParentId" id=archive.Id %}</span>
<div>缩略图大图:<img src="{% categoryDetail with name="Logo" id=archive.Id %}" /></div>
<div>缩略图:<img src="{% categoryDetail with name="Thumb" id=archive.Id %}" /></div>

Document tags

{% tagList tags with limit="10" %}
{% for item in tags %}
<a href="{{item.Link}}">{{item.Title}}</a>
{% endfor %}
{% endtagList %}

Other field parameters for document model settings

Loop all fields

{% archiveParams params %}
<div>
    {% for item in params %}
    <div>
        <span>{{item.Name}}:</span>
        <span>{{item.Value}}</span>
    </div>
    {% endfor %}
</div>
{% endarchiveParams %}

If you want to display only the content of a custom field, if your custom field isauthor, then you can call it like this in the template:

{% archiveDetail with name="author" %}

Common usage examples

  1. For common article details, display document title, document classification, document release time, document label, document view count, document details on the document details page. As shown in the picture:

Call code example (the code does not contain css style control)

<article>
    <h1>{% archiveDetail with name="Title" %}</h1>
    <div>
        <a href="{% categoryDetail with name='Link' %}">{% categoryDetail with name='Title' %}</a>
        <span>{% archiveDetail with name="CreatedTime" format="2006-01-02" %}</span>
        {% tagList tags with limit="10" %}
        {% for item in tags %}
        <a href="{{item.Link}}">{{item.Title}}</a>
        {% endfor %}
        {% endtagList %}
        <span>{% archiveDetail with name="Views" %}°</span>
    </div>
    <div>
        {%- archiveDetail articleContent with name="Content" %}
        {{articleContent|safe}}
    </div>
</article>
  1. Common product details, display product pictures, product names, product parameters, product introduction, and product details on the document details page. As shown in the picture:

Call code example (the code does not contain css style control)

<article>
    <div>
        <div>
            <img src="{% archiveDetail with name='Logo' %}" alt="{% archiveDetail with name='Title' %}" />
        </div>
        <div>
            <h1>{% archiveDetail with name="Title" %}</h1>
            {% archiveParams params %}
            {% for item in params %}
            <div>
                <span>{{item.Name}}:</span>
                <span>{{item.Value}}</span>
            </div>
            {% endfor %}
            {% endarchiveParams %}
            <div>{% archiveDetail with name="Description" %}</div>
            <div>
                <a href="tel:{% contact with name='Cellphone' %}" rel="nofollow">电话联系:{% contact with name="Cellphone" %}</a>
            </div>
        </div>
    </div>
    <div>
        <div>产品详情</div>
        <div>
            {%- archiveDetail articleContent with name="Content" %}
            {{articleContent|safe}}
        </div>
    </div>
</article>