How to call the website logo, filing number, and copyright information to display in the footer in AnQiCMS template?

In website operation, the footer usually carries important content such as brand logo, legal statements, filing information, and copyright statements.This information not only concerns the professional image of the website, but also reflects the trustworthiness and compliance.For friends using AnQiCMS, it is a basic and practical skill to flexibly call these information in templates to achieve dynamic updates.

AnQiCMS is renowned for its concise and efficient architecture and the high performance brought by Go language, it provides an intuitive template tag system, making it very easy to display website content.Next, we will explore how to accurately call the website logo, filing number, and copyright information in the AnQiCMS template and display them in the footer of your website.

One, preparation work: Configure the website basic information in the background

Firstly, we need to ensure that these basic information has been correctly configured in the AnQiCMS backend. This is like preparing a "ID card" and a "business card" for your website.

  1. Log in to the backend: Log in to the AnQiCMS admin interface with your admin account.
  2. Enter global settings: Find the "Background Settings" menu in the left navigation bar, click to enter and select "Global Feature Settings".
  3. Configure key information:
    • Website LOGOHere, you can upload your website logo image. Once uploaded, the system will generate a callable image URL.
    • Record numberIf your website is registered, please enter your ICP filing number here (e.g., Beijing ICP for XXXXXXXXXXX), do not include suffixes such as “-1”.
    • Copyright informationThis is a text box, you can fill in the copyright statement as needed, for example, “© 2023 [Your company name].All Rights Reserved.If you wish to include HTML tags (such as links, bold text) in the copyright information, AnQiCMS also supports this.
    • Website Name: Although not directly used for displaying in the footer, the website name (SiteName) is important for the logo'saltThe attribute is very useful, it helps with SEO and accessibility, it is recommended to fill it out together.

After completing these settings, please make sure to click Save to ensure that your changes have taken effect.

Second, locate the template file: find the footer area

Next, we need to find the template file responsible for rendering the website footer. AnQiCMS template files are usually stored in/templateUnder the directory, each template theme has its own independent folder.

  1. Template directory structure: Your template file (for example, if you are usingdefaulttemplate), will be located in/template/default/such a path.
  2. Footer File: A common practice is to isolate the footer content into a separate code snippet file and then include it in the main template. This file is usually namedpartial/footer.htmlor include it directly inbase.html(Basic layout file) in.
  3. Edit template: You can edit the template in the following two ways:
    • Backend template editingIn AnQiCMS backend, go to 'Template Design' -> 'Template Editing' feature, you can directly modify the template code online.
    • Server file editing: Connect to your server via FTP or SSH and directly modify/template/您的模板目录/below.htmlfile.

Find the location of your footer code, and we can start adding the call tags.

Chapter 3: Call Core Information: Logo, Record Number and Copyright Statement

AnQiCMS uses a tag syntax similar to Django template engine, through{% 标签名 ... %}to execute logic, through{{ 变量名 }}Output content. We mainly use system configuration information forsystem.

1. Calling the website logo

The website logo is the visual symbol of the brand. It is usually placed in the footer, where a smaller logo can be displayed.

<div class="footer-logo">
    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
</div>

here,{% system with name="SiteLogo" %}It will output the URL of the Logo image you uploaded on the backend. At the same time, we recommend filling in thealtproperty.{% system with name="SiteName" %}Even if the image cannot be loaded, it can display the website name, enhancing user experience and SEO friendliness.

2. Display of website filing number

For websites in mainland China, the filing number is essential. It usually needs to be linked to the Ministry of Industry and Information Technology's government service platform.

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

{% system with name="SiteIcp" %}It will output the record number you filled in the background. We have added it here.rel="nofollow"andtarget="_blank"This is an industry convention, which is helpful for SEO and ensures that the record query page opens in a new window after the user clicks.

3. Display of copyright information

Copyright information usually includes the year and copyright statement. AnQiCMS allows you to configure the copyright content from the background and supports dynamic retrieval of the current year.

<div class="footer-copyright">
    <span>&copy; {% now "2006" %} {% system with name="SiteCopyright" %}{{siteCopyright|safe}}</span>
</div>
  • &copy;It is the HTML entity for the copyright symbol.
  • {% now "2006" %}It is a very practical label, it will dynamically display the current year.You just need to write the fixed format string "2006", AnQiCMS will automatically replace it with the current year, so you don't have to update it manually every year.
  • {% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}This part will output the copyright information you filled in the "Global Function Settings" on the backend.siteCopyright|safeof|safeis a filter that indicates to the template engine not to escape HTML content. This means that if the copyright information you enter in the background contains HTML tags (such as<strong>我的公司</strong>They will be correctly parsed and displayed on the front end. If your copyright content is just plain text,|safeit can also be retained.

4. Integration of example code: A complete footer snippet

Integrate all the elements into a typical footer HTML structure, yourfooter.html(or)base.htmlThe footer part of it might look like this:

<footer class="site-footer">
    <div class="container">
        <div class="footer-content">
            <div class="footer-brand">
                <a href="{% system with name="BaseUrl" %}">
                    <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" class="footer-logo-img" />
                </a>
                <p>{% system with name="SiteName" %}</p>
            </div>
            <div class="footer-info">
                <p class="footer-icp-text">
                    <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a>
                </p>
                <p class="footer-copyright-text">
                    &copy; {% now "2006" %} {% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}
                </p>
            </div>
        </div>
    </div>
</footer>

Please note that the above code snippet contains some CSS class names (such assite-footer/container/footer-brandThese are used for structuring and styling the footer content. You can adjust or add these class names based on your website design and actual CSS file.

After you finish modifying the template, save the file, and then visit the front end of your website.If everything goes well, you should see the Logo, filing number, and copyright information neatly displayed in the footer area.If you do not see any changes, please try clearing the system cache of AnQiCMS and your browser cache.

Through the powerful template tag function provided by AnQiCMS, you can easily manage and display the key information of the website, maintaining the professionalism and timeliness of the website.


Frequently Asked Questions (FAQ)

1. Why did the footer Logo, filing number, or copyright information not display after I followed the steps?

There are usually several possible reasons:

  • The background configuration has not been savedPlease log in to the background again and check if the information corresponding to the 'Global Feature Settings' has been filled in and saved correctly.
  • The template file location is incorrect: Please confirm that you are modifying the template file currently in use for the current theme, as well as whether it has been modified in the correct location (for examplepartial/footer.htmlorbase.html).