How to use the `system` tag to obtain website name, LOGO, filing number and other system information?

Calendar 👁️ 72

As an experienced Anqi CMS website operator, I am well aware of the importance of dynamically obtaining basic website information in daily template development and content presentation. In order to ensure the uniformity, maintainability, and efficient management of the website, Anqi CMS provides an extremely convenientsystemThe tag allows template developers to directly call various system-level data from the background global settings, thus avoiding the inconvenience of hard coding.

The website name, logo, filing number, and other information are key elements构成 brand image and legal compliance. ThroughsystemLabel, this information can be flexibly presented at various corners of the website, and synchronized in real time with the update of the background, greatly enhancing operational efficiency. Next, we will delve into how to make use ofsystemTags to retrieve and display this valuable system information.


UnderstandingsystemThe core function of the tag

systemThe tag is a powerful built-in tag in Anqi CMS template engine, which aims to help us dynamically obtain the global configuration information of the website.These configuration information is usually managed in the "Global Function Settings" of the Anqi CMS backend.systemWhen using the tag, we mainly go throughnameSpecify the specific information field required to obtain, such as the website name, logo address, etc. In addition, for the AnQi CMS running in a multi-site environment,systemTags also supportsiteIdParameters to accurately obtain system configuration from a specific site, which is particularly important when managing multiple sub-sites or independent brand sites, although it is usually not necessary to explicitly specify in most single-site applications.

Get the website name (SiteName)

The website name is the facade of the website, usually displayed in the browser title bar, website header, or footer. Bysystemtag to obtainSiteNameField, we can ensure that the names displayed throughout the website are always consistent with the backend settings.

For example, in the template, we can call the website name like this:

<div>网站名称:{% system with name="SiteName" %}</div>

Or, if you need to store the value you obtained in a variable for further operations:

<div>网站名称:{% system siteName with name="SiteName" %}{{siteName}}</div>

Display the website logo (SiteLogo)

The website logo is the core element of brand visual recognition. It is used tosystemtag to obtainSiteLogofield, which can dynamically load the website logo image URL and embed it into<img>In the label. This ensures that after the LOGO image is updated in the background, the front-end page does not need to modify the code and can automatically update.

Typical usage is shown as follows:

<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />

Here we not only obtain the LOGO address, but also recommend obtaining it simultaneouslySiteNameAs an imagealtAttribute values, which not only help with SEO optimization, but also improve the accessibility of the website.

Display the website filing number (SiteIcp)

For websites operating in mainland China, the filing number is a legally required necessary information. The AnQi CMS backend allows you to set the website filing number, and you can access it throughsystemTags are displayed in the footer of the website and other locations. Usually, the record number is linked to the Ministry of Industry and Information Technology's government service platform.

The following is an example of how to implement this function:

<p><a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a> &copy;2021 kandaoni.com. All Rights Reserved</p>

This code not only displays the filing number, but also automatically adds a link to the official filing inquiry website and setsrel="nofollow"andtarget="_blank"Properties, these are good SEO practices and considerations for user experience.

Display copyright information (SiteCopyright)

The website's copyright information is usually included in the footer area, used to declare the copyright of the website content.systemTags can easily retrieve the copyright content set in the background and display it in the template. If the copyright information contains HTML tags (such as&copy;symbols, links, etc.), it usually needs to be配合safeA filter to ensure that HTML content is rendered correctly rather than being escaped.

The following is an example of code to retrieve and display copyright information.

<div>{% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}</div>

By|safeFilter, we can ensure that the HTML format copyright statement input from the back-end is displayed as it is.

Get the website address (BaseUrl,MobileUrl)

BaseUrlThe field provides the root URL of the website, which is very useful for building internal links, redirects, or dynamically referencing resources in JavaScript.MobileUrlIt is specifically used to obtain the mobile end address of a website, which is particularly important when using the "computer + mobile independent site" mode.

For example, to obtain the home page address of a website:

<div>首页地址:{% system with name="BaseUrl" %}</div>

Get mobile end address:

<div>移动端地址:{% system mobileUrl with name="MobileUrl" %}{{mobileUrl|safe}}</div>

Use custom parameters (后台自定义设置的参数名)

Of Security CMSsystemLabels are not limited to built-in fields, they also support retrieving custom parameters set in the background "Global Function Settings". This means that you can add any additional website-level configuration items in the background according to your business needs, and throughsystemTags are called in the template, thus greatly enhancing the flexibility of the website.

Suppose you have customized a namedCustomerServiceHotlineThe parameter is used to store the customer service hotline, and you can call it like this in the template:

<div>客服热线:{% system with name="CustomerServiceHotline" %}</div>

Conclusion

systemThe tag is an indispensable tool for template development in AnQi CMS.It provides a concise, efficient, and easy-to-maintain way to dynamically manage and display the global system information of the website.By proficiently using these fields, website operators can easily achieve consistent updates of website information, enhance brand image, and ensure compliance and functionality. MastersystemThe use of tags will undoubtedly make your Aqin CMS website management work more convenient.


Frequently Asked Questions

1. If a certain system setting in the background is not filled in,systemWhat will the label output?

If a certain system setting in the background, such as the website filing number,SiteIcpThis field has not been filled in, then when you use it in the template{% system with name="SiteIcp" %}When labeling, it will not output anything, or output an empty string. To avoid blank spaces or unnecessary placeholders on the page, you can use conditional judgments in the template (such as{% if %}Label) to check if the obtained value is empty, and display it only if the value exists.

2. In multi-site mode,systemHow to differentiate the configuration of labels for different sites?

In Anqi CMS's multi-site management feature, each site has an independent global setting.systemLabels are optional.siteIdParameters to specify which site's system configuration to retrieve. If you do not specifysiteIdparameter,systemThe tag will default to retrieving the system configuration of the current visited site. For example,{% system siteName with name="SiteName" siteId="2" %}Will retrieve the website name of the site with ID 2. This is very useful for scenarios that require cross-site referencing of system information or developing universal templates.

3.systemCan the tag retrieve all system settings at once without specifying each onename?

systemThe design intention of the tag is to accurately obtain a single system configuration item to provide the greatest flexibility and the least performance overhead.Therefore, it does not support returning all system settings as an object at once.systemLabel to sequentially obtain the website name, LOGO, filing number, and other information. This design ensures that the template only loads and processes the required data, maintaining lightness and efficiency.

Related articles

How to get all Tag lists or Tags of a specified document in AnQiCMS template?

As an experienced CMS website operations personnel in the cybersecurity field, I deeply understand the importance of content tags (Tags) in website content organization, SEO optimization, and user experience.They can not only help readers quickly find the content they are interested in, but also enhance the internal links of the website and improve the efficiency of search engine crawling.In the Anqi CMS template system, the `tagList` tag is the core tool we use to achieve this goal.This article will discuss in detail how to flexibly use the `tagList` tag in Anqi CMS template to obtain all tags on the website

2025-11-06

How to implement document parameter filtering in AnQiCMS templates, for example, filtering by house type?

As an experienced CMS website operator for a security company, I know how important it is for users to efficiently find the content they need when visiting a website with a large amount of information.The content filtering function can not only greatly improve user experience, but also is a key factor in optimizing website structure and SEO performance.Today, I will elaborate on how to implement document parameter filtering in AnQiCMS templates, taking 'filtering by house type' as an example, to help your website better serve users.

2025-11-06

How to use the `archiveList` tag to call the document list with specified categories and recommended attributes?

AnQi CMS is an efficient enterprise-level content management system, whose powerful content tags are the core of dynamic and personalized content display.For website operators, mastering these tags, especially `archiveList`, can greatly enhance the flexibility and efficiency of content management.This article will elaborate on how to use the `archiveList` tag to accurately call the document list with specified categories and recommended attributes, helping you to better build website pages that meet user needs and optimize content display.###

2025-11-06

How to use the `archiveDetail` tag in AnQiCMS template to get document details and custom fields?

As an experienced CMS website operation personnel, I am well aware of the core position of content in website operations.We must not only create high-quality content, but also ensure that this content can be presented to users in a **way.In this, the flexible use of templates is crucial. Today, we will delve into a powerful and commonly used tag in AnQiCMS templates, `archiveDetail`, which helps us easily obtain detailed information about documents, including those carefully designed custom fields.###

2025-11-06

How to set the page title, keywords, description, and attach the website name using the `tdk` tag in AnQiCMS?

As a senior security CMS website operator, I am well aware of the core position of content in website construction and SEO optimization.TDK (Title, Description, Keywords) tags are an important basis for search engines to understand page content and judge the relevance of the page, as well as the information that users see first on the search results page.Efficiently setting and optimizing TDK is crucial for attracting target users and improving website rankings.Our Anqi CMS provides us with flexible and powerful TDK management functions, allowing us to finely control the metadata of each page

2025-11-06

How to use the `stampToDate` tag to format timestamps in AnQiCMS templates?

As an experienced website operator deeply familiar with Anqi CMS, I know the importance of content timeliness and presentation for user experience.In website content management, the timestamp (Timestamp) is a common way to record the time of content publication and update, but displaying the timestamp directly is not intuitive for users.Therefore, formatting timestamps into readable date and time formats is a key factor in enhancing the professionalism and user-friendliness of a website.AnQiCMS provides a very convenient template tag `stampToDate`, making this operation effortless

2025-11-06

How to get the contact information configured in the `contact` tag of AnQiCMS template?

As an experienced website operator for Anqi CMS, I am well aware of the core position of content in website construction and user interaction.Effectively and conveniently displaying contact information is an indispensable part of a website's functionality, directly affecting the efficiency and willingness of users to communicate with the company.In AnQiCMS, we provide a simple and powerful template tag——`contact`, allowing you to easily display the contact information configured in the background on the website front-end.--- ###

2025-11-06

How to implement pagination display of document list in AnQiCMS template using `pagination` tag?

As a senior Anqi CMS website operator, we fully understand that it is crucial to efficiently display a large amount of content in a content management system and ensure a user-friendly browsing experience.For a document list, pagination is the core function to achieve this goal.In the AnQiCMS template system, the `pagination` tag plays a key role in connecting the document list with page navigation, allowing a large number of documents to be presented to the user in a structured manner while maintaining flexibility and customizability.

2025-11-06