Description: Used to obtain document model details data
How to use:{% moduleDetail 变量名称 with name="字段名称" id="1" %}
The variable name is not necessary. After setting the variable name, you can call it through the variable name in the future. Without setting the variable name, the result will be output directly.
The supported parameters of moduleDetail are:
- Model ID
id
.id
Not required, the current model will be retrieved by default. If you need to specify a model, you can achieve the purpose by setting the id or token. - Model URL alias
token
.token
Not required, the current model will be retrieved by default. If you need to specify a model, you can achieve the purpose by setting the id or token. - 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 fields available for the name parameter are:
- Model ID
Id
- Model Title
Title
- Model link
Link
- Model table name
TableName
Model IDId
Tag usage:{% moduleDetail with name="Id" %}
{# 默认用法,自动获取当前页面模型 #}
<div>模型ID:{% moduleDetail with name="Id" %}</div>
{# 获取指定模型id的模型字段 #}
<div>模型ID:{% moduleDetail with name="Id" id="1" %}</div>
{# 自定义字段名称 #}
<div>模型ID:{% moduleDetail pageId with name="Id" %}{{pageId}}</div>
<div>模型ID:{% moduleDetail pageId with name="Id" id="1" %}{{pageId}}</div>
Model TitleTitle
Tag usage:{% moduleDetail with name="Title" %}
{# 默认用法,自动获取当前页面模型 #}
<div>模型标题:{% moduleDetail with name="Title" %}</div>
{# 获取指定模型id的模型字段 #}
<div>模型标题:{% moduleDetail with name="Title" id="1" %}</div>
{# 自定义字段名称 #}
<div>模型标题:{% moduleDetail pageTitle with name="Title" %}{{pageTitle}}</div>
<div>模型标题:{% moduleDetail pageTitle with name="Title" id="1" %}{{pageTitle}}</div>
Model linkLink
Tag usage:{% moduleDetail with name="Link" %}
{# 默认用法,自动获取当前页面模型 #}
<div>模型链接:{% moduleDetail with name="Link" %}</div>
{# 获取指定模型id的模型字段 #}
<div>模型链接:{% moduleDetail with name="Link" id="1" %}</div>
{# 自定义字段名称 #}
<div>模型链接:{% moduleDetail pageLink with name="Link" %}{{pageLink}}</div>
<div>模型链接:{% moduleDetail pageLink with name="Link" id="1" %}{{pageLink}}</div>