How to use the “Recommended Attributes” feature of Anqi CMS to flexibly display specific content on the front page?

Calendar 👁️ 76

When operating a website, we always hope to prioritize the most important and popular content for visitors, so that the focus area of the website can always present the freshest and most attractive information.It takes time and is prone to errors to manually update this content. Fortunately, Anqi CMS provides a very practical "recommended attribute" function, which allows us to easily achieve flexible content display and automated management.

What is the 'Recommendation Attribute' feature of Anqi CMS?

In simple terms, 'recommended attributes' are like putting a special tag on your website content to tell the system where or how this content should be displayed. Anqi CMS provides us with eight preset recommended attributes, each with a corresponding letter identifier for easy use in front-end templates:

  • Headline [h]: Suitable for the most important headliner content on the website.
  • Recommend [c]: Often used in columns such as 'Editor's Recommendations' and 'Featured Articles'.
  • Slide [f]: Designed specifically for carousels or focus images, used to display a set of images or news.
  • Special recommendation [a]: Indicates a special recommendation, which may have a higher priority than ordinary recommendations.
  • Scroll [s]: Suitable for news scrolls or announcements.
  • Bold [b]: Emphasize content titles to make them more prominent in the list (although usually implemented through CSS, this attribute can be used as a filter criterion).
  • Image [p]: Filter articles with important images for display in the image and text area.
  • Jump [j]: If the content itself is an external link or a special jump, this attribute can be used to mark it.

These properties can be used individually, or multiple can be selected for the same document at the same time.However, it should be noted that when calling from the front end, each list area can usually only filter content based on a recommended attribute.

How to set the 'recommended attribute' of content in the background?

It is very intuitive to set recommended properties for content. When we enter the Anqi CMS backend, whether it is to publish new articles, new products, or edit existing content, we can find an option named "Recommended Properties" on the right or bottom of the editing interface.This will list all the properties and display them in check boxes.

You only need to check one or more corresponding properties based on the importance of the content or the way you want to display it.For example, an article you want to appear in the homepage slideshow carousel and is also an 'Editor's Pick', can check both 'Slideshow [f]' and 'Recommend [c]'.After saving, this content will be marked with the special tag you assign.

Display specific content flexibly on the front-end page

After setting up the recommended properties, the next key is to use these properties to filter and display content on the website front end (i.e., the page the user sees). The template tag feature of Anqi CMS makes this process very simple, mainly througharchiveListLabel collaborationflagParameter to achieve.

Suppose we want to display the latest 5 articles with the attribute "recommended [c]" on the homepage, we can write the code like this in the template file:

{# 在首页展示带有“推荐[c]”属性的最新文章 #}
<div class="featured-articles">
    <h2>编辑精选</h2>
    {% archiveList featuredContent with type="list" flag="c" limit="5" order="id desc" %}
        {% for item in featuredContent %}
            <div class="article-card">
                <a href="{{ item.Link }}">
                    <img src="{{ item.Thumb }}" alt="{{ item.Title }}" class="article-thumbnail">
                    <h3>{{ item.Title }}</h3>
                </a>
                <p class="article-description">{{ item.Description|truncatechars:100 }}</p>
            </div>
        {% empty %}
            <p>目前还没有推荐内容哦!</p>
        {% endfor %}
    {% endarchiveList %}
</div>

In this code block:

  • archiveListIt is the core tag used by AnQi CMS to get the content list.
  • featuredContentIt is the variable name we define for this content list, you can name it as needed.
  • type="list"The list of items retrieved is fixed, not requiring pagination.
  • flag="c"We select the key parameters with the "recommended" attribute. If you want to display "top" content, just need toflag="c"changed toflag="h".
  • limit="5"restricted to display only 5 articles.
  • order="id desc"Then let the content be sorted in descending order by the publishing ID, which usually means displaying the latest published.

By modifyingflagThe value of the parameter allows us to easily switch to calling different recommended attributes. For example, to implement a scrolling news bar at the top of a website, you can useflag="s"If you need a picture carousel, then useflag="f".

If a certain area does not want to display content with specific recommended attributes, such as if the "top story" content has already been displayed elsewhere on your website and you want to avoid repetition, you can useexcludeFlagthe parameters. For example,excludeFlag="h"Excludes all content marked as "Headline".

Example of practical application scenarios

The flexibility of the "Recommendation Attribute" feature makes it capable of meeting various content display needs:

  1. Homepage focus image or carousel areaSelect the 'Slide [f]' attribute for several important articles or activity images in the background, and use it in the front-end templateflag="f"Invoke and set appropriate parameterslimitThe quantity can realize dynamic focus pictures.
  2. Sidebar hot recommendationsYou can check the 'Top [h]' or 'Recommended [c]' for some popular articles and then combine them in the sidebar.order="views desc"(Sorted by views in descending order) andflag="h"orflag="c"to display 'Hot Headlines' or 'Hot Recommendations' to attract visitors to click.
  3. Special page content aggregationOn a special topic page, you can mark important content related to the topic with a specific recommendation attribute (for example, you can customize a special recommendation attribute if the system supports it, otherwise use a general attribute), and then display it centrally for visitors to browse conveniently.
  4. Featured products on the product display pageFor e-commerce websites, you can check the 'Special Recommendation [a]' attribute for newly launched, hot-selling, or discounted products, and then display them in a specific location on the product list page.flag="a"Display and highlight these featured products.

Summary

The 'Recommended Attribute' feature of AnQi CMS is an efficient and easy-to-use tool that closely integrates content management with front-end display, greatly enhancing the efficiency of website operations.By reasonably utilizing these recommended properties, we can easily achieve dynamic content updates and personalized displays, making the website more vivid and attractive, thereby better serving our visitors and business goals.


Frequently Asked Questions (FAQ)

1. Can I select multiple 'recommended attributes' at the same time in an article? What are the limitations when calling on the front end?Yes, when editing articles in the Anqi CMS backend, you can check multiple recommended properties for the same article.For example, an article can be either a "top story" or a "slide."}However, it is used on the front-end pagearchiveListWhen calling the label content, oneflagYou can only specify one attribute letter at a time for filtering (for exampleflag="h"orflag="f"This means that you may need to use different ones in different content display areas,flagCall this article with multiple attributes.

2. If I have set the recommended attribute but it does not display on the front page, what could be the reason?If the recommended property is not displayed on the front page after it is set, please check the following points:

  • Is the template code correct?Make sure you are using the correct one in the templatearchiveListTags andflagparameters, for exampleflag="c".
  • Content status:Make sure the content has been published and is not set to draft

Related articles

How to make full use of the flexible content model feature of AnQiCMS to detail product information

In website content operations, the product detail page is the key link between users and products, and its richness of content, clarity of structure, and flexibility of display directly affect users' purchase decisions and the conversion rate of the website.AnQiCMS (AnQiCMS) provides an ideal solution with its powerful flexible content model features, allowing us to break free from the constraints of traditional CMS fixed fields, and build highly customized, attractive product detail pages based on product characteristics and business needs.### One, Flexible Content Model

2025-11-09

Under AnQiCMS multi-site management, how to set up independent templates for different sites to display content?

It is crucial to maintain a unique style and presentation for each site when operating multiple websites, as this not only helps to build the brand but also better meets the needs of different audiences.AnQiCMS provides strong support for multi-site management, one of its core advantages is that it can flexibly set independent templates for each site, making content display more personalized.

2025-11-09

How to use the `archiveDetail` tag to implement lazy loading (LazyLoad) of images in AnQiCMS?

In AnQiCMS, the implementation of content image lazy loading is mainly completed by utilizing a very practical parameter in the `archiveDetail` tag.This feature is designed to optimize website performance and enhance user experience, especially when there are many images in the article content, it can significantly reduce the initial loading time of the page.### Understanding Lazy Loading and Its Working Principle in AnQiCMS Lazy loading is a common web optimization technique that refers to deferring the loading of non-critical resources on a web page (such as large images at the bottom of the page)

2025-11-09

How to customize the URL static rules of AnQiCMS article detail page to improve SEO effect?

## Mastering SEO: How to Customize the URL Static Rules of AnQiCMS Article Detail Page In this era where content is king, the SEO effect of a website is directly related to the exposure and user access of the content.Among them, the URL structure acts as the first checkpoint for communication between a website and a search engine, and its friendliness is crucial.A clear, concise, and descriptive URL can not only help search engines better understand the page content, but also improve user experience and increase click-through rate.AnQiCMS as an enterprise-level content management system focusing on SEO

2025-11-09

How to customize the Anqi CMS content model to meet the personalized display needs of different types of content?

Today, with the increasing sophistication of content operation, personalized display of website content has become a key to attracting users and enhancing user experience.AnQiCMS (AnQiCMS) provides us with powerful tools with its flexible content model, allowing us to customize the structure and display of content according to various business needs.This article will delve into how to flexibly use the content model in Anqi CMS, making your website content more distinctive and practical.

2025-11-09

How to configure multi-language content in AnQi CMS to ensure that users of different languages can browse the website normally?

Our Anqi CMS provides an efficient and flexible solution for multilingual content configuration, aimed at helping us easily meet the needs of global content promotion.It cleverly distinguishes between system-level language settings and the localization of website content and templates, allowing us to finely manage content in different languages and ensure that users of different languages can browse the website smoothly.Next, we will learn how to configure multi-language content in Anqi CMS and ensure its smooth operation.### Understanding the multilingual mechanism of AnQi CMS In AnQi CMS

2025-11-09

How to optimize website URL display and SEO effects through AnQi CMS's pseudo-static and 301 redirect functions?

In today's highly competitive online environment, a website's URL (Uniform Resource Locator) is not only the address of the content but also a key factor affecting user experience and search engine rankings.A clear and meaningful URL can enhance the professionalism of a website and help search engines better understand page content, thereby optimizing SEO effects.AnQiCMS provides two core functions, pseudo-static and 301 redirect, for URL optimization, allowing users to easily build a website structure that is more friendly to search engines and users.### Optimize URL Display

2025-11-09

How to set up the 'Document Image' or 'Thumbnail' feature in AnqiCMS backend so that images are displayed correctly on the front page?

In AnQi CMS, managing and displaying images, especially document thumbnails or cover images, is a core link in website content operation.AnQi CMS provides flexible backend configuration and a powerful template tag system, allowing you to easily display these images correctly on the front page.This article will guide you step by step on how to set up and call it, ensuring that your website images are presented in **status to visitors. ### Back-end Settings: Make Sure Image Processing is Proper In the AnQi CMS back-end, there are several key areas that affect images, especially the generation and processing of thumbnails.Content Setup

2025-11-09