How to output system information configured in the AnQiCMS template, such as website name, Logo, and filing number?

Calendar 👁️ 59

In the flexible world of AnQiCMS, elegantly presenting system-level information configured in the background on the website front-end is a core skill that every website operator and template developer needs to master.As an experienced website operation expert, I am well aware that these seemingly minor details are invaluable for enhancing brand image, optimizing user experience, and meeting legal requirements (such as the display of filing numbers).Today, let's delve deeply into how to output these valuable background information in an AnQiCMS template in a natural and smooth way.

AnQiCMS, as an enterprise-level content management system developed based on the Go language, provides strong support for small and medium-sized enterprises and content operation teams with its high efficiency, customizable and scalable features.The template engine is cleverly designed, drawing on the advantages of Django templates, making it easy for operators who are not well-versed in Go language to easily handle the presentation of front-end content.

The core points of AnQiCMS template syntax

In AnQiCMS templates, variable output uses double curly braces{{ 变量名 }}The form. While logical control tags, such as conditional judgments and loops, are represented by single curly braces with a percentage sign.{% 标签 %}This is the form presented. Understanding this is the first step to mastering the AnQiCMS template.The system information configured on the back-end, which is dynamically injected into our front-end page through this tag syntax.

Unveil the "System Settings" tag:systempower

The core lies in the use of a namedsystemThe powerful tag. This tag is used to retrieve the various system-level parameters you have configured in the "Global Settings" of the AnQiCMS backend.

Its basic usage method is very intuitive:{% system 变量名称 with name="字段名称" %}.

HerenameParameters are crucial, they correspond to the unique identifiers (field names) of each configuration item on the background "Global Settings" interface. For example, the field name corresponding to the website name isSiteNameThe website logo isSiteLogoAnd the filing number isSiteIcpSpecify these field names, and you can accurately retrieve the corresponding information from the background. If you do not need to assign the result to a variable, you can also output it directly, for example{% system with name="SiteName" %}.

Practice exercise: easily output the core information of the website

Next, let's look at specific examples of how to embed common information such as website name, Logo, and filing number into your AnQiCMS template.

1. Display the website name (SiteName)

The website name usually appears on the page.<title>It is located in the tag as well as the header navigation or other prominent position of the website. It is not only an important part of brand recognition, but also the basis of SEO optimization.

You can call it like this:

<title>{% system with name="SiteName" %}</title>
{# 如果想把网站名称赋给一个变量再使用,可以这么做 #}
{% system currentSiteName with name="SiteName" %}
<h1>欢迎来到 {{ currentSiteName }} 的官方网站</h1>

Through this simple tag, no matter how you modify the website name in the background, the front-end will synchronize the update in real time to maintain consistency of information.

2. Embed Website Logo (SiteLogo)

The website logo is the visual symbol of the brand and an important manifestation of website personalization. Usually, the Logo will be displayed in the following way<img>Tag form embedded and accompaniedaltAttributes to enhance SEO and accessibility

The following is a typical way to call the website logo:

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

Here we cleverly use the website name as the logo ofaltAttribute values, not only increased semantics, but also make search engines better understand the image content.

3. Display the website filing number (SiteIcp)

For websites operating in mainland China, the filing number is an essential compliance information, usually placed at the footer of the website.AnQiCMS also supports unified management of this information in the background.

You can output the filing number in the template like this:

<p>
    {# 备案号通常需要链接到工信部备案查询网站 #}
    <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
        {% system with name="SiteIcp" %}
    </a>
    {# 您可以结合当前年份和版权信息,使页脚更完善 #}
    &copy; {% now "2006" %} 版权所有
</p>

This code not only outputs the background configuration of the filing number, but also automatically generates a link to the Ministry of Industry and Information Technology filing query website, and dynamically displays the current year, making your footer information both professional and compliant.

4. Flexibly call other system information and custom parameters

In addition to the aforementioned three items,systemLabels can also obtain other preset information from the background "Global Settings", such as the website home page addressBaseUrlMobile end addressMobileUrlCopyright contentSiteCopyrightetc.

It is worth mentioning that if you have customized additional parameters in the background "Global Settings", such as a parameter namedServiceHotlinecustomer service hotline, you can also access it throughsystemLabel it easily to output:

{# 输出自定义的客服热线 #}
客服热线:{% system with name="ServiceHotline" %}
{# 如果ServiceHotline可能包含HTML,可以使用safe过滤器 #}
<p>{% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}</p>

This greatly enhances the flexibility and maintainability of the template, allowing you to adjust the important operational information of the website without modifying the code.

Summary

The template mechanism of AnQiCMS provides great convenience for website operators. By using it flexiblysystemTags, you can seamlessly and dynamically display key information such as the website name, Logo, filing number, and other information configured in the background on the website front-end.This configuration method of front-end and back-end separation not only ensures the consistency of website information, but also greatly improves the efficiency of content management.Master these basic skills and you will be able to better utilize AnQiCMS to build professional, efficient, and easy-to-maintain websites.


Frequently Asked Questions (FAQ)

Q1: Why did the website name or logo I changed in AnQiCMS backend not update on the front-end page immediately?

A1:This is usually caused by caching. AnQiCMS enables caching to improve website access speed and reduce server pressure.After you modify the system configuration in the background, you may need to manually clear the cache so that the front page will display the latest content.You can find the 'Update Cache' option in the left menu of the AnQiCMS backend management interface by clicking, which will clear the system cache.

Q2: BesidessystemTags, What other tags can be used to output the basic configuration information of AnQiCMS?

A2:exceptsystemTag outside

Related articles

How to define and call the `macro` macro function in the AnQiCMS template to create reusable code snippets?

In the process of website operation and development, we always encounter the need to repeatedly write similar code segments, such as unified article card styles, product information display modules, or form elements with specific interactions.If you start from scratch every time, it is not only inefficient, but also makes maintenance a nightmare.AnQi CMS is well-versed in this, its powerful template engine provides us with the 'macro' macro function, a tool aimed at helping developers and operators easily create reusable code snippets

2025-11-06

How to implement template inheritance with the `extends` tag and overwrite specific blocks of the parent template?

As an experienced website operations expert, I deeply understand that a flexible and efficient template system is crucial for the long-term development of a website.In AnQiCMS (AnQiCMS), it draws on the powerful capabilities of the Django template engine, allowing you to manage the website interface in a simple and logical way.Today, we will focus on one of the core features - the `extends` tag, and delve into how it implements template inheritance, allowing us to accurately rewrite specific blocks of the parent template.

2025-11-06

How to implement code reuse and pass additional variables using the `include` tag in template development?

As an experienced website operations expert, I am well aware of the importance of template development efficiency and code maintainability for a website in my daily work.AnQiCMS (AnQiCMS) relies on its efficient architecture based on the Go language and the Django-style template engine, providing us with powerful content management capabilities.Today, let's delve deeply into a tool that can significantly improve efficiency and code reuse in Anqi CMS template development, namely the `include` tag, especially how it helps us achieve code reuse and flexibly pass additional variables.

2025-11-06

How to use `with` or `set` tags to define and assign variables in AnQiCMS templates?

AnQiCMS's template system is known for its flexibility and ease of use, providing strong support for content operators and developers.In the presentation of content, we often need to define temporary variables to handle data, optimize logic, or pass parameters.AnQiCMS template engine borrowed the syntax style of Django templates and provided two very practical tags to help us achieve this goal: `with` and `set`.Understanding their respective features and application scenarios can make your template code clearer and more efficient.

2025-11-06

What is the core function of the `archiveParams` tag in AnQiCMS template?

In the world of AnQi CMS templates, efficiently and flexibly displaying content is the key to the success of website operation.We know that a good content management system not only needs to manage standardized information but also needs to adapt to the ever-changing business needs and provide personalized content display.Today, let's delve deeply into a crucial tag in the AnQiCMS template, `archiveParams`, which is the幕后 hero behind highly customized content.What is the core function of the `archiveParams` tag in AnQiCMS templates?

2025-11-06

How to use the `archiveParams` tag to display all custom parameters of the current document in AnQiCMS template?

AnQiCMS template's `archiveParams` tag: easily display all custom parameters of the document As a senior website operations expert, I am well aware that in a content management system, how to flexibly display and utilize the various properties of documents is crucial for website customization and functional expansion. AnQiCMS, as an efficient and customizable content management system, provides a rich and powerful set of template tags, among which the `archiveParams` tag is the core tool to unlock the powerful features of document custom parameters.

2025-11-06

How is the `archiveParams` tag's `id` parameter used to retrieve custom fields of a specific document?

As an experienced website operation expert, I am happy to give you a detailed explanation of how the `archiveParams` tag's `id` parameter is used to obtain custom fields of specific documents in AnQi CMS.The AnQi CMS, with its flexible content model and powerful template tag system, provides great convenience for content operations.Grasp the essence of these tags, which can make your website content display more personalized and greatly increase operational efficiency.

2025-11-06

In AnQiCMS, how does the `sorted` parameter of the `archiveParams` tag control the output order of custom parameters?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system that provides great freedom in content display.Among them, the custom parameter function allows website operators to add unique attributes to content models such as articles, products, etc. according to their actual business needs, such as product specifications, author information, source channels, etc.How to elegantly display these custom parameters in the front-end template, especially the clever use of the core parameter `sorted`, is indispensable.

2025-11-06