Description: Used to obtain the backend settings parameters of a specified document
Usage:{% archiveParams 变量名称 with id="1" sorted=true %}If the variable is defined as params{% archiveParams params with id="1" sorted=true %}...{% endarchiveParams %}
archiveParams supports the following parameters:
- Document ID
ididParameters are obtained according to the document id to get the specified document parameters, by default getting the document id of the current document page. - Are you sorted
sortedThe supported values are:false|true,sorted=falseAt that time, you get an unordered map object, which needs to be used.in the form of getting data.sorted=truewhen retrieved, it is a fixed sorted array object. By default, it istruea fixed sorted array object, so it needs to usefora loop to retrieve and output. - Site ID
siteIdsiteIdGenerally, 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.
The available fields are determined by 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>