How to display the website name, Logo, filing number, and copyright information in AnQiCMS templates?

AnQiCMS (AnQiCMS) provides an intuitive and powerful template system, allowing us to flexibly display various core information on the website.Whether it is the name of the website, Logo, filing number, or copyright statement, these are all key elements that constitute the brand image of the website, meet compliance requirements, and enhance user trust.This article will delve into how to call and display this information in the AnQiCMS template, ensuring that your website content is complete and professional.

AnQiCMS template basics: Quick review

In AnQiCMS, template files are usually named with.htmlsuffix and are stored in the root directory of the website./templateIn the folder. The system uses a syntax similar to the Django template engine, which makes content calls and logical control quite intuitive.

  • Variable displayUsing double curly braces{{ 变量名 }}.
  • Logical control and function tagsUse single curly braces and percentages{% 标签名 参数 %}And most function tags need corresponding end tags{% end标签名 %}.

Understood the basics, we can integrate website information into template design more effectively.

Core information display: The application of System Tag (System Tag)

AnQiCMS provides a unified basic configuration information for the website'ssystemLabel. Through this label, we can easily obtain all the basic website data configured in the background "Global Settings".

1. Website Name (SiteName)

The website name is the identifier of your brand, which is usually displayed in the title bar, header, or footer of the website. In the AnQiCMS template, you can call it in the following way:

<div>欢迎访问 {{ system with name="SiteName" }}</div>

Or, if you want to assign it to a variable for use in multiple places, you can do it like this:

{% system siteNameVar with name="SiteName" %}
<h1>{{ siteNameVar }}</h1>

2. Website Logo (SiteLogo)

Logo is the visual core of the website, used for brand recognition.After uploading the Logo on the backend, you can easily refer to its image address in the template.altAttribute, and set its value to the website name.

<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />

Here we cleverly combineSiteLogoandSiteNameTwo tags, so that the Logo image'saltAutomatically obtain the website name, convenient and in line with **practice.

3. Website record number (SiteIcp)

For websites operating in mainland China, the filing number is a legal required piece of information, usually placed at the footer of the website. The tag for calling the filing number is as follows:

<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a>

Here, we not only called the filing number text, but also added a link to the Ministry of Industry and Information Technology's government service platform, so that users can click to verify the filing information, further enhancing the credibility of the website.rel="nofollow"andtarget="_blank"It is a commonly used SEO and user experience setting.

4. Copyright Information (SiteCopyright)

Copyright information declares the ownership of the website content and is usually located at the footer. It can be simple text and may also contain HTML tags (such as, containing a link).

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

Please note here|safeThe filter. If your copyright information in the background settings includes HTML tags (such as links, bold, etc.), use|safeEnsure that these HTML tags are not escaped but are correctly parsed and displayed by the browser. But use them with caution.|safeBecause it will cancel the AnQiCMS default XSS attack protection.

Combine the universal TDK Tag to optimize the page title.

In addition to the direct display mentioned above, the website name also plays an important role in the page title (Title), which is crucial for SEO. AnQiCMS providestdkTag to manage the page's Title, Keywords, and Description. When we need toTitleinclude the website name, we can usetdklabel'ssiteNameparameters:

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

This code will intelligently retrieve the title of the current page and append the website name to it (or before, depending on the template logic) to form a more complete page title, such as 'Article Title - Your Website Name'.sepParameters (default to-) You can also customize the separator between the title and the website name.

Place this information into the template.

In practice, this information is usually concentrated in the public part of the website, such asbase.htmlthe header (header) or footer (footer) area of the template file.

The following is an example of a hypothetical footer code snippet that shows how to integrate this information:

<footer>
    <div class="container">
        <div class="footer-logo">
            <a href="/">
                <img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />
            </a>
        </div>
        <p>
            版权所有 &copy; {% now "2006" %} {{ system with name="SiteName" }}.
            <span class="separator">|</span>
            <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" %}</a>
        </p>
        <p class="copyright-text">
            {{ system siteCopyright with name="SiteCopyright" %}{{ siteCopyright|safe }}
        </p>
    </div>
</footer>

In this example,{% now "2006" %}The tag is used to dynamically display the current year, ensuring that the copyright year is always up to date, which is a very practical detail.

Cautionary notes and **practice

  • Backend settings entry: All this information can be found in the AnQiCMS admin panel.系统设置Configure it in the menu. Make sure you have filled in the corresponding data in the admin panel, otherwise the template will display empty.
  • Template file location and encoding:Ensure your template file (for examplebase.html) is located at/templateis located in the directory and saved using UTF-8 encoding to avoid Chinese garbled characters.
  • |safeFilter:Emphasize again,|safeThe filter function is powerful, but it must be used with caution.Only when you are sure that the content displayed is completely safe and does not contain malicious scripts should you use it to prevent potential XSS attack risks.
  • SEO friendliness:WithLogoAdd imagealtThe attribute not only improves accessibility, but also has a positive impact on search engines understanding image content and improving website SEO.

By proficiently using AnQiCMS'ssystemandtdkLabel, you can easily display the core information of the website in the appropriate position, providing visitors with a professional, complete, and standardized browsing experience.


Frequently Asked Questions (FAQ)

1. Why is the website name I filled in the background "Global Settings" not displayed on the front page?

Firstly, please make sure that your template file is used correctly.{% system with name="SiteName" %}

2. Why does my website filing number link show 'Unable to access this website' when clicked?

This is usually not a problem with AnQiCMS itself, but because the domain linked to your filing number does not match the actual filing information, or the Ministry of Industry and Information Technology's government service platform (beian.miit.gov.cn) may sometimes experience unstable access or adjustments.https://beian.miit.gov.cn/This link is official and accessible. AnQiCMS is just generating the link according to the format you provided.

**