The display order of website content lists is one of the key factors affecting user experience and the effectiveness of content operation.An excellent CMS system should provide a flexible sorting mechanism, allowing operators to freely adjust the presentation of articles according to content characteristics and promotion strategies.AnQi CMS is well-versed in this, providing users with various ways to sort article lists, helping you accurately control the exposure and traffic guidance of content.
Core sorting feature:archiveListThe powerful application of tags
In the AnQi CMS, the sorting of the article list is mainly through the template inarchiveListThis tag is the core of content display. It not only helps us retrieve articles under different conditions but also through itorderParameters, for precise sorting control of the content retrieved.
Sorted by publish time (
id desc):This is the most common and intuitive sorting method. In Anqi CMS, you can setorder="id desc"To implement the latest released articles at the top.The system assigns a unique ID to each article, typically, the larger the ID, the later the article was published.Therefore, by sorting by ID in descending order, it can be easily presented as a 'Latest Articles' list, ensuring that users can always see the freshest content.id asc.Sort by views ()
views desc):For websites that want to highlight popular content and attract more attention, sorting by views is undoubtedly **the choice. Anqi CMS supportsorder="views desc"Let those articles with high popularity automatically float to the top of the list.This sorting method can effectively utilize the 'Matthew effect' to recommend high-quality and popular content of the website to more visitors, thereby enhancing the overall activity and content value of the website.views ascThen the articles with the least views will be displayed.Sorted by custom order in the background (
sort desc):In addition to the automatically generated sorting rules, Anqi CMS also provides high flexibility, allowing you to manually sort articles in the background. After you set a custom sorting value for the articles in the backend management interface, you can then accessorder="sort desc"(or}sort ascApply these manual adjustments in the specified order. This method is particularly suitable for scenarios that require human intervention in content priority, such as thematic recommendations or key promotions.
How to apply sorting rules in templates
These sorting rules are very intuitive, they act asarchiveListThe parameters of the tag, configured directly in your template file. For example, if you want to display the latest 10 articles in an article list area, the template code may be similar to:
{% archiveList archives with type="list" limit="10" order="id desc" %}
{% for item in archives %}
<li><a href="{{item.Link}}">{{item.Title}}</a> - {{stampToDate(item.CreatedTime, "2006-01-02")}}</li>
{% endfor %}
{% endarchiveList %}
If you want to display the top 5 articles with the highest view counts, you can write it like this:
{% archiveList hotArchives with type="list" limit="5" order="views desc" %}
{% for item in hotArchives %}
<li><a href="{{item.Link}}">{{item.Title}}</a> - 浏览量: {{item.Views}}</li>
{% endfor %}
{% endarchiveList %}
By adjustingorderThe value of the parameter allows you to display article lists in different areas of the website with different logic, greatly enriching the diversity of content presentation.
The operational value brought by flexible sorting
These flexible sorting options provided by Anqi CMS are not only technical features, but also powerful tools for content operation.It allows you to dynamically adjust content display strategies based on various factors such as content lifecycle, user interests, and seasonal hotspots.Whether it is pursuing timely news information, emphasizing hot topics in blog articles, or needing personalized product recommendations, all corresponding solutions can be found in Anqi CMS, effectively enhancing user stickiness, page stay time, and ultimately helping the website achieve better operational goals.
Concluding remarks
The Anqi CMS is dedicated to providing users with an efficient and flexible content management experience.By sorting the article list in multiple dimensions, it provides content operators with powerful tools, allowing content to reach the target audience in the most appropriate way, thereby maximizing its value.
Common Questions (FAQ)
Q1: Besides the article list, does the Anqi CMS support sorting the product list?A1: Yes, the content model design of AnQi CMS has high flexibility. The product list can also be customized.archiveListLabels (when a product is set to a content model) or similar labels, usingorderParameters implement the same sorting method as the article list, such as by ID (publish time), views, or custom sorting.
Q2: How can I display both the 'Latest Articles' and 'Popular Articles' lists on the same page?A2: You can use two tags separately in the same template file.archiveListTo call articles, set for the first tag.order="id desc"To get the latest articles, set for the second tag.order="views desc"Get popular articles. Distinguish these two lists by different variable names (such aslatestArticlesandhotArticles) and display them separately.
Q3: How is the 'Custom Sorting in Background' operation performed, and what are its application scenarios?A3: Custom sorting on the backend is typically available in the article or product editing page with a 'Sort Value' or 'Weight' field. You can adjust the relative position of the article in the list by modifying this number (usually, the lower the number, the closer to the front, depending on)order="sort desc/asc"The setting). This sorting method is very suitable for home page recommendations, feature article arrangements, or when you need to manually control the display priority of a few specific articles.