Does AnQiCMS support displaying the number of articles under each category on the category list page?

Calendar 👁️ 72

When operating a website, we often encounter such needs: when displaying the website category list, we hope to see directly how many articles are under each category.This not only helps visitors quickly understand the richness of a topic's content, improve user experience, but also allows content operators to better plan content strategies, and even has its unique value in SEO optimization.

Then, does AnQiCMS support displaying the number of articles under each category on the category list page? The answer is yes, and it is very convenient to implement.

In AnQiCMS template design, if you want to clearly display how many articles are included under each category in the category list page, it is actually very intuitive.This is mainly due to the powerful and flexible template tag system of AnQiCMS.Built-in systemcategoryListThe tag is designed to obtain the category list, and it also thoughtfully includes the number of articles under each category when returning each category information.

In particular, when you loop through the category list in a template, for example, using{% categoryList categories with ... %}such tags to get the category data,categorieseach variable initemEach one represents a specific category and carries rich classification information. Among them, there is one namedArchiveCountThe field. This field accurately records the total number of documents under this category (including its subcategories).

This means that you do not need to perform additional database queries or complex logical processing. When you retrieve and display category names, category links, and other information in the template, you simply need to call{{ item.ArchiveCount }}It can display the corresponding number of articles on the page, for example, showing as "Technical Articles (123)" or "Product Cases (45)."}This built-in support greatly simplifies the development and maintenance workload.

It is worth mentioning,categoryListThe tag itself supports various parameters to finely control the range of categories obtained, such as bymoduleIdTo specify the retrieval of only specific content models (such as article models or product models) categories, or byparentIdLimit to retrieve only the child categories under a certain parent category. No matter how you filter and organize the categories,ArchiveCountthe field will provide the exact number of articles under the corresponding category.

This is not just a technical convenience, but also a profound understanding of the actual needs of website operation.Clear number display of articles, can guide users to discover more interesting content, reduce the bounce rate;At the same time, it also helps content operators to quickly identify which categories are hot topics and which may have sparse content and need to be supplemented, thus more efficiently adjusting content updates and promotion strategies.This out-of-the-box capability is exactly the embodiment of AnQiCMS' commitment to providing an efficient, customizable, and easy-to-expand content management solution.

In essence, AnQiCMS, with its carefully designed template tags and flexible content model, makes it a simple and practical feature to display the number of articles on the category list page, effectively supporting the management and presentation of website content.


Frequently Asked Questions (FAQ)

  1. Is this article count statistics updated in real time?Yes, in AnQiCMSArchiveCountThe field is dynamically retrieved, it will query the number of articles under this category in the database in real time.This means that after you publish, delete, or move an article, the number of articles displayed on the category list page will be updated immediately to ensure the accuracy of the information.

  2. If there are no articles under a category currentlyArchiveCountwhat will be displayed?If there are currently no articles under a category,ArchiveCountIt will be displayed naturally0. You can make a judgment in the template based on this value, for example, ifArchiveCountFor 0, you can choose not to display the article count or show prompts like 'No articles' to keep the page neat or provide a more friendly user hint.

  3. Can I incategoryListCount the number of categories under a specific content model (such as 'product' rather than 'article')?Absolutely.categoryListTag supportmoduleIdParameters, you can go throughmoduleId="1"(Assuming the ID of the article model is 1) ormoduleId="2"(Assuming the product model ID is 2) to specify the category list you want to retrieve. This is, ArchiveCountThe field will only count the number of articles under the specified model, providing you with more accurate content statistics.

Related articles

How to call and display the title and link of the previous and next articles on the article detail page?

In AnQiCMS, adding navigation for the previous and next articles on the article detail page is an important step to improve the user reading experience and optimize the internal link structure of the website.This feature not only guides readers to continue browsing related content, but also helps search engines better understand the website structure.AnQiCMS's powerful template system provides a very convenient way to meet this requirement.### AnQiCMS Template Basics Review The AnQiCMS template system is simple and efficient, using syntax similar to Django, allowing developers to build pages intuitively

2025-11-09

How to use AnQiCMS's pseudo-static rules to optimize the display structure of article URLs to improve SEO?

In website operation, the URL is not only the entrance for users to access content, but also an important basis for search engines to understand and crawl website content.A clear and semantically friendly URL can significantly improve user experience and website performance in search engines.One of the key factors to achieve this goal is to skillfully use pseudo-static technology.AnQiCMS as a high-efficiency and customizable content management system, fully considers the needs of SEO optimization, and provides powerful and flexible pseudo-static rule configuration functions. Today

2025-11-09

How does the multi-site feature of AnQiCMS affect the display and switching of front-end content?

When using a website content management system, the multi-site feature has always been a topic of concern.It not only concerns the operational efficiency, but also directly affects the organization, display of website content, and the smooth switching experience of users between different sites.For AnQiCMS users, its powerful multi-site feature is the tool to solve these challenges.Let's delve into how the multi-site feature of AnQiCMS affects the display and switching of front-end content.One of the design初衷 of AnQiCMS is to meet the needs of users managing multiple brands, sub-sites, or multilingual content

2025-11-09

How to use template tags to dynamically display the associated Tag list in article content?

How can we make users see the related keywords or topic list in an article at a glance while browsing, so as to guide them to discover more interesting content and thus improve user experience and website stickiness, which is an important link.AnQiCMS (AnQiCMS) provides powerful template tag features, allowing you to easily display related Tag lists dynamically in article content, which is both beautiful and practical.**Understanding the Tag Function of AnQi CMS** Tags in AnQi CMS are not just simple classifications of articles

2025-11-09

How to set up a dynamic carousel effect for the Banner image on the homepage of AnQiCMS website?

In AnQiCMS, setting a dynamic banner slideshow on the homepage can effectively enhance the visual appeal of the website and convey key information.AnQiCMS provides flexible and intuitive features to help us achieve this goal.Next, we will step by step understand how to set up from the background to the front-end template editing, creating an animated carousel effect for the homepage.### 1. Backend configuration of Banner image: Content and grouping Firstly, we need to prepare the images and relevant information for the carousel in the AnQiCMS backend

2025-11-09

How to control the number of characters displayed for the article abstract (Description) in the list and automatically add an ellipsis in AnQiCMS?

When operating website content, the display length of the article summary (Description) on the list page is crucial for the neatness of the page and the user experience.A long summary can make the page look bloated and difficult to browse quickly, while a short one may not attract readers to click.AnQiCMS as a feature-rich content management system, provides flexible template tags and filters, allowing us to easily implement precise control over the word count displayed in article summaries and automatically add elegant ellipses.###

2025-11-09

How to implement conditional judgment in a template, for example, whether to display an image based on whether the article has a thumbnail?

In website content presentation, images play a crucial role.However, not all content has corresponding thumbnails, or for design aesthetics and loading speed considerations, we may need to decide based on the actual situation whether to display images, or even display different placeholders.AnqiCMS provides a flexible and powerful template engine, allowing us to easily implement this conditional image display logic, thereby enhancing the flexibility and user experience of website content.This article will focus on how to decide whether to display an image in the AnqiCMS template based on whether the article has a thumbnail

2025-11-09

How to correctly render Markdown-formatted article content as HTML and display mathematical formulas in AnQiCMS?

In AnQi Content Management System (AnQiCMS), we are committed to making content creation and display more flexible and efficient.For users accustomed to writing articles in Markdown format, we provide powerful support, ensuring that Markdown content is correctly rendered into HTML, and can easily handle complex mathematical formulas and flowcharts, bringing vitality to technical documents, tutorial articles, and other content.### Enable Markdown Editor: The First Step of Content Creation Enjoy Markdown Convenience in AnQiCMS

2025-11-09