How to display recommended attributes of documents (such as headlines, sliders) on the website front-end?

Calendar 👁️ 59

In content operation, displaying important or recommended content in a prominent way to visitors is the key to improving user experience and the efficiency of content reach.AnQiCMS (AnQiCMS) offers a powerful "recommendation attribute" feature that allows you to easily mark and manage different types of featured content, such as setting it as a top article, slideshow display, or other specific recommendations.

This article will introduce how to effectively present these recommended properties of documents on the front end of Anqi CMS websites.


1. Understand the recommended properties of Anqi CMS documents

Firstly, we need to clarify what the 'recommended attributes' in Anqi CMS are, as well as how they are set up in the background.

In the AnQi CMS backend management interface, when you add or edit documents, you will find an option called "recommended properties".Here is a list of various preset attributes such as headlines, slides, recommendations, etc., each attribute corresponds to a specific letter identifier, which is convenient for the system to recognize and call.You can select one or more recommended attributes for the document based on the nature of the content.

These commonly used recommended attributes and their letter identifiers include:

  • Headline[h]This is usually used for the most important and most concerned news or articles on the website homepage.
  • Recommended[c]It refers to the selected and worth-paying attention to the content edited.
  • Slide[f]: Content suitable for display in a carousel or slideshow, usually accompanied by exquisite images.
  • Featured[a]: Content specially recommended, emphasizing its importance more than ordinary recommendations.
  • Scrolling[s]: Suitable for displaying brief content in sidebars, notification areas, and other scrolling forms.
  • Bold[h]: May be shared with the headline.[h]: Indicates that the title or summary of the content should be displayed in bold.
  • Image[p]Emphasize content with images mainly, or thumbnails need to be displayed.
  • Jump[j]Clicking will directly jump to an external link or specified page, not the content detail page.

An important rule is that when calling the front-end of the website, each list (such as an article list module, a slide module) usually can only use one recommended attribute for content filtering.This means that if you want to display the 'Headline' content, you need to set up a specific call area for 'Headline' and cannot filter out both 'Headline' and 'Slide' content within the same call area.


How to call a document with recommended properties in a template

The Anqi CMS template system implements content calls through tags. To display documents with specific recommendation properties, we mainly usearchiveListLabel. This label function is powerful, and it can filter documents based on various conditions, includingflagparameters, which are specifically used to specify recommendation properties.

1. Useflagparameters to filter documents with specific properties

archiveListlabel'sflagParameters allow you to pass in the letter identifier corresponding to the recommended attribute, thus filtering out only the documents that have that attribute.

Example: Call the document list with the 'Headline' attribute.

Assuming you want to display the latest 5 top articles on the homepage of your website, you can write the template code like this:

<div class="headline-section">
    <h2>最新头条</h2>
    <ul>
        {% archiveList archives with flag="h" limit="5" %}
            {% for item in archives %}
                <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
            {% empty %}
                <li>暂无头条文章。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</div>

In this code block:

  • flag="h": means we only want to get the documents marked as "top".
  • limit="5"Limited the number of displayed documents to 5.
  • item.Linkanditem.TitleUsed to obtain the link and title of the document.

Example: Call documents with the 'slideshow' attribute as a carousel.

For a slide, it is usually necessary to display images and titles. At this point, we will use the document'sLogoorThumbfield.

<div class="slideshow-container">
    {% archiveList slideshows with flag="f" limit="3" %}
        {% for item in slideshows %}
            <div class="slide-item">
                <a href="{{ item.Link }}"><img src="{{ item.Logo }}" alt="{{ item.Title }}"></a>
                <h3><a href="{{ item.Link }}">{{ item.Title }}</a></h3>
            </div>
        {% empty %}
            <p>暂无幻灯片内容。</p>
        {% endfor %}
    {% endarchiveList %}
</div>

We used hereflag="f"to filter the slide document and useitem.Logo(usually the large image or main image of the document) to display the image. IfLogonot available or you want to use a thumbnail, you can also useitem.Thumb.

2. Display the recommended attribute text label of the document (showFlag)

Sometimes, you may want to display a small label next to the document title, such as "[Top News]" or "[Recommended]", to clearly inform visitors of the content's attributes. At this point, you canarchiveListthe tag withshowFlag=trueParameter.

<div class="recommended-list">
    <h2>编辑推荐</h2>
    <ul>
        {% archiveList recommendedDocs with flag="c" limit="10" showFlag=true %}
            {% for item in recommendedDocs %}
                <li>
                    {% if item.Flag %}<span class="content-flag">【{{ item.Flag }}】</span>{% endif %}
                    <a href="{{ item.Link }}">{{ item.Title }}</a>
                </li>
            {% empty %}
                <li>暂无推荐内容。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</div>

In the above code,showFlag=trueEnablesitem.FlagThe variable can obtain the recommended attribute text of the document (such as "Top News", "Recommended", etc.). You can beautify it into an eye-catching label or badge according to your CSS style.


Chapter 3: Application cases combining actual scenarios

ByflagFlexible use of parameters, which can create various content display areas for websites:

  1. Homepage "Focus Image" or "Large Image Carousel": Normally filteringflag="f"(Slide) property document, displaying its image and title, forming the most eye-catching area of the website.

  2. Homepage "Top News" module: Filterflag="h"(Headline) Property document, displaying the latest several重磅 articles in list form.

  3. Sidebar "Editor's Recommendation" or "Hot Recommendation": Filterflag="c"(Recommended) orflag="a"Recommended property document, use a concise list of titles to attract users to click.

  4. The "Related Reading" on the article detail pageAlthougharchiveListThe tag itself supportstype="related"To get relevant documents, but you can also combineflagParameters, for example, prioritize displaying those marked as 'recommended' in relevant documents.


4. Optimization and Points to Note

  • Accuracy of property settingsMake sure that the recommended properties set for the document in the background are accurate and meaningful, to avoid random tagging that can lead to confusion in the front-end content.
  • Image size consistency: Especially for slideshows or focus images, it is recommended to upload images of uniform size, or configure the "thumbnail processing method" and "thumbnail size" in the "content settings" of Anqi CMS to ensure a beautiful display on the front end.
  • CSS style beautificationThe template tag is responsible for calling and outputting content, and the specific layout, font size, color, and other visual presentations need to be controlled by CSS styles.
  • Avoid abuse:Too many recommended properties may distract the user's attention. Reasonably plan the website layout, placing the content of different properties in the most

Related articles

How to specify the content model for a specific category and affect the display of its documents?

AnQiCMS provides excellent flexibility in content management, with the core being the tight integration of content models and categories.Understanding how to specify the content model for a particular category and thereby influence the display of its documents is the key to the efficient operation of a website.This not only helps organize your website content neatly, but also makes the front-end display more diverse, meeting different business needs.### Understanding the relationship between content models and categories First, let's clarify the concepts of 'content model' and 'category' in AnQiCMS

2025-11-08

How to insert images, videos, and code blocks in the content editor to enrich the display?

In today's era where content is king, an excellent article is not just a pile of words, but also needs to be illustrated with pictures and text, dynamic and static, even presented clearly with code, in order to better attract readers' attention and convey effective information.AnQi CMS knows this, therefore it has integrated a variety of practical functions into the content editor, allowing content creators to easily insert images, videos, and code blocks, making the content more rich and vivid.Next, we will delve into how to巧妙运用 these tools in the Anqi CMS content editor, making your articles come alive with new vitality.### Insert a beautiful image

2025-11-08

How can AnQi CMS automatically generate article summaries to optimize list content display?

In website operation, how to make the content list page attractive to user clicks and help search engines better understand the page content is a topic that needs continuous optimization.Among them, the quality of the display of the article summary plays a key role.AnQiCMS provides an efficient solution in content management, especially in the automatic generation and optimization display of article summaries, which provides great convenience for content operators.Why is the article summary crucial in the display of content lists?Imagine when a user visits a website's blog or product list page

2025-11-08

How to automatically extract keywords from the article content for SEO display?

In today's highly competitive online environment, content operators are well aware of the importance of keywords for website SEO.They are not only the bridge for search engines to understand the content of your website, but also the entry point for users to find your information.However, manually screening and extracting keywords from each article is undoubtedly a time-consuming and labor-intensive task.Is there a more intelligent and automated way to handle this problem?AnQiCMS (AnQiCMS) deeply understands the pain points of content operators, integrating SEO optimization deeply into the system design.It provides a series of powerful SEO tools

2025-11-08

How to batch update content in the background to quickly adjust the display results of the website?

With the explosive growth of internet content, the management and update efficiency of website content has become a key to operational success.For websites with strong dynamics and large content volume, manual editing line by line is not only time-consuming and labor-intensive, but may also affect the overall performance of the website due to operational errors.AnQiCMS (AnQiCMS) understands the challenges faced by operators, providing a powerful batch update feature that makes the quick adjustment and display optimization of website content more efficient than ever.### One, Core Tool: Full Station Content Replacement and Keyword Management When the website brand name changes, product links are updated

2025-11-08

How to use the anti-crawling feature to protect the display integrity of original content?

In the era of the explosion of digital content, the value of original content is increasingly prominent.For website operators who have invested a lot of effort in creating websites, how to effectively protect the display integrity of these original contents and avoid malicious collection and plagiarism has become an important issue.AnQiCMS (AnQiCMS) is an efficient and secure website building tool that is built with powerful anti-crawling functions, helping us better maintain the originality of our content.Why Original Content Protection is Crucial?Original content is the core asset of a website, it is not only the key to attracting users and enhancing brand influence

2025-11-08

How to set user group permissions to control access and display specific content for different users?

In website operation, providing differentiated content access permissions and display effects for different users is the key to improving user experience, achieving content monetization, and even improving internal management efficiency.The powerful user group management function of AnQiCMS is exactly designed to solve this pain point, it allows us to flexibly divide user groups and finely control the content they can see and operate. ### Understanding AnQiCMS User Group Management In AnQiCMS, a user group can be understood as a tag for classifying website visitors. Each tag is associated with a set of predefined permissions. For example

2025-11-08

How to optimize website content display strategy through traffic statistics?

In the wave of today's digital marketing, a website is no longer just a pile of content, but also a bridge for interaction with users.Every click, stay, and even departure of each visitor contains valuable information.How to transform these original data into practical insights, thereby optimizing the website content strategy, which is the key to improving operational efficiency and website value.AnQiCMS as a comprehensive content management system, its built-in traffic statistics tool is an important tool for us to achieve this goal.The traffic statistics and crawler monitoring function provided by AnQiCMS is not just a pile of numerical reports, it is a mirror

2025-11-08