AnQiCMS is a system focused on efficient content management, and its navigation function is an important bridge for users to interact with website content.A well-designed and powerful navigation system that can significantly improve the usability and user experience of the website.In the AnQiCMS navigation link configuration,PageIdThe field is a key element that is used in certain cases to achieve deep integration with navigation and the internal content of the website.

When we set up the website navigation in the AnQiCMS admin interface,PageIdThe field is part of the structure of each navigation link. Its main purpose is to store a numerical ID pointing to a specific content entity within the AnQiCMS system. According tonavListThe tag's documentation note, this field is assigned when the administrator chooses to set the 'link type' of the navigation item to 'category page link'.

To be specific,PageIdThe scenario where the field is filled occurs when the website administrator decides to associate a navigation link directly with a "category" or "single page" created in the AnQiCMS system.In the "Website Navigation Settings" feature on the backend, when editing or creating a new navigation link, if the "Link Type" is selected as "Category Page Link", the system will provide an option for administrators to accurately select one from the existing category list (such as "Company News", "Product Display") or a single page list (such as "About Us", "Contact Us").Once the selection is complete, the unique ID of the selected category or single page will be automatically stored in the corresponding navigation item.PageIdin the field.

PageIdThe true value lies in its ability to provide dynamic access to associated content for front-end templates. ThroughnavListnavigation data obtained from the tag, front-end developers can detect each navigation item'sPageIdDoes it exist. IfPageIdIf there is a value, you can use this ID, combined with other content tags provided by AnQiCMS (such asarchiveListUsed to get the document list,categoryListUsed to obtain the category list, further query and display rich content associated with the navigation item.

For example, if a website's navigation menu item is configured to link to a product category, then the navigation item'sPageIdThe ID of the product category will be stored. In the front-end template, we can iterate over the navigation list, and when we identify the navigation item linked to the product category, we can use it.PageIdascategoryIdThe parameter, callarchiveListLabel, dynamically display the latest or popular product documents under the product category below this navigation item or in the submenu.This mechanism makes navigation more than just a simple page jump, but also becomes an intelligent content aggregation and display entrance.

Another common application is to build multi-level navigation menus. If a first-level navigation item links to a main category and we want to display all the second-level subcategories under that main category in its dropdown menu, then the first-level navigation item'sPageIdIt came in handy. Template developers can make use of itPageIdAs the parent ID (parentId), callingcategoryListLabel, dynamically generate and display the list of these secondary subcategories, thereby building a multi-level navigation structure with more hierarchy and user-friendliness.

UnderstandPageIdThe function, also helps us better understand the differences in the different types of navigation links in AnQiCMS.

  • Built-in links:For example, links pointing to the homepage of a website or the homepage of a specific model (such as an article model or product model), these are system preset general links that do not directly associate with specific categories or single pages, therefore theirPageIdThe field is usually empty or has no actual meaning.
  • External links:When the navigation item points to an arbitrary external URL,PageIdThe field is not used because this link does not have a direct binding relationship with any content entity within AnQiCMS.

Therefore,PageIdIs a mechanism unique to AnQiCMS, which is specifically designed to serve the need to accurately bind navigation menu items to internal structured content (categories or single pages). By ingeniously utilizingPageIdThe website operator can build a more intelligent, flexible, and easy-to-maintain navigation system, effectively improving the efficiency of user content discovery and the overall browsing experience.

Frequently Asked Questions

  • Q: Why is my navigation link pointing to a category, but the field obtained in the template is empty?PageIdThe field is also not assigned by the system.A: Please check the configuration of the navigation link in the "Website Navigation Settings" on the AnQiCMS backend.Ensure that the "link type" is clearly selected as "category page link" and that you have indeed selected a specific category or single page from the drop-down menu.If the selected type is "Internal Link" or "External Link", even if the link ultimately points to a category page,PageIdThe field is also not assigned by the system.
  • Q:PageIdCan the field be used directly to obtain the details of a specific document?A:PageIdThe value stored is usually the category or single page ID in the AnQiCMS system, not the specific document ID.If you want to navigate directly to a specific document through a navigation link, you usually choose the 'External Link' type and manually fill in the complete URL of the document.Of course, in the front-end template, you can first navigate through the navigation item'sPageIdGot the category ID, use it furtherarchiveListTag query the documents under the category.
  • Q: If a navigation item links to a category, how can I utilize it in the template?PageIdTo obtain the details of the category (such as title, description, etc.)?A: You can use the AnQiCMS providedcategoryDetailtags, and pass the navigation item'sPageIdasidparameters to get the detailed information of the category. For example,{% categoryDetail navCategory with id=item.PageId %}, and then you can go throughnavCategory.Title/navCategory.DescriptionUsing variables to obtain the title and description of the category and other data.