How to use AnQiCMS built-in tags to retrieve and display system configuration information (such as website name, Logo)?

Calendar 👁️ 75

It is crucial to maintain consistency and ease of updating in website operation and management.AnQiCMS as an efficient content management system fully considers this point, providing powerful built-in tag functions, allowing the global configuration information of the website (such as website name, Logo, filing number, etc.) to be easily obtained and displayed in the front-end template.This means you do not need to hard code, just make a change in one place in the background, and all pages referencing this information will be automatically updated, greatly enhancing the maintainability and operational efficiency of the website.

Understand AnQiCMS system configuration

AnQiCMS concentrates the core configuration information of the website in the background "Background Settings" -> "Global Function Settings" module. Here, you can manage and modify:

  • Website Name: Used for page titles, brand identification, etc.
  • Website Logo: Upload the visual logo image of the website.
  • Website registration number: Information in accordance with legal requirements for filing.
  • Copyright information: Usually displayed in the copyright statement at the bottom of the website page.
  • Home Page AddressThe root domain or home page link of the website.
  • Mobile end addressThe specific address for mobile device access (if enabled).
  • Template static file addressConvenient for referencing CSS, JS, and other static resources.
  • Site Language: The language setting of the current website.
  • And pass through.Custom parameterFunction, you can add any additional configuration items according to the unique needs of your website, such as customer service phone number, company address, specific social media links, etc.

Central management of these configurations makes it very intuitive and efficient to control the global information of the website.

The core usage of system tags ({% system %})

In AnQiCMS template files, we mainly use{% system %}Label to retrieve this system information configured in the background. This label is very flexible and can be used in various ways according to your specific needs.

Basic syntax:

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

This method will directly output the value of the specified field. For example, if you want to display the website name directly on the page, you can do it like this.

Assign to a variable:

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

If you want to reuse some configuration information in multiple places in the template, or need to process the obtained values further (such as concatenating with other text), assigning it to a variable would be a better choice, which can also improve the readability of the template code.

Under a multi-site environmentsiteIdparameters:

If you have enabled the multi-site feature in the AnQiCMS backend and want to retrieve configuration information for other sites in the current template, you can addsiteIdParameter to implement:

{% system with name="SiteName" siteId="2" %}

HeresiteId="2"Refers to the configuration information of the site with ID 2.

Common system configuration items and their calls in the template

Let's take a look at some common system configuration items and how they are passed through the template.{% system %}Tag acquisition and display.

1. Website name (SiteName)

This is the most basic identifier of the website, usually used in browser titles, page top navigation, etc.

  • Example usage:
    
    <title>{% system with name="SiteName" %} - 您的副标题</title>
    
    or assign to a variable:
    
    {% system siteName with name="SiteName" %}
    <h1>欢迎访问 {{ siteName }}</h1>
    

2. Website Logo (SiteLogo)

The website logo is an important part of the brand image. After uploading it on the backend, you can easily reference it in the template.

  • Example usage:
    
    {% system siteName with name="SiteName" %}
    <img src="{% system with name="SiteLogo" %}" alt="{{ siteName }}" class="website-logo" />
    
    Here we will assign the website name tositeNamethe variable as the logo image'saltThe attribute value, helpful for SEO and accessibility.

3. Website filing number (SiteIcp)

Domestic websites need to display the filing number, AnQiCMS makes this operation simple.

  • Example usage:
    
    <p class="icp-info">
        <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
            {% system with name="SiteIcp" %}
        </a>
    </p>
    

4. Copyright information (SiteCopyright)

The website footer often contains copyright statements, and tags can be used to flexibly manage this content.

  • Example usage:“`twig <footer class

Related articles

How does AnQiCMS improve website page loading speed and display experience through static caching?

In the digital age, the loading speed of websites has become a key indicator of user experience and search engine rankings.A website that responds quickly can effectively enhance user satisfaction, reduce the bounce rate, and bring better exposure to the content.AnQiCMS is a content management system focused on high performance and efficiency, and the static caching mechanism plays a crucial role in improving website loading speed.

2025-11-07

How to ensure that AnQiCMS multilingual content switches and displays correctly on the front end?

Today, making a website support multilingual switching and display has become an important link for many enterprises to expand into the international market.AnQiCMS with its flexible architecture provides an efficient way to achieve this goal.This article will deeply explore how to configure and manage multilingual content in AnQiCMS, ensuring that they can be correctly switched and displayed on the front-end website, thus providing a high-quality browsing experience for users of different languages.

2025-11-07

How does AnQiCMS optimize the URL structure through pseudo-static rules to improve search engine results display?

In today's digital marketing environment, a website's URL structure is not just an access address, but also a key element for user experience and search engine optimization (SEO).A clear and meaningful URL can enhance user trust and help search engines better understand the content of the page, thereby improving the display and ranking of the website in search results.AnQiCMS (AnQi Content Management System) fully understands this, and therefore its design in the field of pseudostatic rules provides powerful tools for website operators to optimize URL structure and stand out in search engines.

2025-11-07

How to set up independent display templates for AnQiCMS documents or categories?

In website operation, we often encounter such needs: some documents need a unique display method, the article list of a certain category needs a special layout, or a single page needs a unique design.AnQiCMS knows the importance of this personalized demand and provides flexible template settings to easily set independent display templates for documents, categories, and even single pages.This can not only help you better meet the diversity of content display, but also greatly enhance the user experience and the brand image of the website.Why do we need an independent display template?

2025-11-07

How to include common header and footer code snippets in AnQiCMS templates?

It is crucial to maintain consistent page layout, improve development efficiency, and reduce maintenance costs in website construction and content management.AnQiCMS as an efficient content management system provides a flexible template mechanism, allowing us to easily reuse common code snippets across different pages, such as the website header navigation, footer information, or sidebar, etc.This article will delve into how to elegantly introduce common header and footer code snippets in the AnQiCMS template, helping you better organize template files and improve the overall maintenance efficiency and user experience of the website.

2025-11-07

How does AnQiCMS achieve adaptive display for PC and mobile pages?

In today's era of coexistence of multiple devices, whether a website can present a good user experience on different screen sizes is directly related to its influence and commercial value.Whichever device the user accesses, whether it is a desktop computer, laptop, tablet, or smartphone, they all expect to see a page with clear layout and easy operation.AnQiCMS (AnQiCMS) is well aware of this core requirement and therefore integrated a variety of flexible adaptive display strategies from the outset to ensure that your website can be presented in **status** on any device.AnQi CMS provides three main website display modes

2025-11-07

How to add recommended attributes to AnQiCMS documents to affect the display sorting order on the front page list and detail pages?

In Anqi CMS, the recommended attribute is a very practical feature in content operation.It can help us classify content for marking, which in turn affects how the content is displayed on the front list or detail page, such as highlighting, prioritizing sorting, and even changing their layout style.Understand and make good use of these properties, which will make your website content management more flexible and efficient. ### One, set recommended properties for documents in the background To add recommended properties to a document, you first need to log in to the AnQi CMS backend management interface. 1. Enter the document editing page

2025-11-07

How to automatically extract document content to generate a summary or thumbnail for list display in AnQiCMS?

How to present content in a list page in an attractive way while not requiring a lot of manual work in website operation?This is often a problem that troubles operators. AnQiCMS understands this pain point and provides us with a set of effective solutions through its powerful automation features, especially excelling in the automatic generation and application of document summaries and thumbnails.### Automatically extract document summaries, say goodbye to manual writing Imagine that after each article is published, you need to manually write a concise summary, what a time-consuming task that is

2025-11-07