In website operation, the logo and filing information are not only the core of brand recognition, but also an important link in establishing user trust and complying with regulations.The AnQi CMS has fully considered these key elements from the beginning, 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 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 front-end template of AnQi CMS adopts a syntax style similar to Django, making content calls and logical controls intuitive and powerful.In the template file, you will mainly encounter two types of markers: double braces{{ 变量名称 }}Used to output variable values, as well as single curly braces and percentage signs{% 标签名称 %}Used to perform some logical operations or call specific function tags.
All template files are stored intemplateUnder the directory, usually some common code snippets, such as the header or footer of a website, will be abstracted out and placed in.partialThe catalog, or inbash.htmldefined in such a universal file to be reused across different pages. This structure greatly enhances the reusability and maintenance efficiency of the template.
Configure Logo and Filing 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 the『Backend Settings』and 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 of moderate size and small file size to ensure the website loads quickly.
- Record numberIf your website has completed the filing, please fill in your ICP filing number here, for example, “Beijing ICP No. 12345678”.The template design of AnQi CMS usually handles the link jump of the filing number, allowing users to click and access the Ministry of Industry and Information Technology filing management system.
Properly configuring this information is the basis 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. Anq CMS provides a name ofsystemThe powerful tag, specifically used to obtain the global configuration information of the website. To display the website logo, you can use it in the template.systemLabel collaborationSiteLogofield to obtain the image address.
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 addingaltthe property, and using{% system with name="SiteName" %}Get the website name you have set as its value. This not only helps search engines understand the content of the image and 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.
A typical display code snippet for a filing information 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 filing number you fill in the background. We wrap it in a<a>Tag within, linked to the official query page of the MIIT filing management systemhttps://beian.miit.gov.cn/. To comply with SEO practices, the following was addedrel="nofollow"Property, 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" %}The label can dynamically display the current year, combinedSiteNameTo form a complete copyright information.
Integrated into the public template file
In order to maintain consistency and management convenience of the website structure, it is recommended to place the calling code of the Logo and record information in a public template file. In the template structure of Anqi CMS, there is usuallybash.htmlorpartialUnder the directoryheader.htmlandfooter.htmlFiles such as these will be referenced by various pages of the website.
- Website Logo: It is usually placed in
header.htmllocated at the top area of the website. - Record information: It is usually placed in
footer.htmllocated at the website's