How to call and display the name, Logo, and other system global configuration information in AnQi CMS template?

Calendar 👁️ 51

As an experienced security CMS website operations person, I am well aware of the importance of website global configuration information, such as website name and logo, for the unified display of brand image and user recognition.In AnQi CMS, these core information is unifiedly managed, and through a concise and efficient template tag mechanism, it allows operators to easily call and display on various pages of the website.

Management of website global configuration information in AnQi CMS

AnQi CMS centralizes the global configuration information of the website in the "Global Function Settings" module of the background.These settings include the website name, Logo image, filing number, copyright information, and various basic addresses of the website (such as the homepage address, mobile version address, etc.).Through this unified interface, you can conveniently modify and manage these key information, ensuring that the website presents a consistent brand image and basic data across different access scenarios.

In addition to the system's preset configuration items, Anqicms also provides the function of custom parameters.This means you can add any custom fields you need according to specific operational requirements, such as the company's social media links, customer service phone numbers, etc.These custom parameters can also be flexibly called through template tags, greatly enhancing the customization capabilities of the template.

Core tag for calling system global configuration information in the template

In the template system of Anqi CMS,systemTags are special tools used to call these global configuration information. It allows you to quickly obtain and display the corresponding values by specifying the name of the configuration item.

Syntax of calling:

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

Among them:

  • 变量名称: is an optional parameter, used to assign the obtained value to a temporary variable for repeated reference in the template or for logical judgment.If not specified, the label will output the corresponding value directly.
  • name="字段名称"The parameter is required, used to specify the name of the configuration item you want to retrieve. These names correspond to the English identifiers of each configuration item in the background "Global Function Settings".

The display of the website name

The website name is the face of the website, usually appearing on the<title>Tags, header navigation, and footer copyright statements. By usingsystemLabel, you can easily display it in the template.

For example, to display the website name in the page title and combine it with the page's own TDK (Title, Description, Keywords) tags, it is usually usedtdkLabels are used to manage them whiletdklabel'sTitleFields can be configured to add or not add the site name suffix.

<title>{% tdk with name="Title" siteName=true %}</title>

This code will intelligently obtain the title of the current page and based onsiteName=trueThe setting, automatically appends the website name configured in the background "Global Feature Settings" to the end of the title.

If you only need to display the website name independently at a certain position on the page (such as the footer), you can call it like this:

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

Or assign it to a variable:

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

Calling and displaying the website logo

The website logo is the core element of brand visual recognition. In Anqi CMS, you can upload Logo images on the backend and throughsystemLabel its path and then embed it in the HTML<img>in the tag.

For example, to display the logo image at the top of the website:

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

This code not only calls the URL of the Logo image, but also cleverly utilizesSiteNameAs an imagealtattribute values, which are crucial for search engine optimization (SEO) and accessibility.BaseUrlMake sure that clicking the logo will correctly jump to the homepage of the website.

Calling other commonly used global configuration information.

In addition to the website name and Logo, there are many other global configuration information that is very useful in the template:

  • Website filing number (SiteIcp): It is usually displayed in the website footer and can link to the record query platform.
    
    <p>
        <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a>
    </p>
    
  • Copyright content (SiteCopyright)Used to display the website copyright statement.
    
    <div>{% system with name="SiteCopyright"|safe %}</div>
    
    Here to use|safeThe filter is because the copyright information may contain HTML entities or tags, to prevent them from being escaped.
  • The home page address (BaseUrl)Used to build an absolute link, ensuring that the home page can be correctly returned on any page.
    
    <a href="{% system with name="BaseUrl" %}">网站首页</a>
    
  • Static file address of the template (TemplateUrl)It is very useful when referring to the CSS, JavaScript, or other static resources built into the template.
    
    <link href="{% system with name="TemplateUrl" %}/css/style.css" rel="stylesheet">
    <script src="{% system with name="TemplateUrl" %}/js/main.js"></script>
    
    It ensures that even after the website is deployed in a subdirectory or CDN, the static resource paths can be correctly resolved.
  • Site language (Language)Used to set the language attribute in HTML tags, which is helpful for international websites and search engines to understand the page language.
    
    <html lang="{% system with name='Language' %}">
    

Call custom global parameters

If you add a custom parameter in the background "Global Feature Settings", such as a parameter named "Hotline" (hotline), you can also usesystemTag to call it:

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

This will directly output the value you have set for the 'Hotline' field in the background.

**Practice and Precautions

  • Uniformity: Unify these global configuration information in the background management, and throughsystemLabel call can ensure that the website maintains high consistency in both visual and content.Once the configuration changes, it only needs to be modified once in the background, and all calls to the tag on the entire site will be automatically updated, avoiding the麻烦 and potential errors of manually modifying the template file.
  • Ease of maintenanceThis calling method makes the template code more concise and readable, separating content from display logic, which improves the maintenance efficiency of the website.
  • SEO-friendlyProperly use the website name as the logo.altText, setting the website language properties, ensuring that the filing information is displayed, and other factors can help improve the website's SEO performance.
  • Caching considerationsIn some cases, especially for static resources such as logo images, if the latest version is not displayed on the front end immediately after the update, it may be necessary to clear the browser cache or CDN cache.For the cache of the Go program itself, the "Update Cache" feature of the Anqi CMS backend can help refresh the data at the system level.
  • Multi-site compatibilityIf you have enabled the multi-site management feature of Anq CMS and need to call the configuration information of a specific site (not the current site),systemTags also supportsiteIdThe parameter allows you to precisely control the source of the data you obtain.

By mastering the use ofsystemTags and the "Global Function Settings" on the backend allow you to efficiently manage and display the core information of the website, providing users with a consistent and professional browsing experience.

Frequently Asked Questions (FAQ)

1. Why did the Logo on the website's front page not update after I modified it in the "Global Function Settings" on the backend?This is usually due to browser cache or CDN cache.You can try clearing the browser cache, or if the website uses a CDN service, you also need to refresh the CDN cache.In addition, the 'Update Cache' feature of the Anqi CMS backend can also help refresh the system-level data cache.

How to add some global information that is not in the system default settings, such as the company's Facebook homepage link?You can find the 'Custom Parameter Settings' area on the 'Global Function Settings' page in the Anqi CMS backend.Click to add custom parameters, fill in the parameter name (such as 'FacebookUrl'), parameter value (your Facebook homepage link), and remarks.After saving, it can be used in the template{% system with name="FacebookUrl" %}Call the Facebook link you have set.

3. Can I call another site's Logo or website name in a template of a site in a multi-site secure CMS environment?Can.systemThe tag supports an optional parametersiteId. If you know the target site ID (which can be viewed in the background "Multi-site Management"), you can call it in the template like this: {% system with name="SiteLogo" siteId="目标站点ID" %}Thus, retrieve and display the Logo of the specified site.

Related articles

How to implement template customization for specific categories or pages, for example `page/about.html`?

As an experienced CMS website operator, I am well aware of the importance of content presentation for user experience and Search Engine Optimization (SEO).AnQiCMS provides a powerful and flexible template customization mechanism, allowing us to create exclusive visual and functional layouts based on different content types or specific page requirements.Today, I will detail how to implement template customization for specific categories or pages in AnQiCMS, such as the needs we often encounter, such as `page/about.html`.

2025-11-06

What are the differences between the 'Folder mode' and 'Flat mode' in the template file organization pattern?

As a senior security CMS website operations personnel, I am well aware of the importance of template file organization methods for website post-maintenance, content release efficiency, and team collaboration.In AnQi CMS, the organization mode of template files is mainly divided into two types: 'folder mode' and 'flattened mode', each with its own characteristics and suitable for different project needs and team habits.Understanding the differences between these two patterns can help us better choose and manage templates.First, let's delve deeper into the **folder organization pattern**.

2025-11-06

How can I customize the templates for 404, 500 error pages, and site shutdown notification pages?

As a senior security CMS website operator, I fully understand the importance of every user touch point, including those unusual pages, in carrying the brand image and user experience.A meticulously customized 404, 500 error pages, and site shutdown notification pages, which not only enhance the professionalism of the website but also provide guidance to users when they encounter problems, effectively reduce the bounce rate, and maintain a good search engine impression. Next, we will discuss in detail how to customize these special pages in Anqi CMS.

2025-11-06

What is the default naming rule for the template files of the model home page, document detail page, and document list page?

As an experienced CMS website operation personnel of an enterprise security, I know that a clear and efficient template naming rule is crucial for the management of website content and user experience.AnQi CMS provides great flexibility in template design and also establishes a set of default naming conventions, which is very helpful for us to quickly build and iterate web pages.In AnQi CMS, all template files are named with a `.html` extension and are uniformly stored in the `/template` folder under the system root directory.

2025-11-06

How to obtain and display the contact information, phone number, email, WeChat, and other contact methods set in the background?

Hello, as an experienced CMS operation person in the security industry, I know that clear and convenient contact information on the website is crucial for user experience and business conversion.Today, let's discuss in detail how to configure contact information in the Anqi CMS backend and display it flexibly and accurately on various positions of the website front-end. Configure website contact information: Back-end operation guide Managing website contact information in AnQi CMS is an intuitive and powerful process.First, we need to enter the background management interface for configuration.

2025-11-06

How to dynamically set and call the SEO title, keywords, and description (TDK) of the current page in the template?

As an experienced CMS website operation personnel in a cybersecurity company, I am well aware that high-quality content and excellent search engine optimization (SEO) are the foundation of a website's success.Among them, the SEO title (Title), keywords (Keywords), and description (Description) of the page, abbreviated as TDK, play a vital role.They are not only the key for search engines to understand the content of a page, but also an important factor in attracting users to click.In Anqi CMS, we have flexible and powerful mechanisms to dynamically set and call these TDK information

2025-11-06

How to display a website navigation menu and support multi-level dropdown navigation?

As an experienced CMS website operation personnel of an enterprise, I know that a well-organized and easy-to-use navigation menu is crucial for the website user experience and content discovery.AnQi CMS provides a powerful and flexible navigation management function, which can help us easily set up the main menu of the website and also support multi-level dropdown navigation to meet the needs of complex website structures. ### Backend Navigation Configuration: Build Menu Structure The setting of the navigation menu in AnQi CMS starts from the backend management interface.

2025-11-06

How to correctly generate and display breadcrumb navigation on a page?

As an experienced CMS website operation person in an enterprise, I am very clear about the importance of breadcrumb navigation in improving user experience and website SEO.It not only helps visitors clearly understand their position on the website, but also guides search engines to better understand the website's hierarchical structure.In AnQi CMS, correctly generating and displaying breadcrumb navigation is a fundamental and important content management task.

2025-11-06