How to use AnQiCMS template tags to get the system configuration information of the website (such as website name, Logo)?

Calendar 👁️ 55

As an experienced CMS website operation personnel of AnQi, I fully understand the importance of being able to flexibly call system configuration information when building and maintaining an efficient and beautiful website.This information, such as the website name, Logo, filing number, etc., is an indispensable part of the website brand identity and basic operation.Strong and intuitive template tags provided by Anq CMS, allowing you to easily obtain and display these system-level configuration information in website templates.

The core to obtain the website system configuration:systemTag

In the AnQiCMS template system,{% system %}The tag is a tool specifically used to obtain the system configuration information of a website.It allows you to call the background "Global Feature Settings" configured data by specifying parameter names.This includes not only the basic information of the website, but also the specific parameters you may customize.

UsesystemThe basic syntax of tags is:{% system 变量名称 with name="字段名称" %}Wherein, 'field name' is the English identifier for the specific configuration item. If you do not need to assign the obtained value to a variable, you can use it directly{% system with name="字段名称" %}Please output the result directly.

Display and acquisition of the website name.

The website name is the facade of the website. It usually appears in multiple places such as the webpage title, header, footer, etc. ThroughsystemLabel, you can easily insert it dynamically into any position in the template. The 'Website Name' configured in the background 'Global Function Settings' corresponds toSiteNamefield.

For example, to display the website name in your template, you can use it like thissystemTags:

{# 直接输出网站名称 #}
<div>网站名称:{% system with name="SiteName" %}</div>

{# 将网站名称赋值给一个变量后输出 #}
{% system siteNameVariable with name="SiteName" %}
<div>网站名称(通过变量获取):{{ siteNameVariable }}</div>

This way, no matter how you modify the website name in the background, the front-end page will automatically synchronize the update without modifying the template file, greatly improving maintenance efficiency.

The acquisition and application of the website logo

The website logo is also a core element of brand recognition. In AnQiCMS, you can upload the website logo on the backend and use it tosystemThe tag retrieves its URL address in the template and applies it to<img>the tag. The "website logo" configured in the background corresponds toSiteLogofield.

Here is an example of how to retrieve and display the website logo in a template:

{# 直接输出Logo图片 #}
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />

{# 将Logo的URL赋值给变量后输出 #}
{% system siteLogoUrl with name="SiteLogo" %}
<img src="{{ siteLogoUrl }}" alt="网站Logo" />

It is worth noting that we usually use both at the same time:SiteNameasaltThe value of the attribute, which not only helps SEO, but also improves the accessibility of the website.

Other common system configuration information

In addition to the website name and Logo, AnQiCMS'ssystemThe tag provides various practical configuration information for you to call:

  • Website filing number (SiteIcp): Often used in the footer, linking to the filing query website.
    
    <p><a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a></p>
    
  • Copyright content (SiteCopyright)Footers are usually used to display copyright statements for the website.
    
    <div>{% system with name="SiteCopyright" %}</div>
    
  • The home page address (BaseUrl)It retrieves the root URL of the website, which is convenient for building absolute links.
    
    <a href="{% system with name="BaseUrl" %}">返回首页</a>
    
  • Static file address of the template (TemplateUrl)Used to refer to CSS, JavaScript, and other static resources, make sure the path is correct.
    
    <link href="{% system with name="TemplateUrl" %}/css/style.css" rel="stylesheet">
    
  • Site language (Language)For examplezh-CNoren-US, can be used to set<html>label'slangThe attribute helps browsers and search engines understand the language of the page content.
    
    <html lang="{% system with name='Language' %}">
    
  • Custom parameterIn the background "Global Feature Settings", you can add custom parameter names and values. For example, you added a parameter namedHelpUrlwith the value of"https://www.example.com/help
    
    <div>帮助页面链接:{% system with name="HelpUrl" %}</div>
    

Under a multi-site environmentsiteIdParameter

For AnQiCMS users managing multiple sites,systemthe tag also provides asiteIdThe parameter is usually not required to be filled in manually, as it defaults to automatically obtaining the configuration information of the current site. However, if you need to call it in a template of a specific site,other sitessystem configuration information (for example, displaying a child site's Logo on a main station page), then you can specifysiteIdto achieve.

for example, get the ID of2site's website name:

{% system otherSiteName with name="SiteName" siteId="2" %}
<div>其他站点的名称:{{ otherSiteName }}</div>

Summary

Of Security CMS{% system %}The template tag is the core tool for obtaining global configuration information in website front-end development.It enables dynamic display of various system-level configurations such as website name, Logo, filing number, copyright information, and supports custom parameters and multi-site calls, greatly enhancing the flexibility and maintainability of the template.Familiarize yourself with these tags, which will help you build and manage your AnQiCMS website more efficiently.


Frequently Asked Questions (FAQ)

1. Why do I use{% system with name="SiteLogo" %}After the tag, the front-end does not display the Logo image?

First, make sure you have uploaded and saved the website logo in the "Global Function Settings" of the AnQiCMS background. Secondly, check your template code to ensure<img>label'ssrcThe attribute has correctly used this tag and<img>The tag itself is not hidden by CSS or the path is overwritten by other errors. If you are using a multi-site mode and calling the Logo of another site, please confirm that it is used correctlysiteIdParameters. Finally, clear the browser cache and AnQiCMS system cache and try again.

2. I added a custom parameter in the background "Global Function Settings", for exampleContactEmailbut it was called in the template{% system with name="ContactEmail" %}but no content was displayed, what went wrong?

Please check the custom parameters you set in the background参数名field is consistent with the templatenameThe value matches completely. AnQiCMS template tags are case-sensitive, soContactEmailandcontactEmailthey will be considered as different fields. Additionally, make sure the custom parameters'参数值Not empty and saved. Similarly, try to clear the AnQiCMS system cache and browser cache.

3.{% system %}in the labelSiteIcpandSiteCopyrightWhere is the field usually used on the website?

SiteIcp(Website filing number) andSiteCopyrightCopyright content is usually used in the footer area of the website.The record number usually includes a link to the MIIT record query website to meet legal requirements; copyright information is used to declare the copyright of the website content.This helps enhance the professionalism and compliance of the website.

Related articles

How to troubleshoot and resolve issues when installing AnQiCMS, such as ports being occupied or insufficient database permissions?

As an experienced AnQiCMS (AnQiCMS) website operator, I know that a smooth system is the foundation for content creation and publication.AnQiCMS with its high efficiency and easy extensibility, brings great convenience to our content operation work.However, during the system deployment process, occasional setbacks may occur, the most common and annoying of which are the problems of 'port already in use' and 'insufficient database permissions'.Learn how to quickly identify and resolve them, it will ensure your AnQiCMS journey goes smoothly.###

2025-11-06

How to implement data isolation between different sites in AnQiCMS multi-site management function?

As an experienced veteran in the operation of AnQiCMS for many years, I know that data isolation is a core issue that users are extremely concerned about when managing multiple websites.AnQiCMS was designed with the complexity of multi-site operations in mind and has achieved efficient data isolation between different sites through exquisite architecture, ensuring the independence and security of each site's content.The multi-site management feature of AnQiCMS allows users to easily create and operate multiple independent websites under a single system deployment.

2025-11-06

How to quickly install and deploy AnQiCMS in Baota Panel or 1Panel and other environments?

As a senior website operations manager, I am well aware of the importance of an efficient and stable content management system for enterprises and self-media.AnQiCMS with its high-performance, modular design based on the Go language and rich SEO features has become my first choice.It is not only easy to deploy, runs safely and has an elegant interface, but also provides excellent performance in high-concurrency environments, effectively helping small and medium-sized enterprises to carry out content marketing, SEO optimization, and even multilingual promotion.Today, I will guide everyone step by step on how to use the commonly used Baota panel or 1Panel environment

2025-11-06

What are the advantages and conveniences of installing AnQiCMS with Docker compared to traditional methods?

As an experienced CMS website operation personnel, I fully understand the importance of the stability and convenience of content management system deployment for daily operation.When choosing the installation method of AnQiCMS, both traditional methods and Docker container deployment have their own characteristics. However, from the perspective of operational efficiency and system reliability, Docker undoubtedly shows more significant advantages and convenience.### Considerations and Challenges of Traditional Installation Reviewing the traditional installation method of AnQiCMS, whether it is for Linux servers, Windows, or macOS environments

2025-11-06

How to implement flexible calls for document lists, category lists, and single page details with AnQiCMS template tags?

As a website operator who is deeply familiar with the operation of AnQiCMS, I know that content is the cornerstone of the website, and flexible and efficient content calls are the key to improving user experience and optimizing operational efficiency.AnQiCMS's powerful template tag system is the core tool we use to achieve this goal.It allows us to precisely control the display of document lists, category lists, and single-page details, thereby building website pages that are both beautiful and functional.

2025-11-06

How to obtain the current page's TDK information in AnQiCMS template and perform SEO optimization?

As an experienced website operator who deeply understands the operation of AnQiCMS, I have a very good understanding of the core value of TDK (Title, Description, Keywords) information for website search engine optimization (SEO).High-quality TDK is not only the key for search engines to understand the content of the page, but also the foundation for attracting users to click, improving website traffic and conversion rates.AnQiCMS as an enterprise-level content management system took full consideration of SEO requirements from the very beginning, providing a powerful and flexible TDK management and template calling mechanism.###

2025-11-06

How to get the previous, next article and related documents with AnQiCMS template tags?

As a senior CMS website operation personnel in the security industry, I fully understand the importance of content in attracting and retaining users.Efficient content management and elegant user experience are the foundation of a successful website.In AnQiCMS, the flexible template tag system is the key to achieving this goal.Today, I will give you a detailed introduction on how to use AnQiCMS template tags to cleverly obtain the previous and next articles and related documents, thus optimizing your content layout, improving user experience and the website's SEO performance.### Optimize User Navigation: Get Previous Document On Article Detail Page

2025-11-06

How to use conditional judgment (if) and loop traversal (for) tags for data rendering in AnQiCMS templates?

As an experienced Anqi CMS website operations personnel, I know that flexible content presentation is crucial for attracting and retaining users.AnQiCMS is a powerful template engine, especially its conditional judgment (`if`) and loop traversal (`for`) tags, which are the core tools for realizing dynamic content rendering.They allow websites to display information flexibly according to data status and business logic while maintaining consistency in content structure.

2025-11-06