How to display multilingual content and switch on the AnQiCMS website?

Calendar 👁️ 57

Today, with the increasing popularity of globalization, many companies hope that their websites can serve users from different language backgrounds.AnQiCMS (AnQiCMS) understands the importance of this requirement and has integrated powerful multilingual support capabilities from the beginning of the system design, making it easy for you to build and manage multilingual websites.

Display multilingual content on your AnQiCMS website and allow users to switch between them, which mainly revolves around its "multi-site management" core function.Aqie CMS treats each language as an independent site for management, but these sites can be unified in the same background, greatly simplifying the maintenance of multilingual websites.

Understanding the multilingual mechanism of AnQiCMS

Firstly, we need to clarify the basic approach of the Anqi CMS for handling multilingual content.Different from some CMS that add multiple language versions under a single content item, Anqi CMS adopts the strategy of 'site is language'.This means that if you plan to have two language versions of the website, Chinese and English, you will create two independent sites in the Anqicms backend: one for Chinese content and one for English content.

This design brings several obvious advantages:

  • Strong content independence:Each language's content is completely independent, making it convenient for targeted content planning, SEO optimization, and localization operations, thus avoiding mutual interference between different language content.
  • Flexible customization:You can choose different templates for different language sites, and even customize unique features or layouts to meet the specific needs of a particular language site.
  • High management efficiency:Even though the content is independent, these sites are all managed under a single Anqing CMS backend, making it convenient for you to publish content in multiple languages, manage users, and analyze data.

It is worth mentioning that the default language package setting of the AnQiCMS backend (located in the Global Function Settings), is mainly used to switch the display language of the backend management interface, as well as the language of some built-in system prompts.It will not automatically translate the specific content of your website, such as articles, products, or categories.This content needs to be created and maintained separately on your language sites.

Back-end settings: Create independent sites for different languages

Building a multilingual website, start with the 'Multi-site Management' feature from the Anqi CMS back-end.

  1. Log in to the backend and enter the multi-site management:Visit your AnQi CMS backend, find the 'Multi-site Management' option in the left navigation menu.
  2. Add a new site:Click the "Add new site" button. Here, you will configure the basic information for your new language version website.
    • Site Name:Create a recognizable name for the new site, such as "English Site" or "Chinese Site".
    • Site root directory:Specify a separate folder path to store the cache and other data for the language site. It is usually recommended to name it with the domain name plus language identifier, for example/app/en_yourdomain_comor/app/cn_yourdomain_com.
    • Website address:This is the key to the new language website. You need to assign a separate domain name or subdomain to each language site, for exampleen.yourdomain.com(English site) andcn.yourdomain.com(Chinese site), or use the directory formatyourdomain.com/enandyourdomain.com/cnEnsure that these domain names are correctly resolved to your server and configured with the appropriate reverse proxy (if you are using Apache or Nginx).
    • Admin account password:Set up an independent backend management account and password for this new site.
    • Database name:Similarly, allocate an independent database for the new site, for exampleen_yourdomain_com. If you are installing AnQi CMS via Docker, you can usually choose to 'Reuse default database account information', and the system will automatically create the database.
    • Select the template to use:You can choose an existing template or customize a dedicated template for a new language site.
  3. Repeat the steps to create all language sites:Follow these steps to create a separate site for all your target languages.

After completing these settings, each language version has its own separate access address and management entry.

Content management: fill exclusive content for each language

Once the language site is set up, the next task is to fill them with content.You need to log in to the backend of each language site separately, and publish and manage content according to the habits of that language.

For example, when you log in to the English site's backend, all functions such as 'Document Management', 'Document Classification', 'Single Page', and so on will be used to create and edit English content.Similarly, in the background of Chinese sites, you will focus on the publication of Chinese content.This means that the article title, content, category name, tags, and single page content all need to be translated into different languages and entered separately.

This method ensures the professionalism and accuracy of the content, avoiding the stiffness and unnaturalness that may be brought by machine translation.

Front-end implementation: Multi-language switching and SEO optimization

Implementing language switching on the frontend page is crucial for allowing users to choose their preferred language.The AnQi CMS provides convenient template tags to help you achieve this, combining SEO**practices to ensure that your multilingual website can be correctly understood and indexed by search engines.

1. Create a multi-language switcher:

You can place a language switcher in the header, footer, or sidebar of the website. Anqicms provides alanguagestag that can retrieve information about all configured multilingual sites.

In your template file (for examplebase.htmlor in the public header file) you can use the following code to display language switch options:

{%- languages websites %}
{%- if websites %}
<div class="language-switcher">
    <span>切换语言:</span>
    {%- for item in websites %}
    <a href="{{item.Link}}">
        {%- if item.LanguageIcon %}
        <img src="{{item.LanguageIcon}}" alt="{{item.LanguageName}}"/>
        {%- else %}
        {{item.LanguageEmoji}}
        {% endif %}
        {{item.LanguageName}}
    </a>
    {%- endfor %}
</div>
{%- endif %}
{%- endLanguages %}

This code will iterate through all configured language sites and generate a link for each language.item.Linkpoint to the home page of the language site,item.LanguageNameDisplay language name (such as "Chinese", "English"), you can also choose to displayLanguageIcon(Flag icon) orLanguageEmoji(Emoticon). After clicking the link, the user will be redirected to the website in the corresponding language.

2. Implement Hreflang tags to optimize search engine visibility:

The hreflang tag is crucial for SEO of multilingual websites.It tells the search engine that your website has multiple language versions, specifies the URL for each language version, thus avoiding duplicate content issues, and ensures that the search engine displays the correct language content to users of the corresponding language.

You need to add the corresponding HTML in each language site<head>parthreflangtags. Similarly, we can uselanguagestags to dynamically generate these links.

Before yourbase.htmlthe file<head>Add the following code within the tag:

{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endLanguages %}

here,item.LinkIt is the complete URL for each language site,item.LanguageIt is the language code of the language site (for example, "zh-CN", "en-US"). This way, search engines can accurately identify the structure of your multilingual content.

Summary

By using the powerful "Multi-site Management" function and flexible template tags of AnQi CMS, you can systematically build and operate multilingual websites.Create an independent language site from the backend, implement an intuitive language switch on the frontend, and combine with Hreflang tags for SEO optimization, the entire process is efficient and controllable.This not only helps you expand your global market, but also provides a better and more personalized browsing experience for users from different cultural backgrounds.


Frequently Asked Questions (FAQ)

Q1: Is the multilingual content of AnQi CMS automatically translated?A1: No. Anq CMS adopts the 'site is language' strategy, you need to create an independent site for each language and manually publish and manage the corresponding language content on each site.The system will not provide automatic translation functionality, as this is done to ensure the quality of translation and the localization accuracy of the content.

Q2: Do I need to install a separate AnQi CMS program for each language site?A2: Not required. The multi-site feature of AnQi CMS allows you to create and manage multiple independent language sites under a single program installation.You only need to install once AnQi CMS, and then you can add sites in different languages through the "Multi-site Management" feature in the background.

Q3: Is the multilingual function of AnQi CMS SEO-friendly?A3: Yes, the multilingual design of Anqi CMS is very friendly to SEO. It allows each language site to have an independent domain or URL structure, independent content and metadata (TDK), and through the front end,languagesLabel easily generatedhreflangAttributes, help search engines accurately understand and index your different languages

Related articles

How to customize the content model to meet the needs of personalized content display?

Today, with the increasing refinement of content operation, we often find that relying solely on traditional 'article' and 'product' categories is no longer sufficient to meet the diverse content display needs of websites.Each business scenario has its unique attributes and information structure. How to make the website's content management system (CMS) like a considerate tailor, tailoring "garments" for each type of content, is exactly what we strive for.The flexible content model feature provided by AnQiCMS (AnQiCMS) just helps us achieve this vision.Why do we need a custom content model?Imagine

2025-11-08

How to implement unified and efficient display of content for multiple sites in AnQiCMS?

AnQiCMS (AnQiCMS) is a content management system tailored for small and medium-sized enterprises and content operation teams, one of its core highlights being excellent support for multiple sites.Under the increasingly prevalent trend of multi-brand and multi-channel operation, how to efficiently manage and display the content of multiple websites on a single platform has become a focus of many users.The Anqi CMS is built around this need, creating a flexible and powerful solution to ensure the consistency of content display and operational efficiency.### Core Pillar

2025-11-08

How to check variable data type and structure for debugging in AnQiCMS template?

During AnQiCMS template development, we often encounter a frustrating scenario: the page display does not meet expectations, and the data of some variables cannot be output correctly.At this time, we urgently need a 'fire-eyed golden eyes' to see through the real data type and internal structure of the template variables.AnQiCMS's powerful Django-like template engine is flexible, but if you cannot clearly understand the 'true face' of variables during debugging, the efficiency will be greatly reduced.Luckyly, AnQiCMS provides us with a series of practical tools

2025-11-08

How do the `center`, `ljust`, and `rjust` filters control the alignment of a string within a specified width?

In website content management, we often need to present text in an orderly and beautiful manner, especially when dealing with specific layouts or content that requires structured display.AnQiCMS's template engine provides several very practical string filters, specifically used to control the alignment of text within a fixed width. They are `center`, `ljust`, and `rjust`.Understand and make good use of them, which can help us control the display effect of the front-end page more finely.### Center the string with `center`

2025-11-08

How to optimize the URL structure to make the content result page more conducive to search engine crawling and display?

In content operation, a well-structured, search engine-friendly URL (Uniform Resource Locator) not only improves user experience but is also the key to helping search engines efficiently crawl and understand website content.AnQiCMS (AnQiCMS) knows this, and therefore built-in powerful URL optimization features in the system design, so that the content result page performs better in search engines.### URL Optimization Basics of AnQi CMS: URL Rewriting By default, many dynamic websites' URLs contain question marks, equal signs, and a long string of difficult-to-understand parameters, such as `example

2025-11-08

How to configure pseudo-static rules to achieve diverse content link display modes?

As website operators, we all hope that the website's URL can be easily indexed by search engines and be clear to users, even allowing them to understand the content of the page directly from the link.A clear and meaningful URL not only enhances user experience but is also an indispensable part of search engine optimization (SEO).Aqin CMS understands this and therefore provides a powerful and flexible static rule configuration function, allowing us to create diverse content link display modes according to our needs.Why is pseudo-static so important?\n\nImagine two types of links: `www.yourdomain

2025-11-08

How to add recommended attributes to articles, products, and display them in front-end categories?

In content operation, how to effectively highlight important information so that users can find the core content at a glance, which is the key to improving the website effect.AnQiCMS (AnQiCMS) provides a flexible recommendation feature that allows you to easily mark the importance of articles, products, or other content and display them on the website front-end as needed.This article will introduce in detail how to add these recommended attributes to the content in the background, as well as how to classify them in the front-end template.--- ## Use Anq CMS recommended attributes to make your content shine on the front page In content management and presentation

2025-11-08

How to automatically extract keywords from the article content for SEO display?

In today's highly competitive online environment, content operators are well aware of the importance of keywords for website SEO.They are not only the bridge for search engines to understand the content of your website, but also the entry point for users to find your information.However, manually screening and extracting keywords from each article is undoubtedly a time-consuming and labor-intensive task.Is there a more intelligent and automated way to handle this problem?AnQiCMS (AnQiCMS) deeply understands the pain points of content operators, integrating SEO optimization deeply into the system design.It provides a series of powerful SEO tools

2025-11-08