How to use the `system` tag to display the website name and logo on the page?

Calendar 👁️ 67

Ease the task: How to elegantly display your website name and logo on the AnQiCMS page

It is crucial to display brand identity when operating a website. The website name and logo are not only key elements for visitors to recognize your brand but also the foundation for enhancing the professionalism and trust of the website.AnQiCMS provides a直观而强大的template tag system that allows you to easily call and display these core information on any page of the website. Among them,systemTags are designed specifically to obtain this type of global site configuration.

Next, we will explore how to flexibly usesystemTags, let your website name and Logo shine on the page

Get to knowsystemTag: The 'data butler' of website information

systemThe tag is a very practical built-in tag in the AnQiCMS template engine, its main responsibility is to help us obtain various global configuration information of the website.This information is usually managed in the "Settings" module in the background, such as website name, logo image address, filing number, copyright information, etc. ThroughsystemLabel, you can dynamically display this information on the website front page without hardcoding, which greatly enhances the reusability and maintainability of the template.

UsesystemThe basic syntax of the tag is like this:{% system 变量名称 with name="字段名称" %}. Here, the"变量名称An optional temporary alias, if you define it, you can refer to the data obtained later in the code through this alias. And that is “字段名称This is the most core part, which determines which specific data you want to obtain from the system settings, such asSiteName(Website name) orSiteLogo(Website Logo).

Display your website name

The website name is the most direct manifestation of a brand. In AnQiCMS, you can easily display it in the header, footer, or any place you want visitors to see.

First, you need to find the "Global Function Settings" under the "Settings" menu in the background.Here, you can fill in your 'website name', which is usually your brand name.

In the template file, you can use it like thissystemTag to retrieve and display it:

<!-- 直接输出网站名称 -->
<div>欢迎来到:{% system with name="SiteName" %}</div>

<!-- 或者,先赋值给一个变量,再使用变量输出 -->
{% system siteTitle with name="SiteName" %}
<div>当前网站名称是:{{siteTitle}}</div>

By this simple few lines of code, your website name will be accurately displayed on the page. If you want the website name to be part of the page title (<title>tag) as a part, we usually combinetdklabel'ssiteName=trueAttributes are automatically appended to the website name, which is also very helpful for SEO.

Let your logo shine on stage.

Logo is the visual symbol of a brand, a well-designed logo can attract visitors' attention instantly.In AnQiCMS, displaying your logo on the website is just as simple.

Similar to the website name, you need to find the item "Website Logo" in the "Global Function Settings" under the background "Settings".Upload your logo image file here, the system will automatically store and prepare it for template use.

In your template file, you can display the Logo image in the following way:

<!-- 直接在图片标签中使用system标签获取Logo地址和网站名称作为alt属性 -->
<a href="{% system with name="BaseUrl" %}">
    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
</a>

<!-- 或者,先赋值给变量,再构建图片标签 -->
{% system logoUrl with name="SiteLogo" %}
{% system siteName with name="SiteName" %}
<a href="{% system with name="BaseUrl" %}">
    <img src="{{logoUrl}}" alt="{{siteName}}" />
</a>

Please note that,<img>the tag withaltAn attribute is a very important **practice**. It not only provides text descriptions of the image content, making it more friendly for visually impaired users, but also helps search engines understand the image content, thereby optimizing your website's SEO. Tosystem with name="SiteName"inaltIn the properties, you can ensurealtThe text should always be consistent with your website name, dynamic and convenient. At the same time,href="{% system with name="BaseUrl" %}"make sure that clicking the logo can correctly jump back to the homepage of the website.

UsefulsystemLabel: Get more custom information

In addition to the website name and Logo,systemThe label can also obtain all preset parameters in the background "Global Function Settings", such as "Website filing number" (SiteIcp) “Copyright Content”(SiteCopyright) And more. What's even stronger is that you can also customize additional parameters in the background “Global Function Settings” and pass throughsystemLabels to call them.

For example, you added a parameter named in the background 'Custom settings'.ServiceHotlineThe parameter, and its value is set to "400-888-8888". Then in the template, you can get and display it like this:

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

This flexibility allows you to easily manage and display various dynamic information according to the specific needs of the website.

Comprehensive application examples

In order for you to understandsystemThe actual application of the tag has a more intuitive understanding, here is a simple example of a header area code that combines the display of the website name and Logo:

<header class="main-header">
    <div class="header-container">
        <div class="logo-area">
            <a href="{% system with name="BaseUrl" %}" class="site-logo-link">
                <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" class="site-logo" />
            </a>
        </div>
        <nav class="main-nav">
            <!-- 这里可以放置您的导航菜单,例如使用navList标签 -->
            {% navList navs %}
                <ul>
                    {% for item in navs %}
                        <li><a href="{{ item.Link }}">{{item.Title}}</a></li>
                    {% endfor %}
                </ul>
            {% endnavList %}
        </nav>
        <div class="site-title">
            <h1><a href="{% system with name="BaseUrl" %}">{% system with name="SiteName" %}</a></h1>
        </div>
    </div>
</header>

Remember, the above code snippet mainly focuses on the use of tags, and the actual layout and style still need to be combined with CSS for beautification and responsive adjustments.

Through

Related articles

How to implement the reuse of the common part of AnQiCMS templates (such as headers and footers)?

In AnQiCMS, efficient website content management is inseparable from a flexible and easy-to-maintain template system.You may encounter such a need when creating a template: headers, footers, navigation bars, and other common elements need to appear on every page of the website.If repeating the same code on each page is not only time-consuming and labor-intensive, but also modifying it in the future will cause a domino effect.Luckyly, AnQiCMS leverages the powerful functions of the Django template engine to provide an elegant solution, allowing these common parts to be easily reused.### Core Foundation

2025-11-08

How to flexibly specify independent display templates for single-page content?

AnQiCMS (AnQiCMS) provides excellent flexibility in website content management, especially in the display of single-page content, allowing us to specify completely independent display templates for different single pages.This means that your "About Us" page can have a unique layout and design, distinctly different from pages like "Contact Us" or "Terms of Service", without modifying the overall template structure of the website.This fine-grained control brings great freedom to the content presentation of the website.Many times, certain pages on our website carry important brand image displays

2025-11-08

How to use custom templates to display content for specific documents or categories?

In the daily operation of websites, the flexibility of content display is often the key to whether a website can stand out and meet the diverse needs of users.AnQiCMS (AnQiCMS) fully understands this point and provides powerful custom template features, allowing content to not only be efficiently managed but also presented in a way that conforms to brand characteristics and user habits. ## Unlock the Custom Template Ability of AnQi CMS AnQi CMS, as an enterprise-level content management system, has always focused on the customization needs of content display from the very beginning.

2025-11-08

How to design and deploy a template independently for mobile website?

With the popularity of smartphones, the user experience of mobile websites has become a key factor in determining the success of a website.A well-designed mobile website can not only effectively enhance customer satisfaction, but is also crucial for search engine optimization (SEO).AnQiCMS fully considers this requirement, providing flexible and diverse mobile template solutions, especially supporting independent design and deployment of mobile template, so that your website can show its posture on different devices.### Get to know AnQiCMS's mobile template strategy In AnQiCMS

2025-11-08

How to dynamically display the website filing number and copyright information through the `system` tag in the footer?

When operating a website, the filing number and copyright information are an indispensable part of the website. They are not only the symbol of the legitimate operation of the website but also reflect the respect for original content.For AnQiCMS users, managing this information and displaying it dynamically through the footer is a convenient and efficient operation.AnQiCMS provides an intuitive backend setting and flexible template tags, allowing you to easily meet this requirement, saving the trouble of manually modifying the code on each page.

2025-11-08

How to conveniently display the company's contact phone number and address with the `contact` tag?

In website operation, clearly and conveniently displaying the company's contact information is a key link to enhance user trust and promote business communication.Whether it is to seek cooperation, provide customer support, or simply to let visitors understand the location of the company, contact information plays a vital role.AnQiCMS fully understands this and provides us with an extremely convenient way to manage and display this information through its powerful template tag system.

2025-11-08

How to dynamically generate the page's Title, Keywords, and Description (TDK) to optimize SEO display?

In website operation, Title (title), Keywords (keywords) and Description (description) - abbreviated as TDK, are the core elements of search engine optimization (SEO).They directly affect the display of the website on the search engine results page (SERP), thereby determining the click-through rate and traffic of the website.For a content-rich website, manually setting TDK for each page is neither realistic nor efficient.

2025-11-08

How to use the `navList` tag to build a website navigation menu with secondary dropdown?

Build a clear and easy-to-use website navigation menu is an important link to improve user experience and website professionalism.In AnQi CMS, we can take advantage of the powerful `navList` tag to easily implement a navigation menu with secondary dropdown support, making the website content well-structured and convenient for visitors to browse.Next, we will explore how to use the `navList` tag, from backend configuration to frontend template rendering, step by step to create a complete second-level dropdown navigation.

2025-11-08