How to combine the AnQiCMS navigation list tag with the `siteId` parameter to achieve navigation calls between multiple sites?

Calendar 👁️ 82

Mastering multi-site navigation: AnQiCMSnavListwith the tag andsiteIdParameter in-depth analysis

In today's complex and changing network environment, many enterprises and content operators are no longer satisfied with the operation of a single site.Brand extension, regional station, independent product line display, all of which have led to the demand for multi-site management.AnQiCMS (AnQiCMS) is a system designed specifically for enterprise-level content management, deeply understanding this field, and its powerful multi-site management function is born to solve this pain point.navListwith the tag andsiteIdParameter, to achieve flexible cross-site navigation calls.

One of the core strengths of AnQiCMS is its powerful multi-site management capability.It allows users to create and independently manage multiple websites under the same system architecture, each site can have its own content, templates, settings, and even language packs.This greatly simplifies the complexity of multi-brand or multi-regional operations, reduces repetitive work, and promotes data sharing and resource integration across sites.

Get to knownavListTag: the cornerstone of site navigation

In the template system of AnQiCMS,navListTags are the core tools for building navigation menus.It is responsible for extracting predefined navigation data from the background and providing it to the front-end template in an iterable list form.navListCan all胜任.

Generally, we would directly use the template of the current sitenavListtags to display the navigation of the site, for example:

{% navList navs %}
    <ul class="main-navigation">
        {% for item in navs %}
            <li class="{% if item.IsCurrent %}active{% endif %}">
                <a href="{{ item.Link }}">{{ item.Title }}</a>
                {% if item.NavList %}
                    <dl class="sub-navigation">
                        {% for sub_item in item.NavList %}
                            <dd><a href="{{ sub_item.Link }}">{{ sub_item.Title }}</a></dd>
                        {% endfor %}
                    </dl>
                {% endif %}
            </li>
        {% endfor %}
    </ul>
{% endnavList %}

This code will dynamically generate a menu based on the navigation category configured in the current site backend "Navigation Settings" (defaulting to the "Default Navigation" with ID 1). But if our goal is to callAnother siteWhere is the navigation? At this time,siteIdThe parameters come into play.

siteIdParameters: The magic key to unlock cross-site navigation calls

Now, let's delve deeper.siteIdA parameter that is exactly the magic key for cross-site navigation calls. In AnQiCMS, each independent site created through the "Multi-site Management" feature is assigned a uniquesiteId. ThissiteIdIs the digital identifier of the site, like the ID number of each website.

navListTags provide asiteIdParameters allow you to explicitly specify which site's navigation data you want to obtain. This means that regardless of which site you are currently on, as long as you know the target site'ssiteIdIt can easily pull and display its navigation menu.This is particularly useful for building a unified brand portal, sharing global footer navigation, or creating convenient jump links between related sites.

For example, suppose your main site (siteIdWith1) needs to display your sub-brand site B (siteIdWith2) specific navigation menu (assuming its navigation category ID is 3, named "Product Center"). You can write the code like this in the main station template:

{% comment %} 假设当前站点是站点A(siteId为1),我们想调用站点B(siteId为2)的“产品中心”导航 {% endcomment %}
<div class="site-b-product-nav">
    <h3>探索我们的产品</h3>
    {% navList siteB_products with typeId="3" siteId="2" %}
        <ul>
            {% for item in siteB_products %}
                <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
            {% endfor %}
        </ul>
    {% endnavList %}
</div>

In this code block,siteId="2"Accurately tell AnQiCMS to gositeIdWith2and find the navigation data on that site.typeId="3"Then further filter the navigation categories of the specific ID 3 under the site.In this way, even if the visitor is browsing the main site, they can clearly see the product navigation of the sub-brand site and click to jump, greatly enhancing the user experience and the interconnection between sites.

Application scenarios and operation points

  1. ObtainsiteId:To usesiteIdParameters, first you need to know the target site'ssiteIdThis information can be found in the 'Multi-Site Management' module of the AnQiCMS backend. Each site's list item will clearly display its unique number.IDThis is what we need to use in the templatesiteId.

  2. Build a unified global footer/header:Many companies want all sub-sites to have a unified footer that includes company information, privacy policies, and links to major product lines. By combining in the public template (such asbase.html)navListandsiteIdYou can call these global navigation from a central management site to ensure the synchronization and consistency of content across all sub-sites.

    {% comment %} 从主站点(siteId为1)获取全局底部导航(typeId为2) {% endcomment %}
    <footer class="global-footer">
        {% navList global_footer_nav with typeId="2" siteId="1" %}
            <ul class="footer-links">
                {% for item in global_footer_nav %}
                    <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
                {% endfor %}
            </ul>
        {% endnavList %}
        <p>&copy; {% now "2006" %} {{ system.SiteName }} All Rights Reserved.</p>
    </footer>
    
  3. Nested multi-site navigation: navListthe tags returned byitemThe object includes:NavListProperty, can be used to handle secondary even multi-level navigation. When combinedsiteIdWhen in use, you can build complex cross-site navigation structures, such as displaying another site's category list in a dropdown menu on a site, or even its popular articles.

    {% comment %} 在当前站点的导航中,嵌套显示另一个站点(siteId为3)的某个分类下的产品列表 {% endcomment %}
    {% navList current_site_nav with typeId="1" %}
        <ul>
            {% for item in current_site_nav %}
                <li>
                    <a href="{{ item.Link }}">{{ item.Title }}</a>
                    {% if item.Title == "我们的合作伙伴" %} {% comment %} 假设通过标题匹配一个特定菜单项 {% endcomment %}
                        <ul class="partner-products">
                            {% archiveList partner_products with type="list" siteId="3" categoryId="10" limit="5" %} {% comment %} 调用siteId为3的站点的分类ID为10的产品 {% endcomment %}
                                {% for product in partner_products %}
                                    <li><a href="{{ product.Link }}">{{ product.Title }}</a></li>
                                {% endfor %}
                            {% endarchiveList %}
                        </ul>
                    {% endif %}
                </li>
            {% endfor %}
        </ul>
    {% endnavList %}
    

    The example mentioned although integratedarchiveListBut its idea is the same, both are throughsiteIdto implement cross-site data calls.

Summary and prospects

BynavListwith the tag andsiteIdThe parameter's

Related articles

If AnQiCMS navigation tag does not specify `typeId`, which navigation list will be called by default?

The mystery of AnQiCMS navigation tags: Default navigation behavior when 'typeId' is not specified In website operation, the navigation system is undoubtedly the cornerstone of user experience and information architecture.A well-designed, logical navigation can quickly guide users to the information they need, enhancing the overall usability of the website.AnQiCMS (AnQiCMS) is a powerful and flexible content management system that provides intuitive template tags, allowing developers and operators to easily build complex navigation structures. Among them

2025-11-07

What are the cases where the `PageId` field of AnQiCMS navigation items takes effect?

## AnQiCMS navigation item's `PageId` field: When does it unleash the magic of precise navigation?In AnQiCMS (AnQiCMS) such a rich-featured and highly customizable content management system, each configuration item carries a specific mission.Navigation serves as the skeleton of a website, its importance is self-evident.When delving into the navigation settings of AnQiCMS, you will find a field named `PageId`.

2025-11-07

How to call the link of category page or single page in AnQiCMS navigation list?

The Anqi CMS plays a core role in website operations, and the navigation system is a guide for users to explore the website's content.A well-designed and convenient navigation not only enhances user experience but is also a key aspect of search engine optimization.Today, we will delve into how to flexibly integrate category pages and single-page links巧妙地融入到 websites navigation list.### Navigation Configuration: The Bridge from Backend to Frontend The navigation system of AnQiCMS is designed to be very intuitive and powerful, closely integrating the configuration of navigation with the call of front-end templates

2025-11-07

Does AnQiCMS support adding external links in the navigation menu and how to set it up?

## SecureCMS Navigation Menu: Easily integrate external links to expand your website ecosystem In today's fast-paced digital world, an efficient and user-friendly website navigation system is undoubtedly a guiding light for users visiting the website.It not only guides visitors to deeply explore your content, but is also the key to connecting the brand ecosystem and enhancing the user experience.As an experienced website operations expert, I fully understand the importance of the flexibility of the navigation menu for content strategy, especially whether it can add external links.

2025-11-07

How to dynamically display the latest article list under a specific category in the AnQiCMS navigation dropdown menu?

## Masterfully crafted: Dynamically display the latest article list under a specific category in the AnQiCMS dropdown menu As an experienced website operations expert, I fully understand the importance of an efficient and user-friendly navigation system for a website.It is not only a guide for users to explore the content of the website, but also a key to improve user experience and optimize the efficiency of search engine crawling.

2025-11-07

What is the internal structure of the `item.NavList` attribute returned by AnQiCMS navigation tags?

## Unveiling AnQiCMS Navigation Tag: The Internal Structure of `item.NavList` Property and the Wisdom of Building Multilevel Menus As an experienced website operations expert, I am well aware of the importance of a flexible and efficient navigation system for user experience and website SEO.AnQiCMS with its high-performance architecture based on the Go language and excellent customizability, showcases its strong capabilities in building enterprise-level websites.Today, let's deeply analyze the `item.NavList` attribute returned by AnQiCMS navigation tags and understand its internal structure

2025-11-07

How to determine if a navigation item in the AnQiCMS template contains a submenu?

As an experienced website operations expert, I am well aware of the importance of a well-designed, user-friendly website navigation for enhancing user experience and website SEO.Especially in enterprise-level content management systems like AnQiCMS, it is a basic requirement to flexibly build and display multi-level navigation.Today, we will delve into how to cleverly judge whether a navigation item has a submenu in AnQiCMS template development, thereby realizing a more intelligent and dynamic navigation rendering.

2025-11-07

Does AnQiCMS support adjusting the level and order of the navigation menu through drag and drop?

In the daily operation of website management, the adjustment frequency of the navigation menu may be higher than we imagine.In order to adapt to business development, optimize user experience, or adjust SEO strategies, it is a common demand of operators to manage the navigation structure flexibly and efficiently.Among them, adjusting the hierarchy and order of the menu through an intuitive drag-and-drop method is a feature highly favored in modern content management systems (CMS).Then, for the AnQiCMS (AnQiCMS) that we are deeply familiar with, does its backend support such drag-and-drop operations?

2025-11-07