Document/Product Details Tag

Description: Used to get document details data

Usage:{% archiveDetail 变量名称 with name="字段名称" id="1" %}The variable name is not required. After setting the variable name, it can be called later by the variable name, and if the variable name is not set, it is output directly.

The parameters supported by archiveDetail are:

  • Document IDid
    idIt is not necessary. It will default to the current document. If you need to specify a document, you can do so by setting the id.
  • Document URL Aliastoken
    tokenIt is not necessary. It will default to retrieving the current document. If you need to specify a document, you can do so by setting an id or token.
  • 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.

Document detail page, can also be used directly{{archive.文档字段}}To call the document field content.

If currently under the combined document URL, URL format:"/{module}/{id}/c-{combine}.html"As for 隔开, as for:"/cpu/11/c-12-13-14.html", then you can use:combineIdsorcombineArchivesRender data comparison.

The fields available for the name parameter are:

  • Document IDId
  • Document titleTitle
  • Document SEO TitleSeoTitle
  • Document linkLink
  • Document keywordKeywords
  • Document descriptionDescription
  • Document contentContentSupports lazy loading of images, requires tags.lazy="data-src"
  • Title of document content.ContentTitlesReturns an array.
  • Document Model IDModuleId
  • Document Model IDParentId
  • Document Category IDCategoryId
  • Documentation specification linkCanonicalUrl
  • Documentation user IDUserId
  • PricePrice
  • InventoryStock
  • Strikethrough price.OriginPrice
  • Cost priceCostPrice
  • Document Reading LevelReadLevel
  • Original Document LinkOriginUrl
  • Document ViewsViews
  • Document's Flag attributeFlag
  • Document cover imageImages
  • Document cover first imageLogo
  • Document cover thumbnailThumb
  • Document comment countCommentCount
  • Document CategoryCategory
  • 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
  • Other field parameters set for document model
  • 产品Video addressVideoUrl
  • 产品Number of favoritesFavoriteCount
  • 产品Number of reviewsReviewCount
  • 产品Whether favoritedIsFavorite
  • 产品Whether need logisticsNeedLogistics
  • 产品Whether free shippingIsFreeShipping
  • 产品SalesSoldCount
  • 产品SKU modeOptionType
  • 产品weightWeight
  • 产品Weight unitWeightUnit
  • 产品Whether support wholesaleIsWholesale
  • 产品Are there overselling allowedAllowOversold
  • 产品Does it have order extension fieldsHasOrderFields
  • 产品Order extension fieldsOrderFields
  • 产品Specification propertiesOptions
  • 产品Spec ListSkus
  • 产品Currently selected SKUSku
  • 产品Wholesale ConfigurationWholesaleRules

Document IDId

Label 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

Label 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

Label 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

Label 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

Label usage:{% archiveDetail with name="Content" %}The Content field supports lazyload for images. It needs to be usedlazy="{定义的src名}"To handle, for example, if you use a lazyload plugin you need to<img src="" />to<img data-src="" />call it like thislazy="data-src"

Content field will automatically convert Markdown to html when the Markdown editor is enabled. After the Markdown editor is disabled, the Content content will not automatically convert to html. However, you can manually specify whether to convert, and it needs to be addedrenderParameters. Acceptfalse|trueTwo values.render=falseDo not perform Markdown to html conversion,render=truePerform 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 content.ContentTitles

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

The return is an array, containing objects such as:{Title: "标题", Tag: "标签", Level: 层级, Prefix: "前缀"}

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 Category IDCategoryId

Label 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 ViewsViews

Label 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>

Document cover first imageLogo

Label 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

Label 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 imageImages

Images is an array of images, so it needs to be accessed and cycled using a custom method.

Label 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 add timeCreatedTime

CreatedTime supports time formatting. It uses2006-01-02to represent year-month-day, it uses15:04::05Represents hours, minutes, and seconds. To display the format as June 30, 2021, you can write it asformat="2006年01月02日"As needed, the format 2021/06/30 12:30 can be written asformat="2006/01/02 15:04"If not set format, it will be automatically formatted in the default usage2006-01-02.

Label 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 time preview formatting. Use2006-01-02to represent year-month-day, it uses15:04::05Represents hours, minutes, and seconds. To display the format as June 30, 2021, you can write it asformat="2006年01月02日"As needed, the format 2021/06/30 12:30 can be written asformat="2006/01/02 15:04"If not set format, it will be automatically formatted in the default usage2006-01-02.

Label 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 CategoryCategory

{% 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 Tag

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

Other field parameters set for document model

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, such as your custom field beingauthorthen you can call it like this in the template:

{% archiveDetail with name="author" %}

The use of custom field parameters, for example, you have customized a field for a group chart, it is forarcimagesAnd if you want to display them on the front end, you can write it like this:

{% archiveDetail arcimages with name="arcimages" %}
<ul class="arc-images">
  {% for img in arcimages %}
  <li><img src="{{img}}" /></li>
  {% endfor %}
</ul>

Common usage examples

  1. Common article details, displayed on the document detail page, showing the document title, document category, document publication time, document tags, document views, and document details. As shown in the figure:detail-1

Call code example (code does not include 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, displayed on the document detail page with product images, product names, product parameters, product descriptions, and product details. As shown in the figure:detail-2

Call code example (code does not include 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>