Description: Used to obtain detailed city information
Usage:{% placeDetail 变量名称 with name="字段名称" id="1" %}The variable name is not required. After setting the variable name, it can be called later by the variable name, and if the variable name is not set, it is output directly.
Parameters supported by placeDetail:
- City Station ID
id
idIt is not necessary, the current station will be obtained by default. If you need to specify a station, you can achieve this by setting the id. - City station URL alias
token
tokenNot necessary, it will default to getting the current station. If you need to specify a station, you can do so by setting the id or token. - Site ID
siteId
siteIdGenerally, 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. - Content rendering
render
renderValid only for the Content field, acceptedfalse|trueTwo values.render=truePerform Markdown to HTML conversion, default is to automatically judge according to the editor settings
The fields available for the name parameter are:
- Station ID
Id - Station Title
Title - Station SEO Title
SeoTitle - Station Keywords
Keywords - Station Description
Description - Station Content
Content - Station Link
Link - Station Thumbnail Large
Logo - Station Thumbnail
Thumb - Station Banner Group
Images - Parent Station ID
ParentId - Top-level Branch ID
TopId - Creation time
CreatedTime - Update time
UpdatedTime - latitude
Latitude - longitude
Longitude - Time Zone
Timezone - Custom field
Extra
Station IDId
Label usage:{% placeDetail with name="Id" %}
{# 默认用法,自动获取当前页面分站 #}
<div>分站ID:{% placeDetail with name="Id" %}</div>
{# 获取指定分站id的分站字段 #}
<div>分站ID:{% placeDetail with name="Id" id="1" %}</div>
{# 自定义字段名称 #}
<div>分站ID:{% placeDetail placeId with name="Id" %}{{placeId}}</div>
<div>分站ID:{% placeDetail placeId with name="Id" id="1" %}{{placeId}}</div>
Station TitleTitle
Label usage:{% placeDetail with name="Title" %}
{# 默认用法,自动获取当前页面分站 #}
<div>分站标题:{% placeDetail with name="Title" %}</div>
{# 获取指定分站id的分站字段 #}
<div>分站标题:{% placeDetail with name="Title" id="1" %}</div>
{# 自定义字段名称 #}
<div>分站标题:{% placeDetail placeTitle with name="Title" %}{{placeTitle}}</div>
<div>分站标题:{% placeDetail placeTitle with name="Title" id="1" %}{{placeTitle}}</div>
Station LinkLink
Label usage:{% placeDetail with name="Link" %}
{# 默认用法,自动获取当前页面分站 #}
<div>分站链接:{% placeDetail with name="Link" %}</div>
{# 获取指定分站id的分站字段 #}
<div>分站链接:{% placeDetail with name="Link" id="1" %}</div>
{# 自定义字段名称 #}
<div>分站链接:{% placeDetail placeLink with name="Link" %}{{placeLink}}</div>
<div>分站链接:{% placeDetail placeLink with name="Link" id="1" %}{{placeLink}}</div>
Station DescriptionDescription
Label usage:{% placeDetail with name="Description" %}
{# 默认用法,自动获取当前页面分站 #}
<div>分站描述:{% placeDetail with name="Description" %}</div>
{# 获取指定分站id的分站字段 #}
<div>分站描述:{% placeDetail with name="Description" id="1" %}</div>
{# 自定义字段名称 #}
<div>分站描述:{% placeDetail placeDescription with name="Description" %}{{placeDescription}}</div>
<div>分站描述:{% placeDetail placeDescription with name="Description" id="1" %}{{placeDescription}}</div>
Station ContentContent
Label usage:{% placeDetail with name="Content" %}
The Content field will automatically convert Markdown to HTML when the Markdown editor is enabled.After closing the Markdown editor, the Content will not be automatically converted.But you can manually specify whether to convert, addrenderParameter.render=falseDo not convert Markdown to HTML,render=truePerform conversion.
{# 默认用法,自动获取当前页面分站 #}
<div>分站内容:{% placeDetail with name="Content" %}</div>
{# 获取指定分站id的分站字段,并强制渲染 #}
<div>分站内容:{% placeDetail with name="Content" id="1" render="true" %}</div>
{# 自定义字段名称 #}
<div>分站内容:{% placeDetail placeContent with name="Content" %}{{placeContent|safe}}</div>
<div>分站内容:{% placeDetail placeContent with name="Content" id="1" render="true" %}{{placeContent|safe}}</div>
Parent Station IDParentId
Label usage:{% placeDetail with name="ParentId" %}
{# 默认用法,自动获取当前页面分站 #}
<div>上级分站ID:{% placeDetail with name="ParentId" %}</div>
{# 获取指定分站id的分站字段 #}
<div>上级分站ID:{% placeDetail with name="ParentId" id="1" %}</div>
{# 自定义字段名称 #}
<div>上级分站ID:{% placeDetail placeParentId with name="ParentId" %}{{placeParentId}}</div>
<div>上级分站ID:{% placeDetail placeParentId with name="ParentId" id="1" %}{{placeParentId}}</div>
Top-level Branch IDTopId
Label usage:{% placeDetail with name="TopId" %}
TopId Used to get the top-level station ID of the current station, if the current station is already a top-level station, then return its own ID.
{# 默认用法,自动获取当前页面分站 #}
<div>顶级分站ID:{% placeDetail with name="TopId" %}</div>
{# 自定义字段名称 #}
<div>顶级分站ID:{% placeDetail placeTopId with name="TopId" %}{{placeTopId}}</div>
Station Thumbnail LargeLogo
Label usage:{% placeDetail with name="Logo" %}
{# 默认用法,自动获取当前页面分站 #}
<div>缩略图大图:<img style="width: 200px" src="{% placeDetail with name="Logo" %}" alt="{% placeDetail with name="Title" %}" /></div>
{# 获取指定分站id的分站字段 #}
<div>缩略图大图:<img style="width: 200px" src="{% placeDetail with name="Logo" id="1" %}" alt="{% placeDetail with name="Title" id="1" %}" /></div>
{# 自定义字段名称 #}
<div>缩略图大图:{% placeDetail placeLogo with name="Logo" %}<img style="width: 200px" src="{{placeLogo}}" alt="{% placeDetail with name="Title" %}" /></div>
Station ThumbnailThumb
Label usage:{% placeDetail with name="Thumb" %}
{# 默认用法,自动获取当前页面分站 #}
<div>缩略图:<img style="width: 200px" src="{% placeDetail with name="Thumb" %}" alt="{% placeDetail with name="Title" %}" /></div>
{# 获取指定分站id的分站字段 #}
<div>缩略图:<img style="width: 200px" src="{% placeDetail with name="Thumb" id="1" %}" alt="{% placeDetail with name="Title" id="1" %}" /></div>
{# 自定义字段名称 #}
<div>缩略图:{% placeDetail placeThumb with name="Thumb" %}<img style="width: 200px" src="{{placeThumb}}" alt="{% placeDetail with name="Title" %}" /></div>
Station Banner GroupImages
Label usage:{% placeDetail placeImages with name="Images" %}{% for item in placeImages %}<img src="{{item}}" alt="{% placeDetail with name="Title" %}" />{% endfor %}
{% placeDetail placeImages with name="Images" %}
<ul>
{% for item in placeImages %}
<li>
<img src="{{item}}" alt="{% placeDetail with name="Title" %}" />
</li>
{% endfor %}
</ul>
The code will display multiple slides. If you only need the first image and want to check if the image exists, you can use the following method:
{% placeDetail bannerImages with name="Images" %}
{% if bannerImages %}
{% set pageBanner = bannerImages[0] %}
{% endif %}
<img src="{{pageBanner}}" />
Station latitude and longitudeLatitude/Longitude
Label usage:{% placeDetail with name="Latitude" %}/{% placeDetail with name="Longitude" %}
{# 默认用法,自动获取当前页面分站的经纬度 #}
<div>纬度:{% placeDetail with name="Latitude" %},经度:{% placeDetail with name="Longitude" %}</div>
{# 自定义字段名称 #}
<div>纬度:{% placeDetail placeLat with name="Latitude" %}{{placeLat}}</div>
<div>经度:{% placeDetail placeLng with name="Longitude" %}{{placeLng}}</div>
Station time zoneTimezone
Label usage:{% placeDetail with name="Timezone" %}
{# 默认用法,自动获取当前页面分站 #}
<div>时区:{% placeDetail with name="Timezone" %}</div>
{# 自定义字段名称 #}
<div>时区:{% placeDetail placeTimezone with name="Timezone" %}{{placeTimezone}}</div>
Station Custom FieldExtra
If you want to loop through all the custom fields, you can use it like this:
{% placeDetail extras with name="Extra" %}
{% for field in extras %}
<div>{{field.Name}}:{{field.Value}}</div>
{% endfor %}
It will loop through all custom fields by default, if you don't want some custom field to appear, for example, you don't wantauthorto display the field on the page, you can use it like this:
{% placeDetail extras with name="Extra" %}
{% for field in extras %}
{% if field.Name != 'author' %}
<div>{{field.Name}}:{{field.Value}}</div>
{% endif %}
{% endfor %}
If you want to display the content of a custom field, such as a custom field isphoneYou can directly specify with name:
{% placeDetail with name="phone" %}