AnQiCMS as a system focusing on efficient content management, its navigation function is an important bridge for users to interact with the website content.An elegantly designed and powerful navigation system that can significantly enhance the usability and user experience of the website.PageIdField is a critical element, which is used to implement navigation and deep integration with the internal content of the website in specific situations.
When we set the website navigation in the AnQiCMS backend management interface,PageIdThe field is part of each navigation link data structure. Its main function is to store a numeric ID pointing to a specific content entity within the AnQiCMS system. According tonavListThe document description of the label, this field will be assigned when the administrator chooses to set the 'Link Type' of the navigation item to 'Category Page Link'.
To be specific,PageIdThe field is filled 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 allowing administrators to precisely select one from the existing category list (e.g., 'Company News', 'Product Showcase') or single-page list (e.g., 'About Us', 'Contact Us').PageIdfield in.
PageIdThe true value lies in its ability to provide dynamic access to associated content for front-end templates. ThroughnavListthe navigation data obtained by the tag, front-end developers can detect each navigation item'sPageIdDoes it exist. IfPageIdthere 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 list of categories), further query and display the 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 this navigation item isPageIdThe 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 itsPageIdascategoryIdparameter, to callarchiveListLabels, dynamically display the latest or popular product documents under this product category below the navigation item or in the submenu.This mechanism makes navigation more than just simple page jumps, but also an intelligent content aggregation and display entry.
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 the main category in its dropdown menu, then this first-level navigation item is...PageIdIt comes in handy. Template developers can utilize itPageIdas the parent ID (parentId) to callcategoryListLabel, dynamically generate and display the list of these secondary subcategories, thereby constructing a multi-level navigation structure with more hierarchy and user-friendliness.
UnderstandPageIdThe function, also helps us better understand the differences in different types of navigation links in AnQiCMS.
- Built-in Links:For example, links to the homepage of a website or a specific model's homepage (such as an article model or product model) homepage, these are system presets of general links that do not directly relate to specific categories or single pages, therefore their
PageIdThe field is usually empty or does not have actual meaning. - External links:When the navigation item points to an arbitrary external URL,
PageIdThe field will not be used because this link does not have a direct binding relationship with any content entity within AnQiCMS.
Therefore,PageIdIs a unique mechanism of AnQiCMS, which is specifically designed to serve the need of accurately binding navigation menu items with internal structured content (categories or single pages). It makes use ofPageIdThe 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 does the navigation link I set point to a certain 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" of the AnQiCMS backend.Ensure that the 'Link Type' is clearly set to 'Category Page Link', and that you have indeed selected a specific category or single page in the dropdown menu.PageIdThe field will not be assigned by the system either. - Q:
PageIdIs the field directly used to obtain the details of a specific document?A:PageId通常存储的是AnQiCMS系统中的分类或单页面的ID,而非具体文档的ID。If you want to navigate directly to a specific document via a navigation link, you usually choose the "External Link" type and manually fill in the complete URL of the document.PageIdGet the category ID and use it further.archiveListQuery the documents under the category with tags. - Q: If a navigation item links to a category, how can I use it in the template?
PageIdGet the details of the category (such as title, description, etc.)?A: You can use the AnQiCMS providedcategoryDetailtags, and pass the navigation item parameters,PageIdasidto 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 classification.