How to dynamically fetch and display the global settings and contact information of the website using the `system` and `contact` tags?

Calendar 78

In AnQi CMS, the global settings and contact information of the website are the basic information that constitutes the important facade of the website.This information must be displayed accurately to visitors, and more importantly, it should be able to be updated and managed flexibly and conveniently without frequent modification of the template code.systemandcontactThese powerful tags enable website operators to easily implement dynamic acquisition and display of this information.

Flexible application of global website settings:systemTag

Website's global settings, such as website name, Logo, filing number, copyright information, basic URL, etc., are an important part of the brand image and operational standards of the website.This information can be centrally managed in the "Background Settings" -> "Global Settings" of the Anqi CMS backend.systemLabel, easily call these data in the template.

systemThe basic syntax of tags is:{% system 变量名称 with name="字段名称" %}. Among them,变量名称Optional, if set, you can store the value obtained into a variable for subsequent use; if not set, the tag will directly output the corresponding value. Moreover, if your anqi CMS is deployed in a multi-site environment, you can also throughsiteIdParameters are used to specify the global settings for calling a specific site.

Common global settings fields include:

  • SiteName: Site name, usually used for<title>tags or prominent positions on the page.
  • SiteLogo: Website Logo image address, convenient for use in the header or brand display area of the website.
  • SiteIcp: Website registration number, often used in the footer and linked to the MIIT website.
  • SiteCopyright: Copyright information, also commonly used in the footer.
  • BaseUrlThe homepage address of the website, ensure the correctness of all internal links.
  • TemplateUrlThe static file address of the template, used to load CSS, JS and other resources.

The strength of Anqi CMS also lies in its flexibility, if the built-in parameters do not meet your needs, you can add custom parameters at the bottom of the "Global Settings" page.For example, you can add a parameter named "HelpUrl" to store the link to the help center, or the "OnlineService" parameter to store the online customer service code.systemtags, setnameSet the attribute to call with your custom "parameter name".

Let's see an example of using it in a template.systemLabel example:

{# 页面头部调用网站名称和Logo #}
<header>
    <a href="{% system with name="BaseUrl" %}">
        <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
    </a>
    <h1>{% system with name="SiteName" %}</h1>
</header>

{# 页面底部调用备案号和版权信息 #}
<footer>
    <p>
        <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a>
        {% system siteCopyright with name="SiteCopyright" %}{{ siteCopyright|safe }}
    </p>
    {# 调用自定义参数,例如帮助页面的链接 #}
    <p>如需帮助,请访问我们的 <a href="{% system with name="HelpUrl" %}">帮助中心</a>。</p>
</footer>

In this way, no matter how the website name, logo image, or help link changes, you do not need to modify the template file, just update the corresponding settings in the background, ensuring the convenience and consistency of website information updates.

Convenient display of website contact information:contactTag

Effective communication channels are the bridge between the website and the user, and are also the key to building trust.Whether it is a contact phone number, email address, company address, or WeChat, WhatsApp and other social media contact information, it needs to be displayed clearly and accurately.

Related articles

How does the `pagination` tag add and control pagination display for document lists to enhance user experience?

When building a website, as the amount of content grows, the document list page becomes long, which not only affects the page loading speed but also makes it difficult for visitors to find the information they need efficiently.At this time, adding pagination to the document list becomes a key factor in improving user experience.AnQiCMS provides a powerful `pagination` tag, combined with the document list tag `archiveList`, it can easily achieve this goal, making your website content display more professional and more user-friendly.

2025-11-08

How to automatically generate and display the `breadcrumb` tag showing the user's current location in the breadcrumb navigation?

During website browsing, you may often see a line of text links at the top of the page or above the content area, like breadcrumbs, indicating your current position in the website and the path to get here.This is what we commonly call 'Breadcrumb Navigation'.It can not only help users quickly understand their hierarchical structure on the website, avoid getting lost, but also improve the usability of the website and play a positive role in search engine optimization (SEO).For AnQiCMS users, implementing such a feature is very simple and efficient

2025-11-08

How to use the `navList` tag to create and display multi-level navigation menus to optimize user browsing?

In website operation, a clear and intuitive navigation system is a key factor in improving user experience, guiding users to explore content, and even optimizing search engine rankings.A well-designed multi-level navigation menu can help visitors quickly find the information they need, reduce the bounce rate, and effectively enhance the in-depth access to website content.In AnqiCMS, the `navList` tag is the core tool to achieve this goal, allowing us to flexibly build and display hierarchical navigation menus to optimize the user's browsing path.### Understand the `navList` tag

2025-11-08

How to display the `tagList` and `tagDataList` tags showing the website tags and related document list?

In website operation, a tag (Tag) is an extremely useful content organization tool.They can not only help users find the content they are interested in faster, improve the user experience of the website, but also optimize the search engine's crawling and understanding of the website content, and have a positive effect on SEO performance.The AnQi CMS provides website administrators with a powerful and flexible tag management feature, through the `tagList` and `tagDataList` template tags, we can easily display tag lists and documents related to specific tags on the website.###

2025-11-08

How `tdk` tags can dynamically generate and optimize SEO-related Title, Keywords, and Description for each page?

In modern website operation, the importance of Search Engine Optimization (SEO) is self-evident, and the page title (Title), keywords (Keywords), and description (Description), which we commonly refer to as TDK, are the "business card" of the website content on the Search Engine Results Page (SERP).They not only directly affect the click-through rate of the page, but are also key factors for search engines to understand the content of the page and rank it.AnQiCMS (AnQiCMS) fully understands the significance of TDK for SEO, and therefore in the system design

2025-11-08

How to use `if` and `for` tags to implement conditional display and loop display of content in AnQiCMS templates?

In the AnQi CMS template world, flexibly controlling the display of content is the key to creating an engaging website.Whether it is to display different information based on specific conditions or to efficiently display a large amount of data, the `if` and `for` tags are indispensable tools for us.AnQiCMS's template engine adopts the syntax of Django, making these operations intuitive and powerful.### Understanding the `if` tag: Implementing conditional display of content The core function of the `if` tag is to decide whether to display a part of the content based on the conditions you set

2025-11-08

How to use the `stampToDate` tag to format timestamps into a friendly date format to display content publication time?

During the operation of the website, the publication time of the content is an important part of conveying information to visitors.A clear and readable date format not only enhances user experience but also makes the website look more professional and timely.In AnQiCMS, the content publish time is usually stored in the form of a series of numbers (i.e., a timestamp).How can we convert these numbers into the familiar 'year-month-day' or 'month/day time:minute' formats that we are accustomed to?AnQiCMS provides us with a very convenient template tag: `stampToDate`.

2025-11-08

How to define temporary variables with the `with` tag in a template to better control content display logic?

When developing website templates in AnQiCMS, we often need to handle various data and decide the display mode of the content according to these data.With the complexity of website functions, the logic in the templates sometimes becomes difficult to understand and maintain.At this point, mastering some advanced template tag usage is particularly important, and the `with` tag is one of the practical tools that can significantly improve the readability and control of the template.### The `with` tag: A tool for defining temporary variables in templates The `with` tag allows us to define temporary variables within a specific area of the template

2025-11-08