How to add recommended attributes to articles, products, and display them in front-end categories?

Calendar 👁️ 62

How to effectively highlight important information in content operation, so that users can find the core content at a glance, which is the key to improving the effectiveness of the website.AnQiCMS (AnQiCMS) provides a flexible recommendation feature that allows you to easily mark the importance of articles, products, or other content and display them on the website as needed.This article will introduce in detail how to add these recommended attributes to content in the background, as well as how to classify and display them in the front-end template.


Use the Anqi CMS recommendation attribute to make your content shine on the front page

On content management and presentation, AnQiCMS has provided us with many conveniences.Among them, the "recommended feature" is particularly useful, as it helps us effectively tag and prioritize a massive amount of content, ensuring that the most valuable information can be discovered by users in a timely manner.Whether it is to promote a重磅 article to the homepage headline or to make a popular product stand out on a specific category page, recommendation attributes are efficient tools to achieve these goals.

1. Add recommendation attributes for content in the background

Setting recommended attributes for articles or products is an intuitive and simple process.When you publish new content or edit existing content on the AnQiCMS backend, you can find the corresponding settings items.

First, please log in to your AnQiCMS administrative interface, navigate to the "Content Management" module, and select "Publish Document" or "Document Management" to edit the article or product you want to tag.

In the content editing page, you will see a name calledRecommended attributeThe area where. Here are various preset attribute types for you to choose from, usually represented by a Chinese character and the letter code within parentheses, such as:

  • Headline [h] : Usually used in the most prominent position on the homepage, such as large focus images or featured news.
  • Recommend [c]: Suitable for general recommendation content, which can be flexibly displayed in article lists, sidebars, etc.
  • Slide [f]: Suitable for content used in carousel or slide show areas, emphasizing visual effects.
  • Special recommendation [a]: A higher level of special recommendation than 'Recommended', which can be used as a secondary focus content.
  • Scroll [s]: Suitable for news scrolling, announcements, and other content that needs to be updated dynamically.
  • Bold [h]: Here the "h" is duplicated with the "h" of the headline, but it represents bold text in the recommended properties, usually used to highlight titles in lists.
  • Image [p]: Tagged as containing important images, articles or products, making it easy to display in the image aggregation area.
  • Jump [j]: If the content does not display directly but instead jumps to an external link or another page within the site, this property can be used.

You can select one or more recommended attributes for each article or product based on the actual importance and display requirements.For example, an important article that is both a headline news and contains beautiful pictures can check both It should be noted that although it can be selected multiple times, when calling and displaying in the front-end, it will usually be filtered for a specific attribute.

After selecting the properties, please make sure to save your content so that these recommended properties can take effect.

Second, display recommended content in categories in the front-end template.

In AnQiCMS, the display logic of content is mainly realized through template tags. To classify and display content with specific recommendation attributes on the front page, we need to utilizearchiveListTag, and combine it withflagFilter the parameters.

archiveListTag is a powerful tool to get lists of articles, products, and other content. By using inarchiveListSet in the labelflagparameters, you can specify to only get content with specific recommended attributes.

For example, if you want to display a "Top News" section on the homepage, showing only those articles marked as "Top [h]", you can use it like thisarchiveListTags:

{# 显示文章模型中被标记为“头条”的内容 #}
{% archiveList headlines with moduleId="1" flag="h" limit="5" %}
    {% for item in headlines %}
        <a href="{{ item.Link }}">{{ item.Title }}</a>
        {# 更多内容字段,如: item.Thumb, item.Description 等 #}
    {% endfor %}
{% endarchiveList %}

HeremoduleId="1"Typically represents the article model (the specific ID may vary depending on your configuration),flag="h"Then it accurately filters out content with the 'headline' attribute,limit="5"Controls the number of items displayed.}

If your requirement is to display a list of products marked as 'Recommended [c]' under a category page, you can do it like this:

{# 在当前分类下,显示产品模型中被标记为“推荐”的内容 #}
{% archiveList recommendedProducts with moduleId="2" flag="c" limit="8" %}
    {% for item in recommendedProducts %}
        <div class="product-item">
            <img src="{{ item.Thumb }}" alt="{{ item.Title }}">
            <h3><a href="{{ item.Link }}">{{ item.Title }}</a></h3>
        </div>
    {% endfor %}
{% endarchiveList %}

In this example,moduleId="2"It may represent a product model, whileflag="c"Then filter out the recommended products.

Important reminderIn the samearchiveListTag call, you can only use one.flagTo specify a recommended attribute for filtering. This means that if you want to display 'Headline' content and 'Slideshow' content on the same page separately, you need to use two separate parameters.archiveListTags, each tag is set differentlyflagParameter.

For example, display a slide area first, and then a general recommendation area below:

{# 幻灯片区域 #}
<div class="carousel">
    {% archiveList slideshowItems with moduleId="1" flag="f" limit="3" %}
        {% for item in slideshowItems %}
            <div class="carousel-item">
                <img src="{{ item.Logo }}" alt="{{ item.Title }}">
                <h4>{{ item.Title }}</h4>
            </div>
        {% endfor %}
    {% endarchiveList %}
</div>

{# 普通推荐文章区域 #}
<div class="recommend-list">
    {% archiveList generalRecommendations with moduleId="1" flag="c" limit="10" %}
        {% for item in generalRecommendations %}
            <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
        {% endfor %}
    {% endarchiveList %}
</div>

In this way, you can flexibly classify and display content in various areas of the website based on the recommended attributes of the content, thereby optimizing the user's browsing experience and highlighting the core value of the website.


Frequently Asked Questions (FAQ)

  1. Ask: Can I add multiple recommended attributes at the same time in the article or product content? Answer:Yes, when editing content on the AnQiCMS backend, you can select multiple recommended properties in the "Recommended Properties" area at the same time (for example, select both "Headline" and "Image"). The content will have these properties simultaneously, but when you call it on the front end, it is usually throughflagSpecify one of the properties to filter and display.

  2. How can I display different recommended content on the homepage? For example, I want to display 'Top Stories' articles at the top of the page and 'Recommended' articles in the sidebar. Answer:You need to write multiple tags in the home page templatearchiveListEach tag is configured differentlyflagParameters to call them separately. For example, onearchiveListTags are used forflag="h"to get the headline articles, and anotherarchiveListTags are used forflag="c"to get the recommended articles.

  3. Ask: Does the recommended attribute have an impact on the website's SEO? Answer:The recommended attribute does not directly improve your search engine ranking.But by reasonably utilizing recommended attributes, you can better organize the website content structure, highlight important information, increase user stay time and interaction within the site, and these indirect factors are beneficial for SEO.A clearer content hierarchy and user experience helps search engines better understand and crawl your website.

Related articles

How to configure pseudo-static rules to achieve diverse content link display modes?

As website operators, we all hope that the website's URL can be easily indexed by search engines and be clear to users, even allowing them to understand the content of the page directly from the link.A clear and meaningful URL not only enhances user experience but is also an indispensable part of search engine optimization (SEO).Aqin CMS understands this and therefore provides a powerful and flexible static rule configuration function, allowing us to create diverse content link display modes according to our needs.Why is pseudo-static so important?\n\nImagine two types of links: `www.yourdomain

2025-11-08

How to optimize the URL structure to make the content result page more conducive to search engine crawling and display?

In content operation, a well-structured, search engine-friendly URL (Uniform Resource Locator) not only improves user experience but is also the key to helping search engines efficiently crawl and understand website content.AnQiCMS (AnQiCMS) knows this, and therefore built-in powerful URL optimization features in the system design, so that the content result page performs better in search engines.### URL Optimization Basics of AnQi CMS: URL Rewriting By default, many dynamic websites' URLs contain question marks, equal signs, and a long string of difficult-to-understand parameters, such as `example

2025-11-08

How to display multilingual content and switch on the AnQiCMS website?

In today's increasingly globalized world, many companies hope that their websites can serve users from different language backgrounds.AnQiCMS (AnQiCMS) understands the importance of this requirement and has integrated powerful multilingual support capabilities into the system design from the beginning, helping you easily build and manage multilingual websites. To display multilingual content on your AnQiCMS website and allow users to switch between languages, this primarily revolves around its "multi-site management" core function.The Anqi CMS treats each language as an independent site for management

2025-11-08

How to customize the content model to meet the needs of personalized content display?

Today, with the increasing refinement of content operation, we often find that relying solely on traditional 'article' and 'product' categories is no longer sufficient to meet the diverse content display needs of websites.Each business scenario has its unique attributes and information structure. How to make the website's content management system (CMS) like a considerate tailor, tailoring "garments" for each type of content, is exactly what we strive for.The flexible content model feature provided by AnQiCMS (AnQiCMS) just helps us achieve this vision.Why do we need a custom content model?Imagine

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 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 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 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