How to get and display the website name and logo in AnQiCMS template?

Calendar 👁️ 58

As an experienced CMS website operation person of an enterprise, I know the importance of effectively displaying brand information in templates for user experience and brand recognition.The following article will provide a detailed guide on how to obtain and display the website name and logo in the AnQiCMS template.

How to obtain and display the website name and Logo in AnQiCMS template guide

It is a key element to clearly display the brand identity in the operation of any website, attracting users and building trust.The website's name and logo are the core visual elements of the brand and need to be presented accurately and optimized on all pages of the website.AnQiCMS provides a直观且灵活的 mechanism, allowing operation personnel to easily obtain and display these important website information in templates, thereby enhancing the brand image and user experience.

Backend configuration of website name and Logo

First, we need to understand how the core information such as website name and Logo is configured and managed in the AnQiCMS backend.You can find the 'Global Function Settings' option under the 'Background Settings' menu in the Anqi CMS backend.On this page, you can clearly see the "Website Name" field, which is used to define the brand name or company name of your website;Next is the "Website Logo" field, which allows you to upload and set the logo image for your website.Ensure that this critical information is set accurately in the background, which is the basic premise for its correct and consistent display in the front-end template.

AnQiCMS Template Syntax Overview

The AnQiCMS template system follows the syntax rules similar to the Django template engine, which allows template creators to handle content in a structured manner. Variable output in template files is usually done using double curly braces{{变量}}The task is to translate the content of the "value" field into English While various logical judgments, loop operations, and data acquisition functions are wrapped in single curly braces and percent signs{% 标签 %}To implement. To obtain system-level configuration information for the website in the template, we will mainly use built-insystem.

Display website name

To display your website name at any location in the website template, you can usesystemlabel and specifyname="SiteName"Parameters. This tag will directly return the website name you have preset in the background "Global Function Settings".

Here is an example of the template code to retrieve and directly output the website name.

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

To improve the reusability and readability of template code, you can also assign the obtained website name to a custom variable. This approach is particularly useful when the website name needs to be referenced multiple times on the same template page:

{% system siteNameVar with name="SiteName" %}
<p>我们是 {{siteNameVar}},致力于提供优质服务。</p>
<p>了解更多关于 {{siteNameVar}} 的信息。</p>

Display website Logo

The method to display the website Logo is similar to displaying the website name, which is also usingsystemtags, but this time you need tonamethe parameter toSiteLogo. This tag executes and directly outputs the URL address of the Logo image you uploaded and configured on the backend.

As the Logo is essentially an image, we usually embed it into the HTML's<img>In the tag. It is strongly recommended to optimize the user experience, improve website accessibility (Accessibility) and search engine optimization (SEO)<img>tagsaltProperty.altThe value is usually set to the website name, which not only provides alternative text when images fail to load but also helps search engines understand the content of the image, playing a positive role in website ranking.

The specific code example for displaying the website logo in the template is as follows:

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

Similar to the website name, you can also assign the URL of the Logo to a variable, and then use the website name variable together with it, making the code more flexible and maintainable. For example, wrap it in a link to make it convenient for users to click on the Logo and return to the homepage of the website:

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

Consideration under a multi-site environment

The strength of AnQiCMS lies in its support for multi-site management. If you are running multiple independent websites under an AnQiCMS instance, and in the template of a specific site, you need to retrieve the name or Logo of a website that is not the current site,systemTags providedsiteIdParameters to meet this requirement. By specifying the database ID of the corresponding site, you can accurately obtain the required information across sites.For example, to get the website name of a site with ID 2, you can use:{% system with name="SiteName" siteId="2" %}.

**Practical Recommendations and Optimization**

When displaying the website name and Logo in the AnQiCMS template, in addition to correctly obtaining and outputting data, some**practices should also be considered to further improve website performance and user experience.

For the Logo image, in addition to setting the necessaryaltAttribute, you should also pay attention to its file size and loading speed. Optimizing images can significantly reduce page loading time, especially for mobile device users.At the same time, through external CSS stylesheets, you can flexibly control the size, position, and responsive behavior of the Logo, ensuring a perfect display on different screen sizes and devices.

In addition, the website name is in the page title (<title>Labels play a crucial role, directly affecting the display of websites on search engine result pages (SERP). Combinedtdklabel'sname="Title"attributes andsiteName=trueThe parameter can help you automatically append the website name to the page title, which not only strengthens brand recognition but also is an effective SEO strategy, helping to improve the visibility and click-through rate of the website.


Frequently Asked Questions (FAQ)

Question: How to change the website name and Logo in the AnQiCMS backend?You can find the 'Background Settings' menu in the left navigation bar of the AnQiCMS admin interface, and then click to enter the 'Global Function Settings' page.On this page, you can directly modify the content of the 'Website Name' text box to update the website name, and click the upload button next to the 'Website Logo' field to change the logo image.After the modification is completed, please be sure to click the save button at the bottom of the page to ensure that your changes can be successfully applied.

Question: I uploaded a new logo, but it did not display the update on the website front-end. What is the reason for this?If the logo or website name is updated on the back-end but the changes are not immediately reflected on the front-end page, this is usually due to browser caching or internal caching of the AnQiCMS system.You can try clearing the cache and cookies of the current browser and then refreshing the page.In addition, in the AnQiCMS backend, you can also find and click the "Update Cache" feature to clear the cache at the system level, which helps to force the website to load the latest data.If the problem still exists, please check if the image has been successfully uploaded and the file path is correct.

Question: Can I use different Logos on different pages of the website instead of a unified Logo? systemThe tag defaults to retrieving the website configured in the "Global Feature Settings"}

Related articles

What template engine syntax does AnQiCMS template support, and what are the formats of its variables and tags?

As an experienced AnQiCMS website operations personnel, I am well aware of the importance of an efficient and easy-to-use template system for website content management and user experience.AnQi CMS does an excellent job in this aspect, providing a powerful and flexible template mechanism that makes content presentation intuitive and highly customizable.Now, let's delve deeper into the syntax, variables, and tag formats supported by the AnQiCMS template.

2025-11-06

How to use a custom template for specific documents, categories, or single pages in AnQiCMS?

As an experienced AnQiCMS (AnQiCMS) website operations personnel, I am well aware of the importance of content in attracting and retaining users, and the flexible template system is the key to achieving personalized content display.AnQiCMS provides powerful custom template features, allowing operation personnel to create unique page layouts and styles according to different content needs.### AnQiCMS Template Working Principle Overview AnQiCMS template system is based on Go language and adopts syntax similar to Django template engine, files are in the form of `

2025-11-06

What is the default naming rule for single page detail page templates in AnQiCMS?

As an experienced CMS website operator for an enterprise, I am well aware that the exquisite presentation of content lies in the flexible application of templates.AnQiCMS as an efficient and customizable content management system provides us with powerful tools to shape every detail of the website, including the layout and style of single-page detail pages.Understanding the template naming rules is the foundation for efficiently managing and optimizing website content.

2025-11-06

How to create default templates for the model home page, document detail page, and list page of AnQiCMS?

As an experienced security CMS website operator, I am well aware of the importance of a clear and efficient template system for website content management.AnQiCMS provides a highly flexible and customizable template system that allows us to easily create personalized page layouts based on different business needs.Mastering the creation method of its default template is the foundation for efficient operation and content optimization.This article will detail how to create default templates for the model homepage, document detail page, and list page of AnQiCMS, with instructions on the use of key tags

2025-11-06

How to call the contact information set in the background of AnQiCMS template?

As an experienced senior personnel proficient in AnQi CMS content operation, I am well aware of the importance of efficient website information management in attracting and retaining users.Especially contact information such as this basic yet crucial information, its unified management and flexible access are the foundation for improving operational efficiency and ensuring the accuracy of information.Below, I will introduce how to call the contact information set in the background of the AnQiCMS template.

2025-11-06

How to dynamically set the content of the `<title>`, `<meta keywords>`, and `<meta description>` tags for AnQiCMS pages?

As an experienced security CMS website operator, I know that website SEO optimization is the core work to attract and retain users, and to enhance the visibility of the website.It is crucial to accurately set the <title>, <meta keywords>, and <meta description> tags for each page (collectively known as TDK, i.e., Title, Description, Keywords).The AnQi CMS was designed with SEO-friendliness in mind from the outset

2025-11-06

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

Hello, I am the familiar Anqi CMS website operation veteran that you know.Navigation menus are of great importance in daily website maintenance and content optimization, as they are not only guides for users to browse the website but also crucial for search engines to understand the website structure.Today, let's delve into how to build a flexible and efficient multi-level navigation menu in the AnQiCMS template.

2025-11-06

How to generate breadcrumb navigation path in AnQiCMS templates?

As an experienced CMS website operation personnel, I am well aware of the importance of a clear and efficient website navigation system for user experience and search engine optimization (SEO).Breadcrumbs navigation is an important part of website auxiliary navigation, which can intuitively show the user's position on the website and provide a convenient return path.The AnQi CMS with its flexible template engine makes it easy and efficient to generate breadcrumb navigation in website templates.

2025-11-06