When building a professional website, 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 record-keeping requirements of Mainland China).In AnQiCMS (AnQiCMS), you can easily display this information in website templates using 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 common layout of the website, there is usually a basic layout file (such asbash.html) or a dedicated footer file (such aspartial/footer.htmlThese files contain the public part of the website, which is an ideal place to place 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.
Show website logo
The website logo is the visual symbol of the brand, its correct display is crucial for establishing brand recognition.In the AnQiCMS backend, you can go to the 'Global Function Settings' page, find the 'Website Logo' option, upload and configure your website logo image.
To call this Logo in the template, you can use the built-in system.systemLabel. This tag is specifically used to obtain various configuration information of the background.
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 block,{% system with name="SiteLogo" %}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<img>tagsaltProperty.{% system with name="SiteName" %}It can be conveniently obtained to obtain the website name as the alternative text for the Logo, ensuring that the image content is friendly to search engines and visually impaired users. Wrap the Logo in<a>Linking to the homepage within the tag is also a common practice.
Display the website's filing number
It is a legal requirement for websites operating in mainland China to display the ICP filing number.AnQiCMS provides a dedicated field for entering the website filing number in the "Global Function Settings" on the back end.
Displaying the filing number in the template also depends on itsystemTags:
<p>
<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
{% system with name="SiteIcp" %}
</a>
</p>
{% system with name="SiteIcp" %}The registration number you entered will be output directly. To comply with the specifications and provide a user verification method, we usually wrap the registration number text in a link to the Ministry of Industry and Information Technology government service platform (https://beian.miit.gov.cn/Add a link in therel="nofollow"attribute can tell the search engine not to track this link, buttarget="_blank"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.In the AnQiCMS backend's 'Global Function Settings' page, you can find the 'Copyright Content' field to fill in your copyright statement text.
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" %}Will retrieve the copyright content you set in the background. It is worth noting that if your copyright information contains HTML tags (such as those used for bold text or adding internal links), you need to use an additional|safeThe filter informs the AnQiCMS template engine that this content is safe and can be directly parsed and output as HTML code, rather than being escaped as plain text, thereby ensuring the correct display of the content.
Integration and practical suggestions
Generally, all the aforementioned information is usually placed in the footer area of the website to ensure consistency at the bottom of all pages. An example of a typical footer structure may look like this, you can use your own template file path, for exampletemplate/你的模板名称/partial/footer.htmlAdjust the design requirements:
<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>
In this way, 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, thereby adding professionalism and credibility to your website.
Frequently Asked Questions (FAQ)
Q1: These Logo, filing number, and copyright information should be placed in which template file?Generally, this information belongs to the public part of the website and is recommended to be placed in the footer template file (such as
partial/footer.html) or the basic layout file (such asbash.htmlThe benefit is that you only need to edit it in one place, and this information can be displayed uniformly at the bottom of all pages, greatly simplifying management and maintenance work.Q2: What will the template display if I do not fill in this information in the "Global Function Settings" in the background?If the corresponding fields in the background (such as website Logo, filing number, or copyright content) are empty, the template will call
systemWhen a tag is not output, it means that the corresponding area on the page will be blank. To optimize the user experience, you can consider adding conditional judgments in the template (such as{% if system.SiteLogo %}To control display, or provide some default placeholder text to ensure that the page layout is not adversely affected even if information is missing.Q3: How to ensure that my website's Logo is displayed normally and is friendly to search engines?To balance the display of the Logo and SEO friendliness, we strongly recommend that you
<img>Always include in the tagaltthe property, and using{% system with name="SiteName" %}to fill in, as shown in the example. In this way, even if the image fails to load, users and search engines can also throughaltUnderstand the meaning and content of this image. For a website logo, an important brand element, it is usually hoped that search engines can recognize and index it because it represents your brand.