How does AnQi CMS filter and display content based on the document's Flag attribute (such as headline, recommended)?

Calendar 👁️ 66

In AnQiCMS (AnQiCMS) content management system, effectively organizing and displaying content is the key to enhancing website attractiveness and user experience.Among them, the Flag attribute (recommended attribute) function of the document, as if marking the content with a special 'tag', allows you to flexibly filter and highlight important or specific types of content according to your operational needs.

What is the document Flag attribute?

The document's Flag attribute, also known as the recommendation attribute, is a content classification and display mechanism provided by Anqi CMS.It allows content managers to assign one or more preset special tags to each document to indicate the importance, display format, or specific position of the content on the website.These properties are identified by letters in the background, making it easy to accurately call them in the front-end template.

Safe CMS currently supports the following common Flag attributes:

  • Headline[h]It is commonly used to mark the most important and most concerned news or articles on the website, suitable for displaying in a prominent position in a lengthy manner.
  • Recommended[c]: Indicates that the content has certain recommended value, suitable for appearing in ordinary recommendation areas, such as sidebar recommendations, article bottom related recommendations, etc.
  • Slide[f]This content is often used in website carousel or focus image areas, mainly with images to attract user clicks.
  • Featured[a]:Has higher priority than normal recommendations, suitable for special content or key content modules that need to be emphasized.
  • Scrolling[s]: Suitable for text lists that need to be scrolled, such as news announcements and friend links.
  • Image[p]: Marked as documents containing images, convenient for filtering in pure image lists or mixed image-text lists.
  • Jump[j]: It is usually used to mark documents that will jump to external links or other specific pages within the site when clicked.

These Flag attributes grant you fine-grained control over the way content is displayed, which is an important means of achieving differentiated content operations.

How to set the Flag attribute when editing content?

On the Anqi CMS backend management interface, setting the document's Flag attribute is very intuitive.When you create or edit a document, you will find the 'Recommended Properties' option on the document details page.Here, all available Flag properties will be listed in the form of a checkbox.

You can select one or more properties based on the actual situation of the document and the expected display effect. For example, an article that you want to appear both in the headline area of the home page and in the ordinary recommendation module can select "Headline" at the same time[h]And recommend[c]If some content does not require any special markings, keep all checkboxes unchecked.This flexible setting allows you to easily manage the exposure and display of content.

How to filter and display Flag content in the front-end template?

After setting the Flag attribute, the next step is to filter and display these contents on the website front-end through template tags. Anqicms provides powerfularchiveListThe tag is the core of implementing content filtering for Flag.

ByarchiveListin the labelflagParameters, you can specify to display only documents with specific Flag attributes. For example, if you want to display all 'recommended' content in a module of the website, you can write it like this in the template:

{% archiveList archives with type="list" flag="c" limit="10" %}
    {% for item in archives %}
        <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
    {% endfor %}
{% endarchiveList %}

This code will retrieve a list of document collections that only contain documents marked as \[c]\flagWhen filtering parameters, you can only specify one letter identifier for the Flag attribute at a time. If you need to display the content of multiple Flag attributes in an area, you need to use multiple

Related articles

How to add multi-dimensional parameter filtering function for the product list page in Anqi CMS and display the filtering results?

In modern e-commerce and content display websites, providing multi-dimensional parameter filtering functions for product lists has become a key factor in improving user experience and conversion rates.Visitors can quickly locate the products they need based on their own needs, not only saving time but also significantly improving the usability of the website.For users of AnQiCMS, implementing such a feature is not difficult. The built-in powerful functions and flexible template tags make the whole process intuitive and efficient.This article will delve into how to add multi-dimensional parameter filtering functions to the product list page in Anqi CMS

2025-11-08

How to display the current year or time in a specific format in AnQi CMS template?

In website operation, it is a common requirement to flexibly display the current year or format specific time, whether it is the automatic update of the year in the copyright statement or the clear display of the publication time on the article detail page.AnQiCMS provides two main ways to meet these needs, they are both simple to use and follow the elegant time handling of the Go language.### Method 1: Directly retrieve and display the current year or time (`{% now %}` tag) When you need to directly retrieve and display the current year or the current time down to the second in the template

2025-11-08

Does AnQi CMS provide an integrated JS statistics code calling tag for easy display on the page?

When using AnQiCMS, many users are concerned about how to conveniently integrate third-party JavaScript statistical codes into web pages, such as Baidu Statistics, Google Analytics, and so on.About this, AnQiCMS indeed provides built-in mechanisms and flexible template tags, allowing you to easily call and display these statistics codes on your website.### Using built-in JS code to call tags AnQiCMS to meet the needs of website operators to integrate third-party scripts

2025-11-08

How can AnQi CMS use the 'time factor' feature to display future published content?

How to efficiently and strategically publish content in today's fast-paced content environment is a question that every content operator is thinking about.Maintain the consistency and foresight of content publication, which can not only enhance the user experience but also effectively promote brand communication and search engine optimization.AnQi CMS deeply understands this, and its 'Time Factor' feature was born for this very purpose, providing content creators and operation teams with a precise tool to control the timing of content release.## Precise Planning: The Foundation of Content Operation We have all faced such a situation: writing an精心 prepared article

2025-11-08

How to manage and display custom page Banner carousel in Anqi CMS?

In website operation, a beautiful page banner carousel is a key element to attract visitors' attention, convey important information, and enhance brand image.AnQiCMS provides a flexible and intuitive way to manage and display these visual contents, whether you want to set up a Banner for the homepage, a specific page, or a category page, it can be easily achieved.### Manage Custom Banner Carousel AnQi CMS allows you to set exclusive banners for different content types, mainly divided into banners for specific pages

2025-11-08

How to implement the like function for comments in Anqi CMS and update the display of likes in real time?

In website operation, user interaction is a key link in enhancing community activity.The like comment feature not only encourages user participation, but also helps website administrators identify popular comment content.For websites using AnQiCMS, to implement this feature and update the like count in real time, it can be done through the built-in template tags and a bit of front-end JavaScript code.### Comment Function Basics: How to Display Comment Lists The core of the comment function in AnQi CMS lies in the `commentList` template tag

2025-11-08

How to safely output rich text content containing HTML tags in Anqi CMS template?

In website operation, rich text content is widely used in articles, product introductions, and single-page scenarios due to its rich expression, such as inserting images, custom font styles, and tables.AnQi CMS as an efficient content management system also fully supports the editing and storage of various rich text content.However, rich text content, while bringing convenience, also hides a non-negligible security challenge - how to safely output this content containing HTML tags in templates to prevent potential cross-site scripting attacks (XSS)

2025-11-08

How to implement independent content management and unified display for multi-sites in AnQiCMS?

How to implement independent content management and unified display for multiple sites in AnQiCMS?In today's rapidly changing internet environment, many enterprises and content operators face the challenge of managing multiple websites.Whether it is to have multiple brands, product lines, or to create independent content portals for different markets and audiences, efficiency and convenience are always the key.The traditional approach is often to deploy a separate system for each website, which not only increases maintenance costs but also makes content management and data integration extremely complex.AnQiCMS provides an elegant and efficient solution

2025-11-08