In the operation of the website, the filing number (ICP) and copyright information are essential elements for building user trust and complying with laws and regulations.For websites built using AnQiCMS, whether it be a corporate website or a personal blog, it is crucial to clearly display this information.Luckyly, AnQiCMS provides a very intuitive and flexible way to manage and display this content.

Next, we will together learn how to obtain and display the website filing number and copyright information in the AnQiCMS template.

Back-end settings for website filing number and copyright information

First, you need to enter this basic information in the AnQiCMS background management system.AnQiCMS provides a dedicated settings entry in this aspect, allowing you to easily manage the global configuration of the website.

  1. Log in to the backend:Log in to your AnQiCMS backend management interface.
  2. Navigate to global settings:Find and click on “Backend settingsSelect thenGlobal feature settings.
  3. Enter information:In the "Global feature settings" page, you will see that theRecord numberAndCopyright informationTwo important fields.
    • In theRecord numberEnter your website filing number, for example京ICP备XXXXXXXX号-X.
    • In theCopyright informationEnter your copyright statement, for example本网站所有内容版权归属于 [您的公司名称或个人姓名] 所有. Here you can enter brief text or some basic HTML tags.
  4. Save settings:After filling out, please make sure to click the "Save" button at the bottom of the page to ensure that your settings take effect.

This information will be stored by AnQiCMS once it is set up in the background, for the website front-end template to call.

Obtain and display the filing number and copyright information in the template.

AnQiCMS provides a powerfulsystemThe tag is used to retrieve the various website information from the background "Global Function Settings".By this tag, you can easily display the filing number and copyright information at any location on the website (usually in the footer area).

1. Display the website filing number

The record number usually needs to be linked to the official query page of the China Ministry of Industry and Information Technology's government service platform. This is not only a compliance requirement but also enhances the authority and credibility of the website. You can use it in the template.systemTags combined with HTML's<a>to achieve:

<p>
    <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
        {% system with name="SiteIcp" %}
    </a>
</p>

In this code block:

  • {% system with name="SiteIcp" %}It will directly output the record number you filled in the background.
  • href="https://beian.miit.gov.cn/"Is the official link for the Ministry of Industry and Information Technology record query.
  • rel="nofollow"Tell the search engine not to track this link, it is a common SEO practice to avoid passing the weight of your website to external sites.
  • target="_blank"Make sure that when the record number link is clicked, it will open in a new browser tab, thus keeping the user on your website.

2. Display website copyright information

The display of copyright information is equally simple, usingsystemlabel and specifySiteCopyrightJust do it.

<div>
    {% system copyrightInfo with name="SiteCopyright" %}{{ copyrightInfo }}
</div>

Here is an important detail: If the content you enter in the "Copyright Information" field on the back end includes HTML tags (such as<p>/<strong>/<em>In order to make these tags be parsed and rendered correctly on the front-end and not display the original HTML source code, you need to addsystemthe variable obtained from the tag|safefilter.

For example, if the content of your copyright information is<strong>© 2023 All Rights Reserved.</strong>then it should be used in the template like this:

<div>
    {% system copyrightInfo with name="SiteCopyright" %}{{ copyrightInfo|safe }}
</div>

In addition, to automatically update the copyright year, you can also combine with the provided by AnQiCMSnowThe tag is used to dynamically retrieve the current year, keeping your copyright information always up to date:

<div>
    {% system copyrightInfo with name="SiteCopyright" %}{{ copyrightInfo|safe }} © {% now "2006" %}
</div>

{% now "2006" %}of"2006"It is a special string defined by the Go language for date formatting, representing the retrieval of a four-digit year.

3. Integrate into website footer example

In practice, the filing number and copyright information are usually displayed together at the footer of the website. The following is a common footer code snippet that integrates the filing number, dynamic year, and copyright information.

<footer>
    <div class="container">
        <p>
            <!-- 显示备案号并链接到官方查询平台 -->
            <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
                {% system with name="SiteIcp" %}
            </a>
        </p>
        <p>
            <!-- 显示版权信息和动态年份 -->
            {% system siteCopyright with name="SiteCopyright" %}{{ siteCopyright|safe }} © {% now "2006" %}. All Rights Reserved.
        </p>
    </div>
</footer>

The editing location of the template file

These global website information is usually placed in the public files of the website template, such astemplateUnder the directoryfooter.htmlorbase.html. You can access the “template design”Function, edit these template files online.When making changes, please pay attention to the encoding format of the template file, make sure to save it using UTF-8 encoding to avoid Chinese garbled characters.

provided by AnQiCMSsystemTags, website filing number and copyright information display becomes very simple and efficient. This not only helps your website meet legal requirements, but also conveys a professional and reliable image to visitors.


Frequently Asked Questions (FAQ)

Q1: Why did I fill in the filing number on the back end, but the website front end did not display it?A1: Firstly, make sure you have filled in the record number and successfully saved it in "Backend Settings" -> "Global Function Settings". Secondly, check if the correct template files have been used on your website.{% system with name="SiteIcp" %}Call the label. If the label is misspelled, or the template file has not been saved or refreshed correctly,