How to accurately call the system settings (such as website name, Logo) in the template for display?

Calendar 👁️ 85

As users of AnQi CMS, we often need to ensure that the core information of the website, such as the website name, Logo, filing number, etc., is displayed accurately and correctly on each page of the website.This concerns the unity of brand image, and also directly affects user experience and search engine optimization.AnQi CMS, with its efficient architecture based on the Go language and similar Django template engine syntax, makes the invocation of these basic information intuitive and flexible.

Next, let's explore how to easily call and display these important system settings in the Anqi CMS template.

Use cleverlysystemTags, get core website information

The AnQi CMS provides us with a very convenient and powerful tool -systemThe tag is specifically used to obtain various system-level information configured in the background "Global Function Settings".Whether it is the name of the website, Logo address, or filing number, copyright statement, it can be called through it in the template.

UsesystemThe basic format of tags is as follows:{% system 变量名称 with name="字段名称" %}. Among them,"字段名称"The name of the specific system setting item you want to call. If you do not need to assign the obtained value to a variable for subsequent processing, you can also omit it.变量名称Let it output the result directly.

Let's understand its actual application through some specific examples.

Display of the site name (SiteName)

The website name is the core of brand recognition, and it usually appears in prominent positions such as the page title, header, etc.In the AnQi CMS backend, you will find the 'Website Name' item under the 'Global Function Settings'.

In the template, you can call it like this:

<title>{% system with name="SiteName" %} - 您的网站副标题</title>

If you want to store the website name in a variable before using it, you can write it like this:

{% system siteName with name="SiteName" %}
<h1 class="site-title">{{ siteName }}</h1>

In this way, no matter how you modify the website name in the background, the front-end page will automatically update without changing the template code, greatly improving maintenance efficiency.

The call to the website logo (SiteLogo)

The logo is the visual hammer of the website, carrying the brand image. After uploading the logo image in the "Global Function Settings", you can easily refer to its address in the template:

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

Here we not only called the image address of the Logo, but also combined the website name as the image'saltProperties, this is very beneficial for the website's SEO and accessibility. At the same time, we have also called the website's homepage address(BaseUrl)to ensure that clicking on the logo can return to the homepage.

The display of the website filing number (SiteIcp)

For domestic websites, the filing number is an essential piece of information, usually located at the bottom of the website. Anqi CMS also provides a convenient way to call it:

<p>
    <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
        {% system with name="SiteIcp" %}
    </a>
    &copy; {% now "2006" %} 版权所有
</p>

Here we also used{% now "2006" %}This auxiliary label will automatically display the current year, keeping your copyright information up to date.

The call to copyright information (SiteCopyright)

The copyright statement at the bottom of the website often contains some HTML formatted content, such as links or special symbols. To ensure that this content can be correctly parsed by the browser, we need to use|safeFilter:

{% system siteCopyright with name="SiteCopyright" %}
<div class="site-footer-copyright">
    {{ siteCopyright|safe }}
</div>

|safeThe filter tells the template engine that this content is safe, does not require HTML entity encoding, and can be output directly as HTML code.

The use of the template static file address (TemplateUrl)

When developing templates, we often need to refer to CSS stylesheets, JavaScript scripts, images, and other static resources.TemplateUrlThe tag can obtain the root path of the static resources in the current template folder, making the resource reference very flexible, even if the template is changed, it is not necessary to manually modify a large number of paths.

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

This way, your style and script files can be loaded correctly.

Flexible calling of custom system parameters

The strength of AnQi CMS lies in its high customizability.In addition to the preset fields, you can also add custom parameters in the "Global Function Settings" backend, such as the company's WhatsApp contact information, special help page links, etc.

Assuming you have added a custom parameter named 'Customer Service Phone' in the 'Parameter Name' field in the backgroundServicePhoneThe customer service phone number you entered can be called in the template like this:

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

This allows you to extend the display information of the website front-end according to your business requirements without modifying the core code.

Summary

Of Security CMSsystemTags provide a graceful way to centrally manage and call the basic information of the website.With it, you can easily display the website name, Logo, filing number, copyright information, and so on in the template, and it can also flexibly expand custom parameters to meet various personalized needs.Mastering these skills, you will be able to manage your Anqi CMS website more efficiently and flexibly, ensuring the accuracy and consistency of information display.

Frequently Asked Questions (FAQ)

1. I added a custom parameter in the background "Global Function Settings", but why can't it be called in the template?

Please check what you aresystemin the tag usednameIs the attribute consistent with the "parameter name" set in the background. For example, if the parameter name set in the background isServicePhone, then the template should use{% system with name="ServicePhone" %}Please note that the case is important as tags are usually case-sensitive.Finally, after modifying the background settings, it is recommended to manually click the 'Update Cache' button at the top of the background to ensure that the latest configuration is correctly read by the front-end.

2. Why doesn't my website's logo display after calling it, what could be the reason?

There are some common reasons:

  • Logo not uploaded or path error:Please log in to the "Global Function Settings" page on the backend and confirm whether the Logo image has been successfully uploaded and the Logo address looks correct.
  • File permission issue: Make sure the Logo image is located on your server,/uploadsthe directory and its subdirectories have the correct read and write permissions.
  • Cache problem:Clear browser cache and security CMS backend cache (by clicking the "Update Cache" button), sometimes old cache can cause images not to display.
  • Network issue: Check if the image address can be accessed directly through the browser, and confirm that the server firewall or CDN configuration is correct.

3. I have multiple AnQi CMS sites, can I call the system settings of other sites in one template?

Yes.systemThe tag supports onesiteIdThe parameter is used to specify which site's system settings to retrieve. If you create multiple sites through the "Multi-site Management" backend, each site will have a uniqueID. You can call it like this in the template:{% system siteName with name="SiteName" siteId="2" %}{{siteName}}here,siteId="2"It represents the website name of the site with ID 2. Please replace it with your actual site ID.

Related articles

What flexibility does the Django template engine syntax provide in content display?

AnQi CMS as an efficient and flexible content management system, its flexibility in content display is largely due to its support for Django template engine syntax.For us content operators and website administrators, this means we do not need to deeply learn complex programming languages, but can freely organize and present website content as if we were building with blocks.Then, what flexibility does the Django template engine syntax bring to our content display?### One, direct and efficient data call and display First

2025-11-08

How can AnQiCMS improve the loading and display speed of website content through static caching?

In today's fast-paced digital world, website loading speed is no longer just a bonus, it has become a key determinant of user experience and search engine rankings.When visitors click on your website link, they expect the content to appear instantly.Any delay can lead to customer loss. Fortunately, content management systems like AnQiCMS have already regarded website speed optimization as one of their core strengths, especially through their powerful static caching mechanism.Why is website speed so important?\n\nImagine you visit a website

2025-11-08

How to use the scheduled publishing feature to achieve automated online display of content?

In today's fast-paced digital world, the efficiency and regularity of content operation are becoming increasingly important.Whether it is to maintain a corporate website, manage a self-media, or manage multiple content sites, it cannot do without high-quality and timely updated content.However, manually posting content often means precise timing is required, especially when the content release time is in the late night or on holidays, which undoubtedly brings considerable pressure to the operation staff.Fortunately, AnQiCMS provides a very practical feature——**timed release**, which can help us easily achieve the automation of content going online

2025-11-08

How can AnQi CMS's traffic statistics feature help me optimize my content display strategy?

## How to cleverly use Anqi CMS traffic statistics to take content strategy to a new level As a content operator, we invest a lot of effort in creating and publishing content, but how do they perform after the content is published?Did we truly reach the target users? What content is popular, and what is ignored?These issues often困扰 us. If we only stay at the "publishing" stage and ignore the subsequent effect evaluation and strategy adjustment, then our efforts may be greatly reduced.Luckyly, AnQi CMS provides us with powerful traffic statistics functions

2025-11-08

How to correctly obtain and display contact information in the template?

In website operation, clearly and effectively displaying contact information is crucial for user experience and business conversion.AnQiCMS (AnQiCMS) provides us with flexible and powerful features, allowing us to easily retrieve and display these key information in templates. --- ### **Backend Configuration: Source of Contact Information** All website contact information is centralized in the backend for unified management in AnQi CMS.This means that whether you need to modify the contact phone number, email, or add new social media links, you do not need to touch any code, just perform simple operations in the background

2025-11-08

How to dynamically generate and display the page's SEO title, keywords, and description (TDK)?

Search engine optimization (SEO) is a key factor for the success of a website, and the page title (Title), keywords (Keywords), and description (Description), which we often call TDK, are also the core elements for search engines to understand and display your web content.They not only affect the willingness of users to click on search results, but also directly relate to the ranking performance of the website in search engines.AnQiCMS is a corporate-level content management system that has fully considered SEO friendliness from the outset

2025-11-08

How to build a multi-level navigation menu in AnQiCMS to optimize the display of the website structure?

The website's navigation system, like a city map, guides visitors to explore every corner of your website. A clear, intuitive multi-level navigation not only greatly enhances the user experience but is also an indispensable part of Search Engine Optimization (SEO), helping search engines better understand the structure of the website and thereby improve content inclusion and ranking.In AnQiCMS, building a set of efficient and beautiful multi-level navigation menus is actually simpler than you imagine. It provides flexible backend configuration and powerful template tags, allowing you to easily implement it.Build Navigation Basics

2025-11-08

How can the breadcrumb navigation of the current position be displayed on the page?

In website navigation, Breadcrumb navigation is a very practical auxiliary tool.It clearly shows the user's current position on the website, provides a convenient return path, thereby significantly improving the user experience, and also has a positive effect on search engine optimization (SEO), helping search engines understand the structural hierarchy of the website.AnQiCMS has fully considered this point and provided a simple and powerful way to display breadcrumb navigation on the page.With built-in template tags, even without complex programming knowledge, this feature can be easily implemented.###

2025-11-08