When building and operating a website, the website's logo and copyright information are an important part of building the brand image, establishing user trust, and fulfilling legal statements.For AnQiCMS users, managing and displaying this information is very intuitive and flexible.
一、In AnQiCMS backend set the website LOGO and copyright information
AnQiCMS centrally manages the global configuration of the website, allowing you to easily set up various basic information.You need to go to the 'Global Function Settings' page in the background to set the website logo and copyright.
- Visit the backend settings:Firstly, log in to your AnQiCMS back-end management interface. Find and click on the menu item in the left-hand navigation menu,Backend settings" option, then select "[en] Global function settings.
- Configure key informationIn this page, you will see a series of settings related to the global features of the website. Among them, there are several that we need to pay special attention to:
- website logoHere you are allowed to upload your website brand LOGO image.The system will store the image path after successful upload, for front-end template to call.A clear, appropriately sized logo can effectively enhance the professionalism of a website.
- Copyright InformationThis field is usually used to fill in your website copyright statement, for example “© 2023 Your Company Name.”}] All Rights Reserved.”。It is worth noting that AnQiCMS takes into account that copyright information may contain HTML tags (such as bold, links, etc.), and therefore provides the corresponding handling methods when calling the template.
- Website Name:Although it is not a direct LOGO or copyright information, the website name is often used as an image LOGO of
alttext or displayed together with copyright information, enhancing SEO effects and user experience. - Filing NumberIf your website is registered, you can fill in the registration number here. This is usually displayed next to the copyright information at the bottom of the website and will link to the Ministry of Industry and Information Technology's registration query website.
Complete the information entry and upload, and remember to click the save button to ensure that all changes have taken effect.
Two, display the website logo and copyright information in the AnQiCMS template
After the background configuration is completed, the next step is how to display this information on the front page of the website.AnQiCMS's template system adopts the syntax similar to Django template engine, which can easily obtain background data through concise tags.
1. Show website LOGO
To display the website LOGO you uploaded on the backend on the page, you can usesystemTag to gainSiteLogoThe value of the field. At the same time, in order to improve the accessibility and SEO-friendliness of the image, it is usually combined withSiteNamefield as the image'saltproperties.
You can find it in the template file (for example, usually in the public'sheader.html(auto)这样编写代码:
<a href="/">
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" class="site-logo" />
</a>
{% system with name="SiteLogo" %}(auto)这个标签会直接输出您在后台“全局功能设置”中上传的网站LOGO图片的URL地址。{% system with name="SiteName" %}This tag will output the website name you set as alternative text for the LOGO imagealtProperty), when the image cannot be displayed, or it is very helpful for SEO and screen readers.class="site-logo"This is an example of a CSS class name, you can customize it according to your template style to control the size, position, and other visual expressions of the LOGO.
2. Display copyright information and filing number
Copyright information is usually placed at the footer of the website. In addition to displaying the "Copyright Information" field content, many websites will also dynamically display the current year and link to the filing number.
You can find the footer part of the template file (for example, usually in the public section)footer.html(auto)这样编写代码:
<footer class="site-footer">
<p>
{% system siteCopyright with name="SiteCopyright" %}{{ siteCopyright|safe }}
</p>
<p>
© {% now "2006" %}
{%- if siteIcp := system with name="SiteIcp" -%}
<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">{{ siteIcp }}</a>
{%- endif -%}
</p>
</footer>
{% system siteCopyright with name="SiteCopyright" %}This tag will get the copyright statement text you filled in the "Global Function Settings" in the background. We will assign the content tositeCopyrighta variable.{{ siteCopyright|safe }}:This is the key!If your copyright information contains HTML tags (for example, if you used them while filling in the back end)<strong>or<a>auto"), so that these HTML tags are parsed correctly on the page instead of being displayed as plain text, you need to use|safeFilter. It tells AnQiCMS and the browser that this content is safe and can be rendered directly as HTML.© {% now "2006" %}:©is the copyright symbol, and{% now "2006" %}This label is very useful, it will automatically output the current year. This way, you don't need to manually update the copyright year every year, the system will keep it up to date automatically.{%- if siteIcp := system with name="SiteIcp" -%}This is a conditional judgment statement. It first attempts to getSiteIcpthe value of (record number) and assigns it tositeIcpthe variable. IfsiteIcpif it exists (i.e., you have filled in the record number in the background), then executeifContent within the statement block.<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">{{ siteIcp }}</a>In the case of a condition being met, this line of code will create a link to the Ministry of Industry and Information Technology's record query website, using the record number you set as the link text.target="_blank"Open the link in a new window,rel="nofollow"Then tell the search engine not to track this link, which is a common SEO practice.
Through the flexible backend settings and powerful template tag system of AnQiCMS, you can easily and efficiently display LOGO and copyright information on your website, ensuring the consistency of brand image and the completeness of legal information.
Common Questions (FAQ)
1. Why does my website's logo or copyright information not take effect immediately after modification in the template?This is usually due to browser cache or AnQiCMS system cache. You can try the following methods:
- Clear browser cachePress in your browser,
Ctrl+F5(Windows/Linux) orCmd+Shift+R(macOS) perform a hard refresh, or manually clear the browser cache. - Update AnQiCMS system cacheEnglish Login AnQi