When building a professional website, in addition to displaying core content, some basic and important information is also indispensable, such as the website logo, filing number, and copyright statement.These elements not only help enhance the professional image and user trust of the website, but are also crucial for compliance with specific regional regulations (especially the registration requirements of Mainland China).In AnQiCMS, you can easily display this information in website templates with concise template tags.
AnQiCMS uses a template engine syntax similar to Django, making the writing of template files intuitive and efficient. All template files are stored intemplateUnder the directory, to achieve the universal layout of the website, there will usually be a basic layout file (such asbash.html) or a special footer file (for examplepartial/footer.htmlThese files contain the public part of the website, which is an ideal location for placing the logo, filing number, and copyright information. In the template, we mainly use{{变量名}}to output data, while{% 标签 %}It is used to implement logical control or call specific functions.
Display the website logo
The website logo is the visual symbol of the brand, its correct display is crucial for establishing brand recognition.In AnQiCMS backend, you can go to the "Global Feature Settings" page, find the "Website Logo" option, upload and configure your website logo image.
You can use the built-in system to call this Logo in the template.systemLabel. This label is specifically used to retrieve various information of the background global configuration.
The following is an example of the code to call the Logo:
<a href="/">
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
</a>
In this code,{% system with name="SiteLogo" %}The system will dynamically output the URL of the Logo image you upload on the backend. To optimize search engine visibility (SEO) and enhance user experience (when the image cannot be loaded), we recommend that you use<img>Label addaltproperties.{% system with name="SiteName" %}It can be conveniently obtained to use the website name as alternative text for the Logo, ensuring that the image content is friendly to search engines and visually impaired users. Wrapping the Logo in<a>Tags linked to the homepage in the label are also a common practice.
Display the website filing number
For websites operating in mainland China, displaying the ICP record number is a legal requirement.AnQiCMS provides a dedicated field in the "Global Function Settings" on the backend to fill in the website's filing number.
Displaying the filing number in the template also depends on it.systemTags:
<p>
<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
{% system with name="SiteIcp" %}
</a>
</p>
{% system with name="SiteIcp" %}It will directly output the record number you fill in the background. In order to comply with the regulations and provide a user verification method, we usually wrap the record number text in a link to the Ministry of Industry and Information Technology's government service platform (https://beian.miit.gov.cn/)的链接中。Addrel="nofollow"The attribute can tell the search engine not to track this link,target="_blank"and make sure that the link opens in a new window when clicked, to avoid users leaving your website.
Display website copyright information
A clear copyright statement helps protect your website content and show visitors the legality of the website.You can find the 'Copyright Content' field to fill in your copyright statement text in the 'Global Function Settings' page of AnQiCMS background.
Continue using to display this copyright information in the templatesystemTags:
<div>
{% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}
</div>
Here,{% system siteCopyright with name="SiteCopyright" %}The content you will obtain from the background settings. It is worth noting that if your copyright information contains HTML tags (such as, for bold text or adding internal links), you need to use an additional|safeFilter.This filter tells AnQiCMS template engine that this content is safe and can be parsed and output directly as HTML code, rather than being escaped into plain text, thus ensuring the correct display of the content.
Integration and Practice Recommendations
通常,上述所有信息都会集中放置在网站的页脚区域,以确保其在所有页面底部的一致性。一个典型的页脚结构示例可能如下所示,你可以根据自己的模板文件路径(例如template/你的模板名称/partial/footer.html)and design requirements to be adjusted:
<footer class="site-footer">
<div class="container">
<div class="footer-logo">
<a href="/">
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
</a>
</div>
<div class="footer-info">
<p>
<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
{% system with name="SiteIcp" %}
</a>
</p>
<div>
{% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}
</div>
</div>
</div>
</footer>
Through this method, you can flexibly manage these important website information in the background, and ensure their correct presentation on the website front end through concise template tags, thus adding professionalism and trustworthiness to your website.
Common Questions and Answers (FAQ)
Q1: These Logo, filing number and copyright information should be placed in which template file?通常,这些信息属于网站的公共部分,建议放在网站的页脚模板文件(例如
partial/footer.html)或基础布局文件(例如bash.htmlThis approach has the advantage that you only need to edit in one place, and this information will be displayed uniformly at the bottom of all pages, greatly simplifying the management and maintenance work.Q2: What will the template display if I do not fill in this information in the 'Global Feature Settings' in the background?If the corresponding field (such as website logo, filing number, or copyright content) is empty in the backend
systemThe label will not output any content. This means that the corresponding area on the page will be displayed as blank. To optimize the user experience, you can consider adding conditional judgments in the template (such as{% if system.SiteLogo %})to control the display, or provide some default placeholder text to ensure that the page layout is not negatively affected even if the information is missing.Q3: How to ensure that my website Logo is displayed normally and SEO-friendly?To balance the display of Logo and SEO-friendliness, we strongly recommend that in
<img>Labels always includealtattribute, and using{% system with name="SiteName" %}to fill, as shown in the example. In this way, even if the image fails to load, users and search engines can still accessaltUnderstand the meaning and content of this image.For website logos, which are important brand elements, it is usually hoped that search engines can recognize and index them, as they represent your brand.