As an expert well-versed in website operation and familiar with all the functions of AnQiCMS, I often encounter various inquiries about the presentation of content. Today, we will delve into a common yet challenging requirement: 'Is it possible to...'categoryListDoes the tag implement a classification list based on alphabetical index?

On many content-rich websites, especially those with a large number of product categories, biographical entries, or specialized terminology, a categorized index list arranged alphabetically can greatly enhance the efficiency of users in finding information and the overall browsing experience.It not only optimizes the information architecture but also provides users with an intuitive and fast navigation method.categoryListCan the tag directly meet this requirement?

AnQiCMS Classification List TagcategoryListCore Function Analysis

Let's review the basic introduction of AnQiCMS first.categoryListThe basic positioning and function of tags. As the name suggests,categoryListThis is a core tag provided by AnQiCMS for template developers, used for conveniently obtaining and displaying the website category list.It is designed to help us present the carefully set up classification system on the website front-end in a flexible and varied manner.

By referring to the official documentation of AnQiCMS, we can seecategoryListLabel supports a series of parameters, which allows us to finely control the classified data obtained:

  • moduleIdSpecify to fetch specific content models (such as article models, product models) and their categories.
  • parentIdUsed to filter subcategories under a specific parent category, or throughparentId="0"to obtain all top-level categories, evenparentId="parent"Get the siblings of the current category.
  • allA boolean parameter to get all categories under the specified model.
  • limit: Controls the number of categories returned, can also be specified throughoffsetpatterns (such aslimit="2,10")To skip the first few and get a specified number of categories.
  • siteId:Used in multi-site management scenarios to specify which site's data to retrieve.

These parameters undoubtedly grantcategoryListThe powerful filtering and positioning capabilities can help us build a hierarchical navigation menu, category display blocks under specific models, and more. However, when we carefully examine these parameters, we will find a key missing: incategoryListThe parameter list of the tag does not provide,any direct function related to 'alphabetical index sorting' or 'filtering by first letter'.In other words, it does not have functions such asorderBy="firstLetter"orgroupBy="firstLetter"Such parameters also cannot directly specify to only display categories starting with the letter 'A'. In addition,categoryListeach category returned by the labelitemobject does not include such initial letter fields asFirstLettersuch as this.

Therefore, unfortunately, in the current version of AnQiCMS, it is not possible to directly implement a classification list based on alphabetical index just bycategoryListthe built-in functionality of tags.This conclusion may cause some operators some inconvenience, but by understanding its design positioning, we can also find alternative solutions.

Why do we need a categorized list with letter indexes?——User Experience and Information Architecture from the perspective of operations

AlthoughcategoryListThe label does not directly provide this feature, but from the perspective of website operation, the alphabetical index classification list indeed has irreplaceable value in certain scenarios:

1.