Does AnQiCMS support directly retrieving and displaying system configuration information (such as website name, Logo) in templates?

Calendar 👁️ 84

During the construction and maintenance of websites, we often encounter the need to display basic information about the website at various positions on the page, such as the name of the website, Logo, copyright statement, filing number, and so on.If this information is scattered in various corners of the template, it will be very cumbersome and prone to errors once it needs to be modified.Then, what kind of solution does AnQiCMS provide in this regard?Does it support us getting and displaying these system-level configuration information directly in the template?

The answer is affirmative. AnQiCMS is an efficient content management system that fully considers the convenience and flexibility of template development. It provides a powerfulSystem settings label (system)Allow template developers to easily call various system information configured in the background in any template file.

systemTags: One-stop access to basic website information

systemThe tag is a core and practical tag in the AnQiCMS template engine, its design philosophy is to directly expose the information configured in the "Global Function Settings" of the website backend to the front-end template.This means that whether you need to display the website name, Logo, or other key information uniformly set in the background, you can easily obtain it through this tag.

systemThe basic usage of tags is very intuitive:

{% system 变量名称 with name="字段名称" %}

Here, "field name" corresponds to the English name of the parameters configured in the "Global Function Settings" of the AnQiCMS backend. For example, to get the website name, the field name isSiteName; To get the website logo, the field name isSiteLogo.变量名称Optional, if you want to assign the obtained value to a variable for subsequent processing, you can specify it; if you simply want to output it directly, you can use the label directly.

Let's go through several specific examples to see how to usesystemtags to obtain and display common system configuration information.

1. Obtain and display the website name

The website name is the face of the website, usually used on the page.<title>Tags, next to Logo or footer. In the template, you can call it like this:

<title>{% system with name="SiteName" %}</title>
或者:
<div>欢迎访问:{% system with name="SiteName" %}</div>

If you want to assign the website name to a variable:

{% system siteName with name="SiteName" %}
<h1>{{ siteName }}</h1>

2. Get and display the website logo

The website logo is an important element of brand recognition, usually displayed in the header area. Get the URL of the website logo image:

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

here,altThe property is also used directly.SiteNameThe label ensures the accessibility of images and SEO-friendliness.

3. Display the website filing number and copyright information.

This information is usually located at the footer of the website, which is particularly important for domestic websites.

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

Here we also combined with{% now "2006" %}tags to dynamically obtain the current year, keeping the copyright information up to date.

4. Get the homepage address and template static file address of the website

This information is crucial when building links or referencing static resources in the template.

<link href="{% system with name="TemplateUrl" %}/css/style.css" rel="stylesheet">
<a href="{% system with name="BaseUrl" %}">网站首页</a>

ByTemplateUrlYou can ensure that static resources load correctly regardless of the path where the website is deployed.

5. Flexible retrieval of custom parameters

The AnQiCMS backend "Global Function Settings" not only provides a series of default system configuration items but also allows you to add custom parameters according to your actual needs.This means that whether it is a customer service phone number, social media link, statistics code snippet, or any information you wish to manage centrally and call in a template, it can be achieved through custom parameters.

For example, if you add a namedCustomPhoneThe custom parameter, and set it to “400-123-4567”, then you can call it in the template like this:

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

This custom mechanism greatly enhances the flexibility and maintainability of the template.

systemThe value brought by tags

BysystemLabel, AnQiCMS achieves a high degree of decoupling between website basic information and templates. Its advantages are obvious:

  • Centralized management and unified update:All system-level configurations are centralized in the background, one-time modification takes effect throughout the site, greatly reducing maintenance costs.
  • Improve development efficiency:Template developers do not need to hard-code website information, they just need to call the tag, which simplifies the development process.
  • Ensure consistency of information:Avoided issues of inconsistent information due to manual modification, omissions, or typographical errors.
  • Enhanced flexibility:By customizing parameters, it can easily expand configurable information to meet various complex business needs.

In summary, AnQiCMS'ssystemThe label is an excellent embodiment of its template development friendliness.It makes the acquisition and display of basic website information simpler and more efficient than ever before, providing users with a smooth and practical website operation experience.


Frequently Asked Questions (FAQ)

Q1: Has the website backend changed the website name or logo, will the front-end page update immediately?A1: In most cases, the AnQiCMS template reads the latest configuration information in real time.If you encounter situations where updates are not timely, it may be due to browser caching or the system cache of AnQiCMS.You can try clearing the browser cache (Ctrl+F5) or manually clearing the system cache in the 'Update Cache' feature of AnQiCMS backend, and the page will display the latest content.

Q2: Besides the website name and logo, can yousystemWhat information does the tag get commonly?A2:systemThe tag is very comprehensive, in addition to the website name and Logo, you can also easily get the website filing number (SiteIcp), copyright information (SiteCopyright)、Website Home Address(BaseUrl)、Mobile End Address(MobileUrl)、Template Static Files Address(TemplateUrl), as well as any parameters you customize in the background "Global Function Settings". This allows for the centralized management and calling of various general information on the website.

Q3: Can I use it in any template file (such as header, sidebar, article detail page)?systemAm I supposed to use the label?A3: Yes,systemThe label is a globally available system-level label. You can use it anywhere in the AnQiCMS template system, whether it is in a public header file (such aspartial/header.html), footer file, or specific article detail page, category list page, can easily call the system configuration information.This greatly facilitates the modular design and unified management of the template.

Related articles

How to implement the multi-language content switching and front-end display of AnQiCMS website?

It is undoubtedly a crucial link in the construction of a global digital content platform.AnQiCMS (AnQiCMS) is a management system designed specifically for content operators, deeply understanding this field, providing comprehensive multi-language content switching and front-end display functions, aiming to help users efficiently expand into the international market and reach a wider audience.## AnQiCMS Multilingual Function Overview AnQiCMS is developed based on Go language, and it is an ideal choice for small and medium-sized enterprises and content operation teams due to its high efficiency, customizability, and scalability.

2025-11-07

How to control the number of articles displayed per page and the sorting method on the article list page?

## Fine Control: The Practical Guide to the Number and Sorting of Articles on the AnQi CMS List Page In content operations, the list page of articles on the website is an important window for users to browse content and discover information.A well-organized and content-rich list page, which not only enhances user experience but is also a key factor in search engine optimization (SEO).AnQi CMS is well-versed in this, enabling you to easily and precisely control the number of articles displayed per page and the sorting method of the content through its powerful and flexible template tag system.This article will take you deep into how to use Anqi CMS

2025-11-07

How to customize the URL rewrite rules for the article detail page in the AnQiCMS template?

## Optimize SEO, Enhance User Experience: AnQiCMS Detailed Explanation of Custom Article Detail Page URL Static Rules In website operation, a clear and meaningful URL structure is crucial for search engine optimization (SEO) and user experience.Imagine a user sees `/article.php?Which link would be more attractive to them, the one with `id=123&category=news` such as this, or the one with `/news/anqicms-url-guide.html` such as this?

2025-11-07

How to customize the display of SEO titles, keywords, and descriptions on the AnQiCMS homepage?

In the digital age, the homepage of a website is like the 'front door' of a company, the information presented to search engines is crucial.An meticulously optimized homepage that clearly conveys the core value of the website, attracts target users, and provides friendly crawling signals to search engines.In AnQiCMS, customizing the display of the SEO title (Title), keywords (Keywords), and description (Description) on the homepage is a straightforward and powerful process, which is an important manifestation of AnQiCMS's SEO-friendly features.

2025-11-07

How to call and display the contact information (phone, email, address) set in the back-end template on the front-end?

It is crucial to clearly and effectively display contact information in website operation to establish user trust and promote communication.Whether it is to consult products, seek service support, or give feedback, a reachable phone, email, or address can greatly enhance the user experience.AnQiCMS (AnQiCMS) fully considers this requirement, providing a flexible and convenient way for website administrators to centrally manage contact information in the background, and easily call and display on the front-end page through simple template tags.### Step 1

2025-11-07

How does AnQiCMS ensure the safety and compliance of front-end displayed content, such as sensitive word filtering?

When operating a website, the security and compliance of content is an indispensable part, especially in the context of the increasingly regulated online environment today.For users who use AnQiCMS, the system provides a variety of functions to help ensure the security and compliance of the displayed content on the front end, such as the sensitive word filtering that users are generally concerned about.At the beginning of its design, AnQiCMS placed content security at the core position.It is not just a content publishing tool, but also a platform dedicated to providing users with a safe and compliant content management environment

2025-11-07

How to implement lazy loading (Lazyload) of images in the article content to optimize page performance?

In website operation, page loading speed is crucial for user experience and search engine optimization (SEO).Especially when the article content includes a large number of images, the loading of image files often becomes the "culprit" that slows down the page speed.Lucky enough, by implementing the Lazyload image technology, we can effectively solve this problem.For friends using AnQiCMS, understanding and applying this technology will significantly improve website performance. Image lazy loading, as the name implies, is to delay the loading of images outside the user's current viewport.When the user scrolls the page

2025-11-07

How to implement the dynamic display of multi-level navigation menus in front-end templates?

In web design, a clear and easy-to-use navigation menu is the key to improving user experience and the professionalism of the website.AnQiCMS (AnQiCMS) provides the convenience of dynamically building multi-level navigation menus in front-end templates with its flexible template engine and powerful content management features.Understand the backend configuration and the calling logic of the front-end template of its navigation system, which is the foundation for achieving this goal. ### Overview of Anqi CMS Navigation System The navigation feature of Anqi CMS is designed to be very practical, closely integrating the creation of navigation menus with content display. On the backend

2025-11-07