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

Calendar 👁️ 60

AnQiCMS navigation item inPageIdField: When does it unleash the magic of its 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.PageIdThe field. This field is not always active, it is only activated in specific scenarios, playing a unique role in precisely linking content. As a senior website operator, understandingPageIdThe mechanism, which can help us manage website content more efficiently, ensuring the accuracy and maintainability of navigation.

In short, the navigation items in AnQiCMS includePageIdField, dedicated to serving those who needAccurately points to specific content entities within the websiteThe navigation link. It is not a generic link identifier, but is closely associated with the "Categories" and "Single Page" in the content model.

PageIdAppearance: When the link type points to internal content

When we are in the AnQiCMS backend, through the 'Navigation Settings' to create or edit a navigation item, the system will provide a variety of 'link types' for us to choose from.This includes 'Built-in links' (such as the homepage of the website), 'External links' (pointing to URLs of other websites), and most importantly - 'Category page links'.

It is when we choose the 'category page link' type,PageIdThe field is officially enabled.This means that you want this navigation item to be more than just a simple text link, but to be directly associated with a specific category in your website's backend management (such as "News

Once you select a category or a single page from the dropdown list, AnQiCMS will intelligently fill in the category or single page'sunique IDautomaticallyPageIdIn the field. This ID, whether it is a category ID or a single page ID, will become the core basis for the system to identify the content it refers to within the navigation item.

PageIdThe practical application: content linkage and template dynamic display

PageIdThe value, not only lies in recording the ID of a content, but also in bringing powerful dynamic content linkage capabilities to the front-end template. Through the template tags provided by AnQiCMS, such asnavListWe can easily get the navigation item on the front-end pagePageIdValue.

For example, suppose you created a navigation named "Latest News" and set its link type to "Category Page Link", then selected the article category with ID 10. At this point, this navigation item'sPageIdIt stored "10". In the front-end template, when you iterate over the navigation list, you can use it like this:

{% navList navList with typeId=1 %}
{%- for item in navList %}
    <li>
        <a href="{{ item.Link }}">{{item.Title}}</a>
        {%- if item.PageId > 0 %} {# 判断PageId是否存在且有效 #}
            {# 如果当前导航项关联的是一个分类,且我们想展示该分类下的部分文章 #}
            {% archiveList articles with type="list" categoryId=item.PageId limit="5" %}
                <ul>
                    {% for article in articles %}
                        <li><a href="{{article.Link}}">{{article.Title}}</a></li>
                    {% endfor %}
                </ul>
            {% endarchiveList %}
        {% endif %}
    </li>
{% endfor %}
{% endnavList %}

In this code block,item.PageId(which is category ID 10) was passed to thearchiveListlabel'scategoryIdParameters dynamically pull and display the latest 5 articles under the "Latest News" category.This association method based on ID makes navigation not only a link but also an entry point for content aggregation.

Similarly, if a navigation item'sPageIdThis corresponds to a single page (such as the "About Us" page, ID 5), although we usually do not directly display the child content in the navigation dropdown, but developers can make use of thisPageIdWrite more intelligent template logic. For example, based on the currently active navigation item'sPageIdLoad different background images, sidebar modules, and even call other data related to the single-page ID dynamicallly.

PageIdWhen to 'sleep': scenes involving built-in and external links.

Of course,PageIdNot a necessity for all navigation items. When the navigation item link type is set to:

  • Built-in linkFor example, it points to the homepage of a website or the homepage of a content model (such as “All Articles” These links have fixed system routing rules, do notPageIdspecify specific content.
  • External link: Points to a URL of another website. In this case, the navigation item directly stores a complete external URL,PageIdit is naturally useless.

In these cases,PageIdThe field is either empty or its value is ignored, which does not affect the actual navigation function.

Summarize the value to the user

Therefore, the AnQiCMS navigation items'PageIdThe field is an identifier that focuses on precise links to internal content (categories and single pages).It becomes effective when you select the 'Category Page Link', storing the unique ID of the selected content entity.This design greatly enhances the flexibility and dynamic nature of website navigation, allowing the front-end template to intelligently display related content based on navigation items, and also provides website operators with more powerful content organization and maintenance tools, avoiding the inconvenience that may arise from hard-coded URLs.PageIdThe operation mode will undoubtedly enable you to operate more steadily and efficiently on the content operation path of AnQiCMS.


Frequently Asked Questions (FAQ)

Q1:PageIdand the navigation items.LinkWhat is the difference between the fields? Which should I focus on?

PageIdandLinkAre two different dimensions that are interrelated concepts.PageIdStores a specific category or single page within your website.Unique numeric IDIt is an identifier at the content level. AndLinkThe field stores the finalaccessible URL path. When you select the “Category Page Link” and associate it with specific content, the system will use the content'sPageIdand the pseudo-static rules of the current website, automatically generatedLinkField. In most cases, you should focus on setting the correct "link type" and associated "category/page", so that the system can manage automaticallyPageIdandLink.PageIdMore used for advanced dynamic content display logic in templates, whileLinkIs the address where users directly click to visit.

Q2: Can I manually modify the navigation items?PageIdIs it? What risks are there in manually modifying?

Theoretically, background operations may allow you to enter or modifyPageIdbut westrongly advise againstmanually modifying.PageIdAlways use the "Category Page Link" option in the background navigation settings and select a specific category or single page from the dropdown list to automatically fill in. If you manually enter an ID that does not exist or arbitrarily modify it to a mismatched ID, the navigation link may fail, or although it may jump on the surface, becausePageIdThe content does not match the actual content, which leads to the front-end template not being able to correctly obtain and display related content, resulting in blank or error messages.The correct approach is to select the link type and target category/page again if you need to change the content that the navigation points to.

Q3:PageIdIs it only applicable to articles or product categories? If I want to link to the list page of other custom content models,PageIdwill it take effect?

PageIdThe scope is the content entities covered by the 'category page link', which usually includesAll categories under the content modelsandsingle pageTherefore, if your AnQiCMS system has custom content models (such as "cases", "services", etc.) and has created categories for these models, then you can associate navigation items with any category under these custom models, at this timePageIdRecords the ID of the category. As for directly linking to a custom content model.List page (non-category)This usually belongs to the category of 'built-in links', generated by the system through model aliases and other methods at this timePageIdusually will not take effect.

Related articles

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 is the display order of AnQiCMS navigation menu items managed and adjusted in the backend?

As an experienced website operation expert, I am well-versed in all the functions of AnQiCMS, especially its design concepts in content management and user experience optimization.Today, let's delve into a seemingly simple but crucial feature for website structure and user experience: how the display order of AnQiCMS navigation menu items is managed and adjusted in the background.A clear and logical navigation menu is the foundation of a successful website.It not only helps users find the information they need quickly, but it is also an important basis for search engines to understand the structure of websites.

2025-11-07

How to get the link address and display name of the navigation item in the AnQiCMS template?

As an experienced website operations expert, I am well aware of the importance of an efficient and flexible CMS system for content operations.AnQiCMS with its powerful performance in Go language and the ease of use of the Django template engine indeed provides us with great convenience.Today, let's delve deeply into an important topic in website template development: how to accurately obtain the link address and display name of navigation items in AnQiCMS templates?

2025-11-07

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

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

## Mastering Multi-Site Navigation: Deep Analysis of AnQiCMS `navList` Tag and `siteId` Parameter In today's complex and ever-changing network environment, many businesses and content operators are no longer satisfied with a single-site operation model.Brand extension, regional station, independent product line display, all催生了the need for multi-site management.AnQiCMS (AnQiCMS) is a system specifically designed for enterprise-level content management, deeply understanding this field, and its powerful multi-site management function is exactly to solve this pain point.

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