In AnQi CMS, the global settings and contact information of the website are the basic information that constitutes the important facade of the website.This information must be displayed accurately to visitors, and more importantly, it should be able to be updated and managed flexibly and conveniently without frequent modification of the template code.systemandcontactThese powerful tags enable website operators to easily implement dynamic acquisition and display of this information.
Flexible application of global website settings:systemTag
Website's global settings, such as website name, Logo, filing number, copyright information, basic URL, etc., are an important part of the brand image and operational standards of the website.This information can be centrally managed in the "Background Settings" -> "Global Settings" of the Anqi CMS backend.systemLabel, easily call these data in the template.
systemThe basic syntax of tags is:{% system 变量名称 with name="字段名称" %}. Among them,变量名称Optional, if set, you can store the value obtained into a variable for subsequent use; if not set, the tag will directly output the corresponding value. Moreover, if your anqi CMS is deployed in a multi-site environment, you can also throughsiteIdParameters are used to specify the global settings for calling a specific site.
Common global settings fields include:
- SiteName: Site name, usually used for
<title>tags or prominent positions on the page. - SiteLogo: Website Logo image address, convenient for use in the header or brand display area of the website.
- SiteIcp: Website registration number, often used in the footer and linked to the MIIT website.
- SiteCopyright: Copyright information, also commonly used in the footer.
- BaseUrlThe homepage address of the website, ensure the correctness of all internal links.
- TemplateUrlThe static file address of the template, used to load CSS, JS and other resources.
The strength of Anqi CMS also lies in its flexibility, if the built-in parameters do not meet your needs, you can add custom parameters at the bottom of the "Global Settings" page.For example, you can add a parameter named "HelpUrl" to store the link to the help center, or the "OnlineService" parameter to store the online customer service code.systemtags, setnameSet the attribute to call with your custom "parameter name".
Let's see an example of using it in a template.systemLabel example:
{# 页面头部调用网站名称和Logo #}
<header>
<a href="{% system with name="BaseUrl" %}">
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
</a>
<h1>{% system with name="SiteName" %}</h1>
</header>
{# 页面底部调用备案号和版权信息 #}
<footer>
<p>
<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a>
{% system siteCopyright with name="SiteCopyright" %}{{ siteCopyright|safe }}
</p>
{# 调用自定义参数,例如帮助页面的链接 #}
<p>如需帮助,请访问我们的 <a href="{% system with name="HelpUrl" %}">帮助中心</a>。</p>
</footer>
In this way, no matter how the website name, logo image, or help link changes, you do not need to modify the template file, just update the corresponding settings in the background, ensuring the convenience and consistency of website information updates.
Convenient display of website contact information:contactTag
Effective communication channels are the bridge between the website and the user, and are also the key to building trust.Whether it is a contact phone number, email address, company address, or WeChat, WhatsApp and other social media contact information, it needs to be displayed clearly and accurately.