What are the available return fields supported by the AnQiCMS multilingual site list tag?

Calendar 👁️ 83

In the powerful feature matrix of AnQiCMS (AnQiCMS), multilingual support is undoubtedly one of its highlights. It helps enterprises easily expand into the international market and deliver content directly to global users.In order to achieve this goal, it is crucial to flexibly use template tags.Today, let's delve into the AnQiCMS used to obtain a list of multilingual siteslanguagesLabel, see how it can return some valuable fields for us, and how to cleverly use these fields to build an excellent multilingual website.

RevelationlanguagesLabel: Key to the multilingual site list

languagesThe tag is a special tool designed in AnQiCMS template engine to retrieve the list of all multi-language sites configured in the current system. Its usage is very simple and intuitive, no additional parameters are required, you just need to use it in the template by{% languages 变量名称 %}This form can be called. For example, you can name the returned data setwebsites, that is{% languages websites %}...{% endLanguages %}.

It is worth noting that,languagesthe tags returned bywebsitesIt is an array object, which means you need to useforLoop to traverse this collection, visit each multilingual site information one by one.In this way, you can easily provide users with language switching options, or implement more complex language logic on the backend website.

To deeply understand the available return fields

When we go throughforLoop throughwebsitesThis array represents eachitemindependent multilingual site. TheseitemContains a series of detailed fields, providing rich data support for building multilingual switching functions and optimizing SEO. Next, we will parse these core fields one by one:

  1. LanguageName(site language name)This field returns the language name of the current site, which is usually a friendly name visible on the user interface, such as “Simplified Chinese”, “English”, etc.You can directly use it for the display text of the language switch menu, making it clear to the user.

  2. Language(Language code) LanguageThe field provides international standard language codes such as "zh-CN", "en-US", etc. This code is crucial for technical implementation, especially in generatinghreflangThe tag plays an indispensable role in informing search engines of the corresponding relationship between different language versions of the page.At the same time, this code is also commonly used when performing language judgment or loading specific language resources in the back-end logic.

  3. LanguageEmoji(Language Emoji)If your design is lively or you want to save space,LanguageEmojiThe field will be your helpful assistant. It returns the Emoji icon corresponding to the language, such as Chinese.🇨🇳Or English.🇬🇧This provides another visual representation for the language switch button, making the interface more lively and interesting.

  4. LanguageIcon(Language Icon) LanguageIconThe field returns a URL address pointing to the icon file associated with the language, typically a flag icon. This is associated withLanguageEmojiSimilar, it provides high-quality graphic language identification, suitable for scenarios that require higher visual standards. If there is an icon, it will usually be used instead of Emoji.

  5. Name(Site Name)This field returns the specific name of a multilingual site, such as "AnQiCMS Chinese Site" or "AnQiCMS English Site". It may be moreLanguageNameInclude more specific site information, which can be used for more formal titles or descriptions.

  6. Link(Link address) LinkThe field is the core that connects different language versions. It returns the access URL address of the current multilingual site.When the user clicks the language switch button, this link will direct the user to the home page of the corresponding language version of the website or the corresponding language version of the current page (if the template logic supports it).

  7. Remark(Note) RemarkThe field is usually used to store additional information or notes that may not be directly displayed to users on the front end, but are valuable to website administrators or developers, such as special configuration instructions, internal codes, etc.In template development, if you need to display some custom site descriptions, you can also consider using this field.

  8. Nofollow(Nofollow tag) NofollowThe field is a boolean value (or an integer of 0/1), indicating whether the link to the multilingual site should be addedrel="nofollow"Properties. This is very important in SEO strategies, it can control whether the search engine tracks the link, and for some links that do not want to pass weight or only serve internal jumps, it can be set flexibly.

Application: Build multilingual switcher and SEO optimization

Understood these fields, we can start building practical functions.

Firstly, build an intuitiveLanguage switcheris the key to improving user experience. You can useLanguageNameto display text, combined withLanguageEmojiorLanguageIconProvide visual cues and useLinkfields to implement page redirection:

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

Secondly, for multilingual sites,hreflangTagIt is the most important thing in Search Engine Optimization (SEO). It helps search engines understand that your website provides pages in multiple languages or regions, so that the correct content can be displayed to users of different languages.You can useLinkandLanguagefield inheadgenerate these important metadata in the tags:

<head>
    {# 其他head内容 #}
    {%- languages websites %}
    {%- for item in websites %}
    <link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
    {%- endfor %}
    {%- endLanguages %}
</head>

Make good use oflanguagestags to enhance operational efficiency

languagesThe data provided by the tag is not just used for simple language switching, it is also a deep reflection of AnQiCMS in multi-site management and global content operations.By flexibly using these returned fields, you can not only build a complete, user-friendly multilingual interface, but also effectively optimize SEO to ensure that your content has good visibility in different language markets.This means higher operating efficiency, wider market coverage, and stronger competitiveness for small and medium-sized enterprises and self-media operators.

Frequently Asked Questions (FAQ)

Q1: WhylanguagesLabels do not support parameters like other list labelslimitororder?

A1:languagesThe design intention of the tag is to obtain all the multilingual sites that are configured in the current system.These sites are usually limited in number and are fixed system-level configurations, the order and quantity of which are often determined by the multi-site management backend, rather than dynamically adjusted by a single template call.Therefore, to keep it concise and focused on its core functions,languagesThe tag is designed not to accept additional filtering or sorting parameters. If you need to sort or filter the results on the frontend, you can do so after obtainingwebsitesthe array, using the template'sforloop andifJudge for secondary processing.

Q2: How can the current site being visited be determined in the template to highlight or apply specific styles?

A2: You can usesystemThe tag retrieves the language information of the current site and then compareslanguagesThe tag traverses outitem.LanguageAnd compares. AnQiCMS providessystemwhere{% system with name='Language' %}It will return the language code of the current site. CombinedlanguagesLabel, you can judge it like this:

Related articles

How to use the `languages` tag in AnQiCMS templates to display language options?

In today's globalized digital world, multilingual support for websites has become crucial for expanding markets and serving a diverse range of user groups.AnQiCMS (AnQiCMS) is well-versed in this field, deeply integrating multilingual functionality into its core architecture, committed to providing lightweight and efficient content management services to support the company's global layout.For website operators and template developers, understanding how to efficiently use the `languages` tag in AnQiCMS templates to display multilingual options is a required course for building internationalized websites.###

2025-11-06

How to get the list of all configured multilingual sites in AnQiCMS?

As an experienced website operations expert, I am well aware that having a website that supports multiple languages is crucial for businesses to expand their markets and enhance brand influence in today's global digital world.AnQiCMS (AnQi CMS) is an efficient and flexible content management system that provides excellent support in this regard.It can not only help us build multiple independent sites, but also allow these sites to easily switch between different languages, meeting the needs of global users.

2025-11-06

Can AnQiCMS's Json-LD combine `nextArchive` and `prevArchive` tags to generate structured data for related articles?

As an experienced website operations expert, I know that structured data plays a crucial role in modern search engine optimization.It can help search engines understand web content more accurately, thus giving them the opportunity to display richer search results (Rich Snippets), attracting more users to click.AnQiCMS (AnQiCMS) is an enterprise-level content management system that attaches great importance to SEO and naturally provides strong support and flexible customization space in this regard.

2025-11-06

Can Json-LD directly reference the image resource address of AnQiCMS, such as the thumbnail URL?

## Empowering Structured Data: Direct Reference Strategy for Anqi CMS Image Resources in Json-LD As an experienced website operations expert, I am well aware of the importance of structured data (Structured Data) in today's search engine optimization (SEO) field, which is self-evident.It not only helps search engines better understand page content, but is also the key to obtaining rich search results (Rich Snippets).While Json-LD is the mainstream implementation of structured data, its accuracy and completeness directly affect the exposure and click-through rate of a website

2025-11-06

How to use the `languages` tag to build a multi-language switch menu on the page?

AnQi CMS is committed to providing enterprises with efficient and flexible content management solutions, one of the core highlights being its powerful multilingual support capabilities.In today's globalized world, a website that can easily handle multilingual content undoubtedly provides strong support for a company to expand its international market and reach a wider user base.Today, let's delve into how Anqi CMS cleverly uses the `languages` tag to build a natural and smooth multilingual menu on your website, thereby opening a new chapter in global content marketing.

2025-11-06

Does the `languages` tag in AnQiCMS support any parameter settings?

AnQi CMS, as an enterprise-level content management system, has an excellent performance in helping enterprises to carry out global content layout, among which 'multilingual support' is one of its core advantages.When developing templates for AnQiCMS, we often encounter the need to display or switch the website language, which is when a key template tag - `languages` - comes into play.### Core Functionality and Design Philosophy of `languages` Tag in AnQiCMS Directly answer the most concerned questions of everyone

2025-11-06

What is the type of the `websites` variable returned by the `languages` tag?

As an experienced website operations expert, I am well aware of the importance of multilingual support in building a global website.AnQiCMS (AnQi CMS) provides powerful and flexible multi-language content management capabilities, where the `languages` tag is the key tool to achieve this goal.Today, let's delve into the `languages` tag that returns the `websites` variable, what type it is, and how we can cleverly use it to build our multilingual site.### Unveiling

2025-11-06

How to iterate over the `languages` tag returned by the AnQiCMS template to list `websites`?

## Unlock the multilingual potential of AnQi CMS: How to efficiently traverse the `languages` tag returned by the `websites` list As an experienced website operations expert, I am well aware of the importance of multilingual websites in global marketing.AnQiCMS (AnQiCMS) relies on its powerful multi-site and multi-language support to provide a powerful tool for businesses and content operators to build internationalized websites.

2025-11-06