How to configure and display the website name and copyright information in AnQi CMS?

The name and copyright information of a website is an important manifestation of its brand image and legal attribution.In AnQiCMS (AnQiCMS), these core elements are configured and displayed flexibly and intuitively, 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 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, centrally managing many core parameters.

  1. Website NameThe website name is the face of your website and an important basis for search engines to recognize your website brand.In the global feature settings, you can find the item "Website Name".The name entered here, which is usually used as a suffix for web page titles or referenced in various corners of the website (such as headers and footers).A clear and distinctive website name is crucial for enhancing user memory and brand recognition.

  2. Copyright informationCopyright information is usually located at the bottom of the website and is an important part of declaring ownership of the content.In the global feature settings, you can enter a detailed copyright statement, for example, “© 2023 [Your company name]. All Rights Reserved.”. Here you can enter plain text, or you can include HTML tags for simple formatting or adding links.A clear copyright statement helps protect your original content and show visitors the professionalism of your website.

  3. Other related settingsIn addition to the name and copyright, the global function settings also include some parameters closely related to the identity of the website:

    • Website LOGO: Used to upload your brand identity image, usually displayed in the header of the website.
    • Website registration numberIf you operate in mainland China, the filing number is required and it will usually link to the Ministry of Industry and Information Technology's government service platform.
    • Home Page AddressSpecify the root domain of the website to ensure the system can correctly generate all internal links.
  4. Custom settings parametersIf the default settings do not meet all your needs, AnQiCMS also provides a 'Custom Setting Parameters' feature.This means you can add any custom website information according to the design of the template.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, where the “System Tags” (system)is used to get these background configurations tools.

UsesystemThe tag is very direct, you just need to specify the field name you want to get.

  1. Display website nameIn the template, if you want to display the website name set previously in the background, you can call it like this:

    <title>{% tdk with name="Title" siteName=true %}</title>
    

    HeretdkThe tag will automatically retrieve the title of the current page and according tositeName=trueThe setting, append the global setting website name after it. If you just want to display the website name independently on other parts of the page, you can use it directlysystemTags:

    <div>欢迎来到 {% system with name="SiteName" %}</div>
    
  2. 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 displayed|safeA filter to ensure that HTML content is parsed correctly by the browser and not displayed as plain text. Assuming you have set the copyright information in the background as “© 2023”AnQiCMS. All Rights Reserved.

    <footer>
        {% system siteCopyright with name="SiteCopyright" %}{{siteCopyright|safe}}
    </footer>
    

    Here, we first declareSiteCopyrightAssign tositeCopyrightthe variable, then through{{siteCopyright|safe}}Output it safely to the page.

  3. Show 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 it here at the same timeSiteLogoas the image source,SiteNameAs an image alternative text, it helps with SEO and user experience.

  4. Display the website's filing numberThe record number usually has 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 opens the link in a new window.

  5. Display 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>
    

    This way, no matter how you change the value of "HelpPageLink" on the backend, the front-end page will update synchronously.

Cautionary notes and **practice

  • Maintain consistencyEnsure 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-friendlyThe website name is in<title>The display label has a direct impact on search engine optimization (SEO). Make sure it is concise and clear, containing brand keywords.
  • Legal complianceThe correct display of copyright information and filing number is a legal requirement for website operation, it must be accurate and correct.
  • Flexible application|safe: When you retrieve content from the background that may contain HTML code (such as copyright information), remember to use|safea filter, otherwise the HTML code will be escaped and affect the display effect.
  • Utilize custom parameters:Make good use of custom parameters can greatly improve the flexibility of templates, 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 name, copyright information, and other key basic data of your website, laying a solid and professional foundation for your website.


Frequently Asked Questions (FAQ)

Q1: Why is it sometimes necessary to add|safeFilter?A1: The template engine of AnqiCMS is designed to prevent potential security risks (such as XSS attacks), and by default, it will escape all HTML tags in the output content, treating them as plain text. Sometimes, copyright information needs to be included.<strong>/<a>Format with HTML tags. When you are sure that the output content is safe and needs to be parsed as HTML, you should use|safeA filter that tells the template engine that this content is 'safe' and can be rendered as HTML.

Q2: Do I have multiple child sites, can I set different website names and copyright information for each child 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 Feature Settings" backstage is effective for the current active site.If you create multiple sites in AnQiCMS and log in to the backends of different sites, you can set unique website names, copyright information, and other parameters for them separately.When calling the template,systemLabels will automatically retrieve 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 the page title, siteName=trueThe site name will be appended to the page title. If you do not want the site name as a suffix, you cansiteNameset the attribute tofalse, that is{% tdk with name="Title" siteName=false %}. In this way, the page title will only display the title content of the current page.