Conveniently display the system name configured in the AnQiCMS website backend
The system name of the website is the core component of its online identity, it is not just a simple name, but also the key to brand image, search engine optimization (SEO), and user identification.For AnQiCMS users, reasonably displaying the system name configured on the website frontend can ensure consistency of website information, enhance user experience, and improve search engine friendliness.This article will introduce in detail how to find and flexibly use the system name in AnQiCMS, making it omnipresent and just right on your website.
Understand the 'System Name' in AnQiCMS
In AnQiCMS backend, the system name usually refers to the brand name or main title of your website, which plays an important role in many places.To view or modify it, you can log in to the AnQiCMS backend, navigate to the "Backend SettingsHere, you will find a configuration item named “Website Name”.This value is the basic name identified and used by the AnQiCMS system throughout the entire site.It not only affects the display title of the website, but also is the basis of some default functions (such as the record information link).
Call the system name in the template
AnQiCMS provides powerful template tag features, making it very easy to obtain backend configuration information on the website front end. To display the system name, we mainly use a tag namedsystemThe template tag. This tag is specifically used to retrieve global system configuration information.
The method of use is very intuitive: you need to specify the 'field name' of the configuration item you want to obtain. For the website name, the field name isSiteName.
For example, if you want to display the website name directly in a paragraph, you can write the template code in this way:
<p>欢迎访问 {{ system with name="SiteName" }}!</p>
Here are the{% system with name="SiteName" %}The "website name" configured on the backend will replace it. For convenience in template reuse, you can also assign it to a variable:
{% system siteName with name="SiteName" %}
<p>欢迎访问 {{ siteName }}!</p>
This is,siteNameThe variable stores the website name configured by the backend, and can be reused in other places of the current template.
Combined with the actual application scenario
The application of system names is not just about displaying text, it plays a role in enhancing professionalism and SEO effects at multiple key positions on the website.
A. In the website title (<title>Label)Application
the website's<title>Tags are an important basis for search engines to judge the theme of web page content, and they are also the first impression that users see in the browser tab or search results.Generally, we hope the title can include the content of the current page and use the website name as a suffix for brand recognition.tdk(Universal TDK)Label, making this operation flexible and in line with SEO**Practice.
In the template:<head>Part, you can configure it like this:
<title>{% tdk with name="Title" siteName=true %}</title>
This code will automatically retrieve the main title of the current page and append it with the 'Website Name' from the 'Global Function Settings' on the backend.
If you want to customize the title separator, for example using_而不是默认的-you can set it like this:
`twig