Description: Used to obtain system configuration information
How to use:{% system 变量名称 with name="字段名称" %}
, 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 parameters supported by the system are
- 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 field names available for the name parameter are:
- Website name
SiteName
- Website Logo
SiteLogo
- Website registration number
SiteIcp
- Copyright content
SiteCopyright
- Home page address
BaseUrl
- Website mobile address
MobileUrl
- Template static file address
TemplateUrl
- Template directory name
TemplateName
- Closed site prompt content
SiteCloseTips
- Site Language
Language
- Custom parameters
后台自定义设置的参数名
Website nameSiteName
Tag usage:{% system with name="SiteName" %}
{# 默认用法 #}
<div>网站名称:{% system with name="SiteName" %}</div>
{# 自定义名称调用 #}
<div>网站名称:{% system siteName with name="SiteName" %}{{siteName}}</div>
Website LogoSiteLogo
Tag usage:{% system with name="SiteLogo" %}
{# 默认用法 #}
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
{# 自定义名称调用 #}
<img src="{% system siteLogo with name="SiteLogo" %}{{siteLogo}}" alt="{% system siteName with name="SiteName" %}{{siteName}}" />
Website registration numberSiteIcp
Tag usage:{% system with name="SiteIcp" %}
{# 默认用法 #}
<p><a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a> ©2021 kandaoni.com. All Rights Reserved</p>
{# 自定义名称调用 #}
<p><a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system siteIcp with name="SiteIcp" %}{{siteIcp}}</a> ©2021 kandaoni.com. All Rights Reserved</p>
Copyright contentSiteCopyright
Tag usage:{% system with name="SiteCopyright" %}
{# 默认用法 #}
<div>{% system with name="SiteCopyright" %}</div>
{# 自定义名称调用 #}
<div>{% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}</div>
Home page addressBaseUrl
Tag usage:{% system with name="BaseUrl" %}
{# 默认用法 #}
<div>首页地址:{% system with name="BaseUrl" %}</div>
{# 自定义名称调用 #}
<div>首页地址:{% system baseUrl with name="BaseUrl" %}{{baseUrl|safe}}</div>
Website mobile addressMobileUrl
Tag usage:{% system with name="MobileUrl" %}
{# 默认用法 #}
<div>移动端地址:{% system with name="MobileUrl" %}</div>
{# 自定义名称调用 #}
<div>移动端地址:{% system mobileUrl with name="MobileUrl" %}{{mobileUrl|safe}}</div>
Template static file addressTemplateUrl
Tag usage:{% system with name="TemplateUrl" %}
{# 默认用法 #}
<link href="{% system with name="TemplateUrl" %}/css/style.css" rel="stylesheet">
{# 自定义名称调用 #}
<div>静态文件地址:{% system templateUrl with name="TemplateUrl" %}{{templateUrl|safe}}</div>
Site LanguageLanguage
Tag usage:{% system with name="Language" %}
{# 默认用法 #}
<html lang="{% system with name='Language' %}">
Get the current year tag
Tag usage:{% now "2006" %}
The following 2006 is a time-formatted string, which is a format supported by Golang.
仅仅显示年:
{% now "2006" %}
显示年月日
{% now "2006-01-02" %}
显示年月日时分秒
{% now "2006-01-02 15:04:05" %}