Single page details tag

Description: Used to obtain single page details data

How to use:{% pageDetail 变量名称 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 pageDetail are:

  • Single page IDid.
    idIt is not necessary, the current single page will be retrieved by default. If you need to specify a single page, you can set the id to achieve the purpose.
  • Single page URL aliastoken
    tokenIt is not necessary, the current single page will be retrieved by default. If you need to specify a single page, you can set the id or token to achieve the purpose.
  • 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 fields available for the name parameter are:

  • Single page IDId
  • Single page titleTitle
  • Single page linkLink
  • Single page descriptionDescription
  • Single page contentContent
  • Single page thumbnail imageLogo
  • Single page thumbnailThumb
  • Single-page slideshowImages

Single page IDId

Tag usage:{% pageDetail with name="Id" %}

{# 默认用法,自动获取当前页面单页 #}
<div>单页ID:{% pageDetail with name="Id" %}</div>
{# 获取指定单页id的单页字段 #}
<div>单页ID:{% pageDetail with name="Id" id="1" %}</div>
{# 自定义字段名称 #}
<div>单页ID:{% pageDetail pageId with name="Id" %}{{pageId}}</div>
<div>单页ID:{% pageDetail pageId with name="Id" id="1" %}{{pageId}}</div>

Single page titleTitle

Tag usage:{% pageDetail with name="Title" %}

{# 默认用法,自动获取当前页面单页 #}
<div>单页标题:{% pageDetail with name="Title" %}</div>
{# 获取指定单页id的单页字段 #}
<div>单页标题:{% pageDetail with name="Title" id="1" %}</div>
{# 自定义字段名称 #}
<div>单页标题:{% pageDetail pageTitle with name="Title" %}{{pageTitle}}</div>
<div>单页标题:{% pageDetail pageTitle with name="Title" id="1" %}{{pageTitle}}</div>

Single page linkLink

Tag usage:{% pageDetail with name="Link" %}

{# 默认用法,自动获取当前页面单页 #}
<div>单页链接:{% pageDetail with name="Link" %}</div>
{# 获取指定单页id的单页字段 #}
<div>单页链接:{% pageDetail with name="Link" id="1" %}</div>
{# 自定义字段名称 #}
<div>单页链接:{% pageDetail pageLink with name="Link" %}{{pageLink}}</div>
<div>单页链接:{% pageDetail pageLink with name="Link" id="1" %}{{pageLink}}</div>

Single page descriptionDescription

Tag usage:{% pageDetail with name="Description" %}

{# 默认用法,自动获取当前页面单页 #}
<div>单页描述:{% pageDetail with name="Description" %}</div>
{# 获取指定单页id的单页字段 #}
<div>单页描述:{% pageDetail with name="Description" id="1" %}</div>
{# 自定义字段名称 #}
<div>单页描述:{% pageDetail pageDescription with name="Description" %}{{pageDescription}}</div>
<div>单页描述:{% pageDetail pageDescription with name="Description" id="1" %}{{pageDescription}}</div>

Single page contentContent

Tag usage:{% pageDetail with name="Content" %}

After the Content field is enabled, the content will automatically convert the content to html. After closing the Markdown editor, the Content content will not automatically convert the content to html. But you can manually specify whether to convert, you need to addrenderparameter. acceptfalse|trueTwo values.render=falseNo Markdown to html operation is performed.render=trueMake a conversion.

{# 默认用法,自动获取当前页面单页 #}
<div>单页内容:{% pageDetail with name="Content" %}</div>
{# 获取指定单页id的单页字段 #}
<div>单页内容:{% pageDetail with name="Content" id="1" %}</div>
{# 自定义字段名称 #}
<div>单页内容:{% pageDetail pageContent with name="Content" %}{{pageContent|safe}}</div>
<div>单页内容:{% pageDetail pageContent with name="Content" id="1" %}{{pageContent|safe}}</div>

Single page thumbnail imageLogo

Tag usage:{% pageDetail with name="Logo" %}

{# 默认用法,自动获取当前页面分类 #}
<div>缩略图大图:<img src="{% pageDetail with name="Logo" %}" alt="{% pageDetail with name="Title" %}" /></div>
{# 获取指定分类id的分类字段 #}
<div>缩略图大图:<img src="{% pageDetail with name="Logo" id="1" %}" alt="{% pageDetail with name="Title" id="1" %}" /></div>
{# 自定义字段名称 #}
<div>缩略图大图:{% pageDetail pageLogo with name="Logo" %}<img src="{{pageLogo}}" alt="{% pageDetail with name="Title" %}" /></div>
<div>缩略图大图:{% pageDetail pageLogo with name="Logo" id="1" %}<img src="{{pageLogo}}" alt="{% pageDetail with name="Title" %}" /></div>

Single page thumbnailThumb

Tag usage:{% pageDetail with name="Thumb" %}

{# 默认用法,自动获取当前页面分类 #}
<div>缩略图大图:<img src="{% pageDetail with name="Thumb" %}" alt="{% pageDetail with name="Title" %}" /></div>
{# 获取指定分类id的分类字段 #}
<div>缩略图大图:<img src="{% pageDetail with name="Thumb" id="1" %}" alt="{% pageDetail with name="Title" id="1" %}" /></div>
{# 自定义字段名称 #}
<div>缩略图大图:{% pageDetail pageThumb with name="Thumb" %}<img src="{{pageThumb}}" alt="{% pageDetail with name="Title" %}" /></div>
<div>缩略图大图:{% pageDetail pageThumb with name="Thumb" id="1" %}<img src="{{pageThumb}}" alt="{% pageDetail with name="Title" %}" /></div>

Single-page slideshowImages

Tag usage:{% pageDetail pageImages with name="Images" %}{% for item in pageImages %}<img src="{{item}}" alt="{% pageDetail with name="Title" %}" />{% endfor %}

{% pageDetail pageImages with name="Images" %}
<ul>
{% for item in pageImages %}
  <li>
    <img src="{{item}}" alt="{% pageDetail with name="Title" %}" />
  </li>
{% endfor %}
</ul>