Document parameter tags

Description: Used to get the parameters of the specified document's backend settings

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

archiveParams supported parameters are:)

  • Document IDid idParameters are obtained according to the document id, with the default being the document id of the current document page.
  • Does sorting happen?sortedThe supported values are:false|true,sorted=falseIn this case, the data obtained is an unordered map object, you need to use.to obtain the data.sorted=trueWhen, getting is a fixed sorted array object. The default istruea fixed sorted array object, so you need to usefora loop to get and output.
  • Site IDsiteId siteIdGenerally, it is not necessary to fill in. If you have created multiple sites using the multi-site management on the backend and want to call data from other sites, you can do so by specifyingsiteIdTo implement the call to data from a specified site.

The specific fields available are determined by the document attached fields set in the backend.

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>