A website's name and copyright information are important manifestations of its brand image and legal attribution.In AnQiCMS, the configuration and display of these core elements are both flexible and intuitive, which can help website operators manage easily and ensure the professionalism and compliance of the website.
Background configuration of website basic information
In AnQiCMS, the website's name, copyright information, and other basic configurations are mainly concentrated in the "Global Function Settings" area of the background.Here is like the "control center" of your website, managing many core parameters.
Website NameThe website name is the facade of your website and also an important basis for search engines to identify your website brand.In the global feature settings, you can find the item "Website Name.The name entered here, which is often used as a suffix for web page titles, or referenced in various corners of the website (such as headers, footers).A clear, distinctive website name is crucial for enhancing user memory and brand recognition.
Copyright InformationCopyright information is usually located at the bottom of the website and is an important part of declaring the ownership of the website content.In the global function settings, you can enter detailed copyright statements, such as “© 2023 [Your Company Name].”}]All Rights Reserved.”Here you can enter plain text, or you can also include HTML tags for simple formatting or adding links.Clear copyright statements help protect your original content and demonstrate the professionalism of your website.
Other related settingsIn addition to the name and copyright, the global function settings also include some parameters closely related to the website identity:
- website logo: Used to upload your brand logo image, usually displayed in the website header.
- Website filing numberIf you operate in mainland China, the record number is a required item and will usually link to the Ministry of Industry and Information Technology's government service platform.
- [en]Home page address of the website.Specify the root domain of the website to ensure the system can correctly generate all internal links.
Customize settings parametersIf the default settings do not meet all your needs, AnQiCMS also provides the 'Custom Settings Parameters' feature.This means that you can add any custom website information based on the template design requirements.For example, if your website needs to display a special help page link but does not have a corresponding built-in field, you can add a parameter named “HelpPageLink” here and fill in the corresponding URL.This feature greatly enhances the flexibility of website configuration, allowing you to expand website functions without modifying the code.
Display this information in the front-end template
After configuring these basic information in the background, the next step is how to correctly display them on the front-end page of the website. AnQiCMS provides a powerful template tag system, including the "system tags"system)is used to obtain these background configurations.
UsesystemThe tag is very direct, you just need to specify the field name you want to retrieve.
Display the website nameIn the template, if you want to display the website name previously set in the background, you can call it like this:
<title>{% tdk with name="Title" siteName=true %}</title>Here are the
tdkTags will automatically obtain the title of the current page and according tositeName=trueThe setting, appended with the global settings website name at the end. If you just want to display the website name independently in other places on the page, you can use it directlysystemTags:<div>欢迎来到 {% system with name="SiteName" %}</div>Display copyright contentCopyright information usually contains some HTML tags (such as
<strong>or<a>), so special attention needs to be paid to their use when displaying.|safeFilter to ensure that HTML content is correctly parsed by the browser and not displayed as plain text. Assuming the copyright information you set in the background is “© 2023”}]AnQiCMS. All Rights Reserved.”,那么在模板中调用时:<footer> {% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}} </footer>Here, we first assign
SiteCopyrightAssign to.siteCopyrightthe variable, and then pass through{{siteCopyright|safe}}将其安全地输出到页面上。Display the website logoThe display of the website logo is also simple, usually it is an image URL:
<header> <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" /> </header>We use both here:
SiteLogoAs an image source,SiteNameAs an alternative text for images, this helps with SEO and user experience.Display the website filing numberThe record number usually contains a link to the government website, so it can be used in the template like this:
<p> <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a> </p>rel="nofollow"andtarget="_blank"It is recommended attribute, the former tells the search engine not to track this link, and the latter makes the link open in a new window.Displays custom parametersIf you have customized a parameter named “HelpPageLink” in the background, its calling method is similar to the built-in parameters:
<nav> <a href="{% system with name="HelpPageLink" %}">帮助中心</a> </nav>So, no matter how you modify the value of 'HelpPageLink' in the background, the front-end page will be synchronized updated.
Attention Points and **Practice
- Maintain consistency:Ensure that the website name, copyright information, and other settings you make in the background are consistent throughout the entire website, which is crucial for building a brand image.
- SEO-friendly:The website name is in
<title>The display in tags, which has a direct impact on Search Engine Optimization (SEO). Make sure it is concise and clear, containing brand keywords. - Legal complianceEnglish: The correct display of copyright information and filing number is a legal requirement for website operation, and must be accurate and correct.
- Use flexibly
|safeWhen you retrieve content from the background that may contain HTML code (such as copyright information), remember to use|safethe filter, otherwise the HTML code will be escaped, affecting the display effect. - Use custom parameters:Make good use of custom parameters can greatly improve the flexibility of templates and reduce the number of times template files need to be modified due to changes in requirements.
By following these steps, you can easily configure and display the website name, copyright information, and other key basic data in AnQiCMS, laying a solid and professional foundation for your website.
Common Questions (FAQ)
Q1: Why is it sometimes necessary to add copyright information when displaying it?|safeFilter?A1: The template engine of Anqi CMS defaults to escaping all HTML tags in output content to prevent potential security risks (such as XSS attacks), displaying them as plain text. Sometimes, copyright information needs to be included<strong>/<a>Format using HTML tags. When you are sure that the output content is safe and needs to be parsed as HTML, you should use|safeFilter, tells the template engine that this content is "safe", and can be rendered in HTML format.
Q2: Do I have the ability to set different website names and copyright information for each sub-site?A2: Yes, AnQiCMS supports multi-site management, and each site can have independent configurations.The website name and copyright information you configure in the "Global Function Settings" on the backend are effective for the currently active site.If you have created multiple sites in AnQiCMS, you can log in to the backend of different sites to set unique website names, copyright information, and other parameters for them.systemTags will automatically obtain the configuration information corresponding to the current site.
Q3: How can I set it so that the website name does not appear as a suffix in the page title?A3: When you use{% tdk with name="Title" siteName=true %}tags to generate page titles,siteName=trueRepresents that the website name will be appended after the page title. If you do not want the website name as a suffix, you cansiteNameproperty is set tofalse, which is{% tdk with name="Title" siteName=false %}. The page title will then only display the title content of the current page.