Document parameter tags

Description: Parameters used to obtain background settings for a specified document

How to use:{% archiveParams 变量名称 with id="1" sorted=true %}If variable is defined as params{% archiveParams params with id="1" sorted=true %}...{% endarchiveParams %}

The supported parameters of archiveParams are:

  • Document IDid idThe parameter retrieves the specified document parameters according to the document id, or the document id of the current document page by default.
  • Whether to sortsortedSupported values ​​are:false|true,sorted=falseIt retrieves an unordered map object, and you need to use.Get data in the form ofsorted=trueWhen obtaining is a fixed sorted array object. The default istrueFixed sorted array objects, so you need to useforLoop to get and output.
  • 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.

The specific available fields are determined based on the document additional fields set in the background.

The structure within a single field is:

  • Field nameName
  • Field dataValue

Code Example

{# 固定排序的数组 #}
<div>
    {% archiveParams params %}
    {% for item in params %}
    <div>
        <span>{{item.Name}}:</span>
        <span>{{item.Value}}</span>
    </div>
    {% endfor %}
    {% endarchiveParams %}
</div>
指定文档ID
{# 固定排序的数组 #}
<div>
    {% archiveParams params with id="1" %}
    {% for item in params %}
    <div>
        <span>{{item.Name}}:</span>
        <span>{{item.Value}}</span>
    </div>
    {% endfor %}
    {% endarchiveParams %}
</div>
{# 无序的map对象 #}
<div>
    {% archiveParams params with sorted=false %}
        <div>{{params.yuedu.Name}}:{{params.yuedu.Value}}</div>
        <div>{{params.danxuan.Name}}:{{params.danxuan.Value}}</div>
        <div>{{params.duoxuan.Name}}:{{params.duoxuan.Value}}</div>
    {% endarchiveParams %}
</div>