How to display the global settings content such as copyright information and filing number on the front-end page?

The website footer usually carries important content such as copyright information, filing number, etc., which not only relates to the professional image of the website, but is also the cornerstone of legal requirements and user trust.In AnQiCMS, these global settings can be configured and called very conveniently, making your website information clear at a glance.

Next, we will learn in detail how to configure and display these key information in AnQiCMS.

Step 1: Configure global information in the background

First, you need to log in to your AnQiCMS backend, find the left navigation bar's , and then click .Here, you will see a series of customizable site global information.

In these settings, items directly related to copyright information and filing number include:

  • Website Name: It is usually used to display the brand name or part of the website title.
  • website logo:You can upload your website icon, which will be called to display in the template.
  • Filing Number:If your website has passed the Ministry of Industry and Information Technology (MIIT) recordal, please enter your recordal number here. Note that only the recordal number itself is required, without suffixes such as “-1”.
  • Copyright Information©2023 Your Company Name. All Rights Reserved.”,或者其他您希望展示的版权声明。

Additionally, if you have other information that needs to be displayed uniformly across the entire site, such as a specific slogan, contact information for a special project, or a link to a specific page, you can use the [Custom Settings Parameter] feature.Here, you can add new parameter items, set a [parameter name] (it is recommended to use English letters, which the system will automatically convert to camel case naming), and enter the corresponding [parameter value], as well as a [note] for future management.The calling method of these custom parameters is similar to built-in parameters, greatly enhancing the flexibility of the system.

Complete the information entry and click Save to ensure your configuration takes effect.

Step 2: Call the global settings content on the front page.

Configure the backend information first, and then the next step is to present them on the front page of the website. Typically, these global information is placed in the footer of the website, or a general header file, or even likebash.htmlThis public code snippet.

The AnQiCMS template system provides powerful.systemLabels can be used to get these globally set content in the background. You can call them in your template file using the following methods:

  1. Display the website nameThe website name usually appears in the page title (<title>Tag in the footer or brand logo location.

    <title>{% system with name="SiteName" %}</title>
    <!-- 或者在页面内容中 -->
    <span>欢迎访问 {% system with name="SiteName" %}</span>
    
  2. Display the website logo.The call of the website logo usually combines with<img>Tags, and for SEO optimization, it is recommended to set simultaneously.altThe attribute is for the website name.

    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
    
  3. Display the filing numberThe record number usually needs to link to the MIIT record management system website.

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

    Here,target="_blank"Means to open the link in a new window,rel="nofollow"Then tell the search engine not to track this link, which is a common SEO practice.

  4. It displays copyright information.The copyright information you fill in the background can be called in the following ways.

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

    Special reminder:If your copyright information contains HTML tags (such as<a>links or<b>bold, etc.), in order to ensure that these tags are correctly parsed and not displayed as text, you need to use|safefilter. For example:

    {% system siteCopyright with name="SiteCopyright" %}
    {{ siteCopyright|safe }}
    

    In copyright information, we often need to display the current year. AnQiCMS provides anowtag to get the current time, you can combine it to display the year:

    <div>版权所有 &copy; {% now "2006" %} {% system with name="SiteName" %}. All Rights Reserved.</div>
    

    Here are the"2006"Is a special string used for formatting years in Go language.

  5. Displays custom parametersThe calling method is similar to that of built-in parameters for the parameters you customize in the background, just need tonameProperty is set to your custom [parameter name] (note the camelCase naming convention). For example, if you have a custom parameter named 'HelpUrl':

    {% system helpUrl with name="HelpUrl" %}
    <p>需要帮助?请访问我们的 <a href="{{helpUrl}}">帮助中心</a>。</p>
    

Tips and precautions

  • Selection of template file:English, the footer content is usually placed in a file namedfooter.htmlThe template file. If your template uses a publicbash.htmlfile to include the header and footer, then these call codes will also be placed there.
  • Clear cache:After modifying the template file or backend settings, if the front-end page does not update immediately, please try clicking the 'Update Cache' button in the upper right corner of the backend navigation bar, clear the system cache, and then refresh the page.
  • Test compatibilityAfter completing the changes, it is recommended that you test on different browsers and devices to ensure that all information is displayed correctly, and that the layout has not been affected.

Through the above simple configuration and template code, you can easily display professional, compliant copyright information and filing number and other global settings on the website built by AnQiCMS.The flexibility of AnQiCMS makes these operations easily accessible.


Common Questions (FAQ)

  1. Ask: Why did I add the copyright information I set in the background?<b>tags, but they are displayed directly on the front page?<b>tags without bold effects? AnswerThis is because AnQiCMS template engine defaults to escaping the output HTML tags for security reasons to avoid XSS attacks. If the copyright information contains HTML tags and you want them to be effective, you need to use|safeFilter. For example, to{% system with name="SiteCopyright" %}Change to{% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}English translation: , such that the template engine will treat it as safe content and parse HTML tags normally.

  2. 问:I modified the "website name" or "record number" on the back end, but the front page does not seem to change after refreshing. What's the matter? AnswerThis is likely due to system cache.AnQiCMS to improve the website access speed, will cache some data.When you modify the background settings but the front-end is not updated, you can try clicking the [Update Cache] button on the right side of the background navigation bar to clear the system cache.The content should be refreshed on the front page after the cleaning is completed, and you should be able to see the latest content then.

  3. 问:In addition to copyright and备案号, how should I operate if I want to display a custom social media link at the bottom of my website? Answer:You can use the [Global Function Settings] under [Custom Setting Parameters] feature. For example, you can add a parameter namedFacebookLinkThe custom parameter, set theto your Facebook homepage URL. Then in your template file (such asfooter.html), you can{% system facebookLink with name="FacebookLink" %}{{facebookLink}}This way to call and generate the corresponding link, for example:<a href="{% system facebookLink with name="FacebookLink" %}{{facebookLink}}" target="_blank">Facebook</a>.