The display order of the website content list is one of the key factors that affect user experience and content operation effectiveness.An excellent CMS system should provide a flexible sorting mechanism, allowing operators to freely adjust the presentation of articles based on content characteristics and promotional strategies.Our CMS is well-versed in this, providing users with various ways to sort article lists to help you accurately control content exposure and traffic direction.

Core sorting function: archiveListThe powerful application of tags

In Anqi CMS, the sorting of article lists is mainly through the template in thearchiveListThe tag to implement. This tag is the core of content display, it can not only help us retrieve articles under different conditions, but also through itsorderParameters, for precise sorting control of the retrieved content.

  • Sorted by publication time (id desc):This is the most common and intuitive sorting method. In Anqi CMS, you can set uporder="id desc"To implement the latest released articles to be displayed at the top. The system assigns a unique ID to each article, usually, the larger the ID, the later the publication time of the article.Therefore, by arranging in descending order by ID, it can easily present the 'Latest Articles' list, ensuring that users can always see the freshest content.If you want to sort by publication time from old to new, you can useid asc.

  • Sort by view count(views desc):For websites that want to highlight popular content and attract more attention, sorting by view count is undoubtedly**the choice. Anqi CMS supportsorder="views desc"Let those popular articles automatically rise to the top of the list.This sorting method can effectively utilize the "Matthew effect" to recommend high-quality and popular content on the website to more visitors, enhancing the overall activity and value of the content. Conversely,views ascIt will display the article with the least views.

  • custom sorting by backend (sort desc):In addition to the automatic sorting rules generated by the system, AnQi CMS also provides high flexibility, allowing you to manually sort articles in the background. Once you have set the custom sorting value for articles in the background management interface, you canorder="sort desc"(orsort ascThis approach is especially suitable for scenarios where manual adjustment of the order is required to prioritize content or for thematic recommendations or key promotions.

How to apply sorting rules in the template

The settings of these sorting rules are very intuitive, they act asarchiveListThe label parameters can be directly configured 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 views, 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 the article list 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 interest, and seasonal hotspots.Whether it is pursuing time-sensitive news information, emphasizing hot topics in blog articles, or needing personalized recommendation product lists, corresponding solutions can be found in Anqi CMS, thereby effectively improving user stickiness, page stay time, and ultimately helping the website achieve better operational goals.

Conclusion

AnQi CMS is committed to providing users with an efficient and flexible content management experience.Sorting the article list in multiple dimensions provides powerful tools for content operators, allowing content to reach the target users in the most appropriate way, thereby maximizing its value.


Frequently Asked Questions (FAQ)

Q1: In addition to the article list, does AnQi CMS support sorting of the product list?A1: Yes, the content model design of Anqi CMS is highly flexible. The product list can also be accessed througharchiveListLabel (when the product is set to a content model) or similar label, utilizingorderThe parameter implements the same sorting method as the article list, for example, by ID (publish time), views, or custom sorting.

Q2: How can I display two lists, 'Latest Articles' and 'Popular Articles', on a single page?A2: You can use two labels separately in the same template filearchiveListto call the article. Set the first label toorder="id desc"to get the latest article, set the second label toorder="views desc"Get popular articles. Distinguish these two lists by different variable names (such aslatestArticlesandhotArticles), and display them separately.

Q3: How is the 'Backend Custom Sorting' operation performed, and what application scenarios does it have?A3: Custom sorting in the background usually occurs on the article or product editing page where there is a 'sort value' or 'weight' field. You can adjust the relative position of the article in the list by modifying this number (the smaller the number, the closer to the front it is, depending onorder="sort desc/asc"The setting). This sorting method is very suitable for the home page recommendation position, special article arrangement, or when you need to manually control the display priority of several specific articles.