How does the `system` tag display the website name, Logo, record number, and copyright information on the AnQiCMS website?

When building and operating a website, the website name, Logo, filing number, and copyright information are important elements that constitute the professional image and legality of the website.They are not only the identity of a website, but also the foundation of user trust.For users of AnQiCMS, the system provides a convenient and efficient way to manage and display these core information, which is through the powerfulsystem.

This article will delve into how to use on AnQiCMS websitesystemLabel, flexibly displays the website name, Logo, filing number and copyright information, helping you easily create a professional and standardized online image.

One, information entry: background settings are fundamental

Before starting to usesystemBefore calling these tags, we need to make sure that this content has been configured in the AnQiCMS backend management system. These core information are usually concentrated in“Background Settings” -> “Global Feature Settings”.

In here, you can find and fill in the following key fields:

  • Website Name (SiteName)This is the brand name of your website, which will be displayed in the browser title bar or in a prominent position on the page.
  • Website Logo (SiteLogo): Upload your brand logo image, which is usually the visual core of the website.
  • Record filing number (SiteIcp): If you operate a website in mainland China and have completed the recordal, please fill in your ICP recordal number here.
  • Copyright Information (SiteCopyright): Usually displayed at the bottom of the website, containing copyright statements, years and other information.

In addition, in the "Global Function Settings", AnQiCMS also allows you to addCustom parameterThis means that if the default provided fields do not meet your specific needs, you can create new parameters, such as a special slogan or promotional phrase, and you can also go throughsystemCall the tag.

Second, front-end call:systemFlexible use of tags

AnQiCMS templates use syntax similar to Django template engine,systemThe label is one of them, it allows developers to easily obtain and display global information configured on the backend in the website front-end template.

systemThe basic usage of tags is:{% system 变量名称 with name="字段名称" %}. Among them,nameThe parameter is crucial, as it specifies the specific information you want to call.

Next, let's see how to call each of the core information mentioned earlier:

1. Website Name (SiteName)

Website name is usually used for the title, header, or any place that needs to identify the brand.

Usage example:

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

{# 将网站名称赋值给变量再使用,常用于组合其他文本 #}
{% system currentSiteName with name="SiteName" %}
<title>{{ currentSiteName }} - 您的专业网站</title>

2. Website Logo (SiteLogo)

The website logo is the visual symbol of the website, usually displayed in image form.

Usage example:

{# 直接输出Logo图片,并结合网站名称作为alt属性,提升SEO和可访问性 #}
<a href="/">
    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" class="site-logo">
</a>

{# 将Logo地址赋值给变量再使用 #}
{% system logoUrl with name="SiteLogo" %}
<style>
    .header-logo {
        background-image: url('{{ logoUrl }}');
    }
</style>

3. Website record number (SiteIcp)

The record number is a certificate of legal operation of the website, which is usually placed at the bottom of the website and linked to the record query platform of the Ministry of Industry and Information Technology.

Usage example:

{# 显示备案号并自动添加工信部链接 #}
<p>
    <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
        {% system with name="SiteIcp" %}
    </a>
</p>

Hererel="nofollow"andtarget="_blank"It is a good practice for SEO and user experience,systemThe label will directly output the record number text you fill in the background.

4. Copyright Information (SiteCopyright)

Copyright information declares the ownership of the website content, and is also common in the footer of websites. Since copyright information may contain HTML tags such as&copy;Symbols, links, etc., should be paid special attention to when used.

Usage example:

{# 将版权信息赋值给变量,并使用 |safe 过滤器防止HTML内容被转义 #}
{% system copyrightInfo with name="SiteCopyright" %}
<div class="footer-copyright">
    {{ copyrightInfo|safe }}
</div>

{# 如果版权信息仅为纯文本,也可直接输出 #}
<p class="copyright-text">版权所有 &copy; {% system with name="SiteCopyright" %}</p>

Please note|safeThe use of filters. If your copyright information includes HTML code during backend configuration (for example,<a href="...">条款</a>or&copy;), using|safeEnsure that these HTML codes are correctly parsed by the browser rather than displayed as plain text.

5. Call custom parameters

If you add a custom parameter in the 'Global Feature Settings' backend, such as one namedSiteSloganyou can call it like this:

Usage example:

{% system mySlogan with name="SiteSlogan" %}
<p class="site-slogan">{{ mySlogan }}</p>

This showssystemThe powerful extensibility of the tag allows you to flexibly display more customized content according to the personalized needs of the website.

Summary

AnQiCMS'systemThe label provides a concise and powerful solution for displaying the core information of the website. By managing these information in the background, and utilizingsystemLabel the template flexibly, you can ensure the consistency of the website brand image, the accuracy of the content, and the convenience of the operation.Whether it is a beginner or an experienced developer, they can easily get started and efficiently complete the configuration and display of basic information on the website.


Frequently Asked Questions (FAQ)

1. Why is my logo image or copyright information not displaying correctly?First, please check if the corresponding field in the AnQiCMS background "Global Function Settings" has been filled in and saved.For the Logo image, confirm that the uploaded image path is correct and accessible.For copyright information, if it contains HTML tags (such as links,&copy;symbols, make sure you are using the template call correctly.|safeFilter, for example{{ copyrightInfo|safe }}To prevent HTML code from being escaped as plain text.

2. If I want to display different website names or Logos on different pages of the website,systemcan the tag do that? systemThe tag is mainly used to call the global settings of the website, which means it will display the same information throughout the website. If you need to display different website names or logos for specific pages, you may need to combine the "Home TDK Settings" tag of AnQiCMS (tdkTo set the page title, or to achieve more fine-grained control through custom page templates and related variables, rather than directly modifyingsystemThe output of tags.

3. Website record numberSiteIcpIs the link generated by the tag fixed? Can I customize the jump link of the filing number? SiteIcpThe label will only output the text you fill in the background for the record number. In the template example, to comply with the norms of domestic websites, we usually manually add a link to the MIIT record query website for it. https://beian.miit.gov.cn/The link. This link is hardcoded in the template, so if you have special record query address requirements, you can directly modify the template in<a>label'shrefProperty.