How to get and display the global configuration information (such as name, Logo) of AnQiCMS template?

Calendar 👁️ 70

As an experienced website operator proficient in AnQiCMS, I know that efficiently and accurately obtaining and displaying global configuration information in templates is crucial for website maintenance, brand consistency, and user experience.AnQiCMS provides intuitive and powerful template tags that can easily achieve this goal.

In AnQiCMS template, retrieve and display the global configuration information of the website, such as the website name, Logo, filing number, etc., mainly relies on the built-in system.systemThe tag is specifically designed to extract various core website information configured in the background "Global Settings", ensuring that the website maintains a unified brand image and operational information on any page.

Core Label: System

systemTags are the key to accessing the AnQiCMS global configuration data. Its basic usage method is{% system 变量名称 with name="字段名称" %}. Among them,变量名称Is an optional parameter, used to assign the obtained value to a temporary variable so that it can be referenced multiple times in the template or used for logical judgment. If omitted变量名称, the tag will directly output the value of the field.nameThe parameter is required, specifying the specific global configuration field you want to retrieve.

The AnQiCMS backend "Global Settings" module (located under "Backend Settings" -> "Global Settings") allows you to define various basic information about the website. This information can be directly accessed throughsystemThe tag is called in the template.

Website Name (SiteName)

The website name is the identifier of the website, which is usually displayed in the browser title bar, header, and other places. Throughsystemthe tag, you can easily get this information:

<title>{% system with name="SiteName" %} - 您的页面标题</title>
<h1>欢迎来到 {% system with name="SiteName" %}</h1>

You can also choose to assign it to a variable so that it can be used more flexibly in the template:

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

Website Logo (SiteLogo)

The website logo is the core element of brand visual identification. In AnQiCMS, the path of the uploaded logo image can be obtained throughsystemtags and applied to<img>in the tag.

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

To enhance user experience and SEO effects, it is recommended to<img>labels to use simultaneouslyaltAttribute, and set its value to the website name.

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

Website record number (SiteIcp)

Websites operating in mainland China usually need to be registered. AnQiCMS provides a configuration item for the registration number in the background, throughsystemTags can be displayed at the bottom of the website or in other required positions.

<footer>
    <p>备案号:<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a></p>
</footer>

Copyright Information (SiteCopyright)

The copyright information of the website is usually displayed in the footer to declare the ownership of the website content.

<footer>
    <p>{% system with name="SiteCopyright" %} &copy; {% now "2006" %} All Rights Reserved.</p>
</footer>

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

Home page address (BaseUrl)

It is very useful to get the root URL of the website when building absolute links or performing page jumps.

<a href="{% system with name="BaseUrl" %}">返回首页</a>

Template static file address (TemplateUrl)

For easy reference to static resources (such as CSS, JavaScript, images, etc.) in the template directory, AnQiCMS providesTemplateUrlThe field points to the root path of the static resources of the current active template.

<link rel="stylesheet" href="{% system with name="TemplateUrl" %}/css/style.css">
<script src="{% system with name="TemplateUrl" %}/js/main.js"></script>

Custom parameter

In addition to the built-in global configuration items, AnQiCMS also supports adding custom parameters in the background "Global Settings".These custom parameters can be used to store any information you wish to call globally on the website, such as customer service phone numbers, company fax numbers, custom social media links, and so on.

Assuming you have added a custom parameter named "CustomerServicePhone" with a value of "400-123-4567" in the background, you can call it in the template like this:

<div>客服电话:{% system with name="CustomerServicePhone" %}</div>

This will greatly enhance the flexibility and maintainability of the template, avoid hard coding, and allow operators to directly update information through the back-end interface.

Application scenarios and **practice

These global configuration information is usually placed in the common area of the website, such as the header (header), footer (footer), or sidebar (sidebar), etc., common template fragments. By using inbase.htmlorpartial/header.html/partial/footer.htmlIntegrating these tags into the files ensures that all relevant information on the entire website can be automatically synchronized after updating the background settings, without the need to manually modify each page.

For example, a typicalheader.htmlThe file may contain the following structure:

<!DOCTYPE html>
<html lang="{% system with name='Language' %}">
<head>
    <meta charset="UTF-8">
    <title>{% tdk with name="Title" siteName=true %}</title>
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    <meta name="description" content="{% tdk with name="Description" %}">
    <link rel="stylesheet" href="{% system with name="TemplateUrl" %}/css/style.css">
    <link rel="icon" href="{% system with name="SiteLogo" %}" type="image/x-icon">
</head>
<body>
    <header>
        <div class="logo-area">
            <a href="{% system with name="BaseUrl" %}">
                <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
            </a>
        </div>
        <nav>
            {# 导航栏标签 {% navList ... %} 通常会放在这里 #}
        </nav>
    </header>

This modular reference method, combined with the powerful global configuration management function of AnQiCMS, makes website content creation and operation more convenient and efficient.

Frequently Asked Questions

What should I do if I updated the website name or Logo on the AnQiCMS backend, but the front-end page did not take effect immediately?

This is usually due to system caching. AnQiCMS caches some data to improve website access speed.After changing the configuration in the background, you need to go to the background's "Update Cache" feature and click to clear the system cache.After cleaning is completed, the front-end page will display the latest configuration information.If it still does not work, try clearing your browser cache or accessing in incognito mode.

How can I reference the global configuration information of a specific site in the AnQiCMS deployment across multiple sites?

AnQiCMS'systemTag supportsiteIdParameter. If you have deployed multiple sites and want to display global information from other sites in the template of the current site (for example, the main site's Logo), you can explicitly specifysiteIdFor example,{% system with name="SiteLogo" siteId="1" %}You will obtain the logo of the site with ID 1. Please note,siteIdIt is the unique ID assigned to each site in the multi-site management of AnQiCMS backend.

Can I passsystemTag to get the current status of the website (for example, whether it is closed) or the current language?

Yes,systemTag can get this information. You can{% system with name="SiteCloseTips" %}Get the closure notice and proceed by{% system with name="Language" %}Get the language code of the current site. This information is very useful when rendering conditions based on website status or language, such as displaying a maintenance page, or setting according to the language code.<html>label'slangProperty.

Related articles

How to specify an independent template file for a specific category, article, or single page in AnQiCMS?

As a deep user of Anqi CMS website operators, I know that the flexibility of content display is crucial for attracting and retaining users.Strong support is provided by Anqicms in this aspect, allowing us to specify exclusive template files for specific categories, articles, even independent pages, thereby achieving highly customized content presentation.This not only helps to improve the user experience, but also provides great convenience for our refined operation and SEO optimization.

2025-11-06

How to customize the directory structure and file naming rules of AnQiCMS templates?

Hello, as a senior operator of AnQiCMS, I am very happy to be able to elaborate in detail on how to customize the directory structure and file naming rules of AnQiCMS templates.Understanding these basics is the key to efficient management and optimization of website content. ### AnQiCMS Template Custom Overview AnQiCMS is an enterprise-level content management system based on the Go language, which provides high flexibility in template customization.It uses a syntax similar to the Django template engine, making it easy for front-end developers to get started.

2025-11-06

How to create a multi-level website navigation menu in AnQiCMS template?

As an experienced AnQiCMS website operations staff, I know that a clear and efficient multi-level website navigation menu is crucial for user experience and website SEO.AnQiCMS provides a comprehensive mechanism in template design and backend management, helping us easily build such a menu.I will elaborate in detail on how to create a multi-level website navigation menu in the AnQiCMS template.

2025-11-06

How to remove the blank lines that may be generated by logic tags in the AnQiCMS template?

As an experienced CMS website operation personnel of an enterprise, I know that every detail of content presentation is crucial, including seemingly trivial blank lines.In a meticulously constructed template, unnecessary blank lines not only affect the neatness of the HTML code, but may also cause unexpected visual problems in certain layouts.Today, let's delve into how to efficiently remove blank lines that may be generated by logical tags in the AnQiCMS template.

2025-11-06

How to call and display the contact information (such as phone, email, social media) configured in the AnQiCMS template?

As a senior content worker who deeply understands the operation of Anqi CMS, I know the importance of displaying the contact information of the enterprise externally.This not only concerns whether customers can conveniently contact you, but also is the basis for building trust and promoting business cooperation.AnQi CMS provides a直观 and flexible solution for website operators, allowing you to easily manage and display various contact information without writing complex code.

2025-11-06

How to dynamically generate the SEO title, keywords, and description of the current page and support the website name suffix?

As an experienced content management expert who is deeply familiar with AnQiCMS operations, I know the importance of Search Engine Optimization (SEO) for website traffic and user retention.The website's SEO title, keywords, and description (usually abbreviated as TDK) are key factors for search engines to understand page content and for users to decide whether to click.AnQiCMS provides a powerful and flexible mechanism that allows us to dynamically generate these important SEO elements and conveniently integrate the website name as a suffix to enhance brand recognition.

2025-11-06

How to implement dynamic breadcrumb navigation in AnQiCMS template and customize the home page text?

As a senior security CMS website operator, I know that high-quality content and excellent user experience are the foundation of website success.With the powerful functions of AnQiCMS, we can not only efficiently manage content, but also provide users with a smooth and intuitive browsing experience through fine-tuned template customization.Today, let's delve deeply into how to implement dynamic breadcrumb navigation in the AnQiCMS template, and flexibly customize the home page text to enhance the usability and search engine friendliness of the website.

2025-11-06

How to use the `categoryList` tag to get and loop through the category list under a specified content model?

As an expert who has been deeply engaged in AnQiCMS content operations for a long time, I know the importance of the category list in website structure and user experience.Make flexible use of the `categoryList` tag, which can help us efficiently organize content, build a clear navigation system, and provide readers with a more accurate content discovery path.Below, I will elaborate on how to use the `categoryList` tag to retrieve and display the category list of a specified content model in a loop.## Use AnQiCMS's `categoryList`

2025-11-06