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 ID
id
id
The parameter retrieves the specified document parameters according to the document id, or the document id of the current document page by default. - Whether to sort
sorted
Supported values are:false|true
,sorted=false
It retrieves an unordered map object, and you need to use.
Get data in the form ofsorted=true
When obtaining is a fixed sorted array object. The default istrue
Fixed sorted array objects, so you need to usefor
Loop to get and output. - Site ID
siteId
siteId
Generally, 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 itsiteId
To 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 name
Name
- Field data
Value
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>