In website operation, Logo and filing information are not only the core of brand recognition, but also an important part of building user trust and complying with regulations.The Anqi CMS has fully considered these key elements from the beginning of its design, providing intuitive settings and flexible template calling methods, allowing website operators to easily display this information on the front end.
Understanding the template mechanism of the AnQi CMS
Before delving into how to display the Logo and filing information, it will be very helpful to briefly understand the front-end template mechanism of Anqi CMS.The frontend template of Anqi CMS adopts a syntax style similar to Django, which makes content calls and logical control intuitive and powerful.{{ 变量名称 }}Used to output variable values, as well as single curly braces and percentage signs{% 标签名称 %}Used for executing some logical operations or calling specific function tags.
All template files are stored in:templateUnder the directory, usually some common code snippets, such as the header or footer of a website, will be abstracted out and placed inpartialCatalog, orbash.htmldefined in such general files so that they can be reused across different pages. This structure greatly enhances the reusability and maintenance efficiency of the template.
Configure Logo and Record Information
The prerequisite for displaying the website logo and filing information in the front-end template is that these contents have been correctly configured in the Anqi CMS backend. You need to log in to the website backend and navigate to the left menu bar of『Backend Settings』then select『Global Function Settings』.
In this interface, you will find several important configuration items:
- website logoClick the upload button, select the website logo image you have prepared. It is recommended to upload images with moderate size and small file size to ensure the website loading speed.
- Filing NumberIf your website has already completed the filing, please fill in your ICP filing number here, for example, '京ICP备12345678号'.The template design of AnQi CMS usually handles the link jump of the filing number, allowing users to access the Ministry of Industry and Information Technology filing management system after clicking.
Properly configuring this information is the foundation for the front-end template to call and display.
Display the website logo in the front-end template
Once the Logo image is uploaded, the next step is to call and display it in the front-end template. The Anqi CMS provides a feature namedsystemThe powerful tag, specifically used to retrieve the global configuration information of the website. To display the website logo, you can use it in the template.systemlabel combined withSiteLogofield to obtain the image address.
An example of a common Logo display code snippet would look like this:
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
Here,{% system with name="SiteLogo" %}It will be replaced with the complete URL of the Logo image you upload on the backend. At the same time, we strongly recommend addingaltattribute, and using{% system with name="SiteName" %}Get the value of the 'site name' you have set.This not only helps search engines understand the content of the image, improve SEO effectiveness, but also provides a good access experience for visually impaired users.
Display the record information in the front-end template
The record information is usually displayed in the footer of the website, as a sign of legal compliance. You can also usesystemtags to obtain the configured record number.
An example of a typical record information display code snippet may look like this:
<p>
备案号:
<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
{% system with name="SiteIcp" %}
</a>
© {% now "2006" %} {% system with name="SiteName" %}. All Rights Reserved.
</p>
In this example,{% system with name="SiteIcp" %}It will directly output the record number you filled in the background. We wrap it in a<a>Label in, linked to the official query page of the MIIT filing management systemhttps://beian.miit.gov.cn/. To follow SEO practices, the following was added:rel="nofollow"Properties, avoid passing the website weight to external links, at the same timetarget="_blank"Ensure that it opens in a new window after clicking, without affecting the user's browsing experience on the current website. In addition,{% now "2006" %}Labels can dynamically display the current year, combinedSiteNameto form a complete copyright information.
Integrated into the public template file
For consistency of website structure and ease of management, it is recommended to place the calling code of the Logo and record information in the public template file. In the template structure of Anqi CMS, there is usuallybash.htmlOr, inpartialthe directory.header.htmlandfooter.htmlThese files are referenced by various pages of the website.
- Website Logo: Usually placed in
header.htmlat the top area of the website. - Recordation information: Usually placed in
footer.htmlat the website,