How to display AnQiCMS system configuration information on the front end (such as website name, Logo, filing number)?

Calendar 👁️ 82

In AnQi CMS, when building a website, the first thing to consider is often how to elegantly display basic system configuration information on the website front-end, such as the website name, logo image, and ICP filing number.This information is not only the 'face' of the website, it concerns the brand image, but also is an important part of enhancing user trust and even complying with laws and regulations.AnQi CMS provides us with a very convenient way to dynamically call these system information through template tags.

The template mechanism and system information of AnQi CMS

The Anqi CMS uses a template engine syntax similar to Django, which allows us to control the presentation of page content in a straightforward and powerful way. All front-end pages are usually located at/templateUnder the directory.htmlFile construction. In these template files, we can operate data through two main syntaxes:{{变量}}Used to output variable content, and{% 标签 %}It is used to implement logic control or call specific functional modules.

For global system configurations such as website name, Logo, and filing number, Anqi CMS provides a specialsystemThe tag can help us retrieve various preset information from the background in the "Global Function Settings" to ensure the consistency and dynamic update of website information.

How to display this information in a front-end template?

Next, let's see how to use it specifically in the templatesystemtags to display these important configuration items.

Display of the site name (SiteName)

The website name is the identity of the website, which usually appears on the page.<title>Tag, as well as in the navigation bar, footer, and other key positions. BysystemTag, we can easily obtain it:

{# 在页面的<head>部分,设置网站标题 #}
<title>{% tdk with name="Title" siteName=true %}</title>

{# 或者在页面其他位置直接显示网站名称 #}
<h1>欢迎来到 {% system with name="SiteName" %}</h1>

Here, we usedtdktags to dynamically generate the page title and pass insiteName=trueThe parameter will automatically append the website name as a suffix to the title after it, which is a SEO-friendly practice. Of course, you can also use it directly to display the website name separately.{% system with name="SiteName" %}to display the website name separately.

The display of the website logo (SiteLogo)

The website logo is the core of brand visual recognition, usually presented in the form of an image. In Anqi CMS, the address of the website logo image uploaded on the backend can be accessed throughsystemLabel acquisition. It is recommended to set it at the same time as inserting the logoaltProperty, this is not only friendly to visually impaired users, but also an important part of search engine optimization (SEO), helping search engines understand the content of images.

{# 在导航栏或其他位置显示网站Logo #}
<a href="{% system with name="BaseUrl" %}">
    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %} - Logo" class="site-logo">
</a>

Here we also usedBaseUrlLabel to get the root address of the website, make sure that clicking the Logo can correctly jump back to the homepage.

The call of the website filing number (SiteIcp)

For websites operating in mainland China, the ICP record number is a legally required piece of information that is usually placed in the footer of the website and linked to the Ministry of Industry and Information Technology record query website.

{# 在页脚区域显示备案号并添加链接 #}
<p>
    <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
        {% system with name="SiteIcp" %}
    </a>
</p>

rel="nofollow"andtarget="_blank"It is recommended attribute, the former tells the search engine not to track this link, and the latter ensures that the link opens in a new window, improving the user experience.

Copyright information (SiteCopyright) and the current year

The copyright information of the website is usually also located at the footer, in order to keep it updated, we often need to dynamically display the current year. Anqi CMS'ssystemThe label can retrieve the copyright content set by the background, while combiningnowThe label can retrieve the current year, making the copyright information unnecessary to modify manually.

{# 在页脚显示版权信息,动态显示年份 #}
<p>
    &copy; {% now "2006" %} {% system with name="SiteCopyright" %}
</p>

{% now "2006" %}According to the Golang time format rule, it dynamically outputs the current year, for example “2023” or “2024”.

Flexible application of custom parameters.

In addition to the aforementioned built-in system configurations, sometimes we may need to customize some additional global information in the background, such as customer service phone numbers, company vision, etc.The AnQi CMS allows you to add custom parameters in the "Global Function Settings".Once set, these parameters can also be accessed throughsystemTags to retrieve and display:

Assuming you have added a custom parameter named "ServicePhone" in the background, with the value of "400-123-4567".

{# 显示自定义的客服电话 #}
<div>客服热线:{% system with name="ServicePhone" %}</div>

Integrate this information into the template

In actual projects, these system configuration information is usually integrated into the public header (header.html) or footer (footer.html) of the website, and then through{% include %}Introduce tags to all pages to ensure consistency across the site

Here is a simplifiedbase.htmlorheader.htmlcode snippet that shows how to integrate these system tags:

<!DOCTYPE html>
<html lang="{% system with name='Language' %}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {# 页面标题,附加网站名称 #}
    <title>{% tdk with name="Title" siteName=true %}</title>
    {# 网站关键词 #}
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    {# 网站描述 #}
    <meta name="description" content="{% tdk with name="Description" %}">
    {# 引入网站样式表,使用TemplateUrl获取静态资源路径 #}
    <link rel="stylesheet" href="{% system with name="TemplateUrl" %}/static/css/style.css">
    {# 可能的规范链接 #}
    {%- tdk canonical with name="CanonicalUrl" %}
    {%- if canonical %}
    <link rel="canonical" href="{{canonical}}" />
    {%- endif %}
</head>
<body>
    <header class="site-header">
        <div class="container">
            {# 网站Logo和名称 #}
            <div class="logo">
                <a href="{% system with name="BaseUrl" %}">
                    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %} - Logo">
                </a>
                <span>{% system with name="SiteName" %}</span>
            </div>
            {# 导航栏 #}
            <nav class="main-nav">
                {# 这里通常会使用navList标签来动态生成导航菜单 #}
            </nav>
            {# 显示自定义的客服电话 #}
            <div class="contact-info">
                客服热线:{% system with name="ServicePhone" %}
            </div>
        </div>
    </header>

    <main class="site-content">
        {# 页面主要内容将在此处插入 #}
    </main>

    <footer class="site-footer">
        <div class="container">
            {# 版权信息 #}
            <p>&copy; {% now "2006" %} {% system with name="SiteCopyright" %}</p>
            {# ICP备案号 #}
            <p>
                <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
                    {% system with name="SiteIcp" %}
                </a>
            </p>
        </div>
    </footer>
</body>
</html>

In AnQi CMS, the process of obtaining and displaying system configuration information is concise and clear. We just need to fill in or upload the corresponding content in the background "Background Settings" -> "Global Function Settings", and then use it in the front-end template.systemlabel and specifynameParameters can be easily called. This method not only improves the maintainability of the website but also provides a solid foundation for the dynamic operation of content.

Frequently Asked Questions (FAQ)

1. Why did I set the website logo in the background, but it didn't show up on the front end?

First, please make sure you have used it correctly in the front-end template.{% system with name="SiteLogo" %}The tag. Next, check if the tag is located<img>label'ssrcin the attributes, and<img>The style (CSS) of the tag does not hide it. If the logo image address is a relative path, it also needs to be confirmedTemplateUrlWhether the label is output correctly, or make sure that the image file itself has been successfully uploaded to the accessible path of the server.Finally, remember to clear the website cache (background 'update cache' function), sometimes new uploaded images or settings need to refresh the cache to take effect.

How to configure different website names and logos for multiple sites?

The AnQi CMS supports multi-site management, each site can have independent configuration.When you create a new site through the 'Multi-site Management' feature in the background, each site has its own 'Global Feature Settings'.Therefore, in the template callsystemWhen labeling, it is usually not necessary to specify the site ID additionally, the system will automatically identify which site the current visited domain belongs to and retrieve the corresponding configuration. If you indeed need to display *other* site configuration information within a specific site, you cansystemthe tag withsiteIdparameters, for example{% system with name="SiteName" siteId="2" %}To get the website name of the site with ID 2.

**3. I am in the global function of the website backend “

Related articles

How does the template inheritance feature help developers build a unified and easy-to-maintain page layout?

In AnQiCMS, building a unified and easy-to-maintain page layout is crucial for the long-term healthy operation of any website.As the face of a website, the visual consistency of a page directly affects user experience and brand image;The maintenance efficiency behind it determines the speed of content updates and feature iterations.AnQiCMS's powerful template inheritance feature is the core tool to solve this challenge.The core concept of template inheritance lies in **reusability and layering**.It allows us to create a basic "master" template that includes the common structure and elements of all web pages, such as headers and footers

2025-11-09

How to define and use macro functions to reuse display logic in AnQiCMS templates?

In the template development of Anqi CMS, we often encounter the need to reuse HTML code snippets or display logic.If you copy and paste every time, it not only increases the amount of code, reduces development efficiency, but also brings many inconveniences in later maintenance.To solve this problem, AnQi CMS template engine provides a powerful macro function (Macro) that helps us achieve the reuse of display logic, making the template code more concise and efficient.What is a template macro function?\n\nA macro function can be understood as a "custom function" in the template.

2025-11-09

How to reference external HTML fragments (such as headers, footers) in AnQiCMS templates to display modular content?

In website operations, maintaining the modularization and high reusability of content can not only significantly improve development efficiency, but also make the website more flexible during iterative updates.AnQiCMS (AnQiCMS) provides a straightforward and efficient solution with its powerful template engine to achieve this goal.This article will delve into how to make clever use of the Anqi CMS template mechanism, referencing external HTML fragments such as headers and footers, thus building a website that is easy to manage and has a clear structure. ### The Value of Modular Content: Why Reference External HTML Fragments?Imagine

2025-11-09

How to ensure that the date and time are displayed correctly on the front end using the timestamp formatting tag?

In website content operation, the correct display of date and time information is crucial, as it not only affects the user's reading experience but also directly relates to the timeliness and accuracy of the information.AnQiCMS (AnQiCMS) understands this point and provides a powerful and flexible timestamp formatting tag, allowing developers and operators to easily convert the original timestamp stored on the backend into a date and time format that is intuitive and easy to read for front-end users.Why do we need timestamp formatting?\n\nWe know that the data stored on the website backend, especially publishing time, update time, comment time, etc.

2025-11-09

How to create custom fields in the document model and flexibly call them for display in the front-end template?

AnQiCMS (AnQiCMS) has provided great convenience for us to build personalized websites with its flexible content model.We all know that the content structure of each website is different, and the traditional "article", "product" model often fails to meet all the details display needs.At this time, custom fields have become an indispensable tool for website operation and content management.This article will guide you step by step on how to create custom fields in Anqi CMS and flexibly display their content on the website front-end template.### The First Part

2025-11-09

How does the content list on the search results page dynamically display based on the user's query keywords?

In website operation, the search function is the core to enhance user experience and help users quickly find the information they need.A highly efficient and intelligent search results page can not only meet the immediate needs of users, but also effectively guide traffic and enhance the exposure of website content.AnQiCMS (AnQiCMS) provides us with powerful tools that allow the content display on the search results page to be flexibly and dynamically adjusted according to the user's query keywords, thereby achieving more accurate and personalized content presentation.### Core Mechanism: Understanding AnQiCMS

2025-11-09

How to display "Previous" and "Next" articles on the article detail page to enhance user experience?

In website content operation, continuously optimizing user experience is the key to enhancing website value.How to guide users to find more related content while browsing an article on your website, to maintain their reading interest, is a problem that every operator needs to think about.Add "Previous" and "Next" article navigation at the bottom or side of the article detail page, which is a very effective and common strategy.It not only allows users to conveniently explore the website content, reduces the trouble of returning to the list page to find things, but also extends the time users stay on the website unobtrusively, and reduces the bounce rate

2025-11-09

How do related document tags intelligently display content similar to the current article topic?

How to guide visitors to more related content naturally after they finish reading an article in content operation, which can not only significantly improve user experience, but also effectively extend the visitors' stay on the website, reduce the bounce rate, and thus have a positive impact on search engine optimization (SEO).AnQi CMS is well-versed in this, providing intelligent and flexible mechanisms that allow us to easily implement this "You might also like" content recommendation.### Content Tag: The First Step of Building Associations AnQi CMS realizes smart content association through its powerful "tag" feature

2025-11-09