prevArchiveWhy does the label not providecategoryIdormoduleIdsuch filtering parameters? This is a topic.
Firstly, we need to be clearprevArchiveandnextArchiveThe core positioning of these tags.They are in Anqi CMS, as the name implies, they are used to implement the "Previous" and "Next" navigation functions on the document detail page.When you browse a specific article or product detail page, the responsibility of these two tags is to provide you with a smooth, sequential navigation experience based on the current document.The strength lies in the fact that the system can intelligently identify the current document without manually specifying a category or model, and automatically find the previous or next content that is 'adjacent' to it.
Then, what is the core reason? In my opinion, there are mainly the following aspects:
1. Focus on context navigation, keeping it concise and efficient
prevArchiveandnextArchiveThe design philosophy isContext-aware (Context-Aware).This means that their operations are tightly centered around the "current document being browsed".relatedof, in some default sorting, the document that immediately follows or is immediately before it. If allowed to addcategoryIdormoduleIdprevArchiveandnextArchiveMaintain the pure 'linear' navigation function, ensuring it is simple, intuitive, and efficient.
2. Avoid logical conflicts and performance损耗
Imagine ifprevArchiveSupportcategoryIdParameter, while the current document A belongs to category X, you want to get the previous document in category Y.This will cause the system to jump out of the current document category or model, and perform a global, complex query with filtering conditions.This query is executed every time the user clicks "Previous" or "Next", undoubtedly increasing the server load and affecting the website's response speed and overall performance.AnQi CMS, as a content management system that focuses on high performance, will avoid unnecessary complex queries in design, especially in the navigation functions that users operate frequently.
3. Define functional boundaries, each with its own label system
The AnQi CMS template tag system is modular and clear in its responsibilities. If your goal is to obtain aspecific category or model underThe document list, and if you want to perform more flexible sorting or filtering, then Anqi CMS provides more powerful featuresarchiveList.archiveListTags support rich parameters, such ascategoryId(specified category ID),moduleId(Specify Model ID),order(Sorting method),flag(Recommended attribute) evenq(Search keywords) etc., to meet your needs to build various complex document lists.
prevArchiveandnextArchiveIt is like a small boat in the river of documents, only responsible for sailing upstream or downstream, andarchiveList
In summary,prevArchiveandnextArchiveThe reason why tags do not providecategoryIdormoduleIdarchiveListTags are the tools you should choose.
Frequently Asked Questions (FAQ)
prevArchiveandnextArchiveWhat is the sorting criteria for the default 'Previous'/'Next' tags?Generally speaking,prevArchiveandnextArchiveHow should I implement 'Previous document under the current category'?
prevArchiveHow do I handle this unsupported requirement?In this case, you need to combinearchiveListtags to achieve this. First, get the currentCategoryIdThen usearchiveListtags, pass in the currentCategoryIdand appropriateorderParameters (for exampleorder="id desc"ororder="createdTime desc"Set it uplimitandoffsetSimulate the logic of "Previous article". This usually requires some template logic to determine the position of the current document in the list, and then retrieve the previous element, which will be more complicated than usingprevArchiveA bit more complex, but it can meet specific needs.archiveListWhat parameters do tags have that can be used for classification and model filtering?archiveListTags provide very rich filtering parameters, including but not limited to:moduleId(Filter by content model ID),categoryId(Filter by category ID),flag(Filter by recommended attributes, such as headlines, recommendations, etc.),order(Filter by ID, views, custom sorting, etc.),typeList type, such as paginationpageor a fixed numberlist)、q(Search keywords), as well as custom parameters for advanced filtering, etc. The combination of these parameters can build a highly customized content list.