How to call the recommended attributes of AnQiCMS document in the front-end template?

Calendar 👁️ 57

As an experienced CMS website operation personnel in a security company, I know how to attract and retain users through precise content display.In Anqi CMS, the 'recommended attribute' is an extremely useful feature that allows us to finely mark content, thereby enabling flexible calls and display on the website front end.Below, I will elaborate on how to call these recommended properties in the front-end template.

The AnQi CMS backend management system provides the core feature of "recommended attributes", which is located on the document (or other content model) editing page.Here, you can specify up to eight different recommendation attributes for each piece of content to differentiate the display on the front end.These properties include: Headline[h], recommended[c]of slides[f], special recommendation[a], scroll[s], bold[h](Note: at this[h]and the headlines'[h]The code is the same, usually the priority of the headline is higher)、image[p]and jump[j]Each attribute corresponds to a single-letter code. After you check the corresponding attribute in the background, the Anqi CMS will mark the content accordingly. These tags are the basis for the front-end template to call the content.By reasonably setting these properties, we can effectively highlight important content and guide users' attention.

Invoke this content with recommended attributes in the front-end template, which mainly depends on the Anqicms providedarchiveListTag. This powerful tag allows us to filter and display content lists based on various conditions. To call content with specific recommendation properties, we need to use in the tagarchiveListthe tag.flagThe parameter, and the single-letter code of the recommended attribute as its value. For example, if you want to display the article marked as 'recommended' in an area[c]you can use in the templateflag="c"This parameter tells AnQi CMS to only return those content items with the specified recommendation attributes.

Here is an example code for calling a "recommended" article list.

<div class="recommended-articles">
    <h2>精选推荐</h2>
    <ul>
        {% archiveList recommendedArchives with type="list" flag="c" limit="5" %}
            {% for item in recommendedArchives %}
                <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
            {% empty %}
                <li>暂无精选推荐文章</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</div>

In this code block,archiveListTags are used to retrieve content lists.type="list"Specifies the type of list,flag="c"Then accurately filtered out the articles marked as "recommended,"limit="5"Limited the number of displayed items to 5.forLoop through the returneditemAnd output the title and link of the article. If there are no articles that meet the conditions,emptythe content within the block will be displayed.

It is worth noting that the Anqi CMS.flagThe principle of parameter design is that each timearchiveListAn attribute can only be filtered once. This means that if you need to display "Headline" content and "Slideshow" content in different areas of the page, you will need to use independentarchiveListLabel. Each label will be configured to be uniqueflagParameters to ensure content is displayed as expected. This design ensures clear division and management of content blocks, avoiding content confusion.

Here is an example of how to create multiple recommended attribute content blocks:

<div class="headline-section">
    <h3>最新头条</h3>
    {% archiveList headlines with type="list" flag="h" limit="1" %}
        {% for item in headlines %}
            <p><a href="{{ item.Link }}">{{ item.Title }}</a></p>
        {% empty %}
            <p>暂无头条内容</p>
        {% endfor %}
    {% endarchiveList %}
</div>

<div class="slideshow-items">
    <h3>精彩幻灯</h3>
    <ul>
        {% archiveList slideshows with type="list" flag="f" limit="3" %}
            {% for item in slideshows %}
                <li><img src="{{ item.Thumb }}" alt="{{ item.Title }}"><a href="{{ item.Link }}">{{ item.Title }}</a></li>
            {% empty %}
                <li>暂无幻灯内容</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</div>

Except throughflagScreening by parameters,archiveListthe tags also provideexcludeFlagandshowFlagParameters, to achieve more fine-grained control.excludeFlagThe parameter allows you to exclude content with specific recommendation attributes when retrieving a content list. For example,excludeFlag="h"It will return all content but exclude items marked as "Top News".showFlag=trueYou can include all the recommended property codes marked in each content item data (such ashcfetc.), you can use them in the template.{{item.Flag}}To obtain and display as needed. This is very useful for scenarios where you want to display a "headline" or "recommendation" tag next to the title.

As a website operator, we should fully utilize these recommended attributes to optimize the user experience and content marketing strategy.Mark the most important article as a 'headline' and place it in a prominent position, mark visually appealing content as a 'slider' for carousel display, or mark specific products as 'recommended' to guide purchase intention.Regularly check and update the recommended properties of the content to ensure that the front end of the website always displays the latest and most relevant key information.By such refined operation, the recommendation attribute function of Anqi CMS can help us manage content more efficiently and enhance the overall attractiveness and operation effect of the website

Related articles

How to set the recommendation attribute (flag) for AnQiCMS documents?

As a senior CMS website operator, I am well aware of the core position of content in website operation.High-quality content not only requires careful creation, but also needs an effective presentation to attract and retain users.The "Recommended Attribute" (flag) feature provided by AnQi CMS is one of the key tools for accurate content presentation and improving user experience. ### Deep Understanding of AnQi CMS Recommended Attributes (Flag) AnQi CMS recommended attributes, also known as Flags, are special markers attached to document content.

2025-11-06

What are the requirements and suggestions for filling in the title of AnQiCMS documents?

As a website operator who has been deeply involved in AnQiCMS for many years, I fully understand the importance of every content detail in attracting website visitors and retaining users, and the document title is undoubtedly the first door to content presentation.It is not only a reason for users to click, but also a key factor for search engines to understand and evaluate the value of a page.In AnQiCMS, the title entry is not a simple text input, it involves multiple aspects such as content model, SEO strategy, and user experience.

2025-11-06

How to utilize

As a website operator who is deeply familiar with the operation of AnQiCMS, I know that content is the bridge connecting users to the brand.The AnQi CMS, a powerful content management system developed based on the Go programming language, provides us with a comprehensive toolkit from content creation to publication. Its high efficiency, customizable and scalable features are the key to maximizing the value of our content.The following will elaborate on how to fully utilize the various functions of AnQiCMS to meet the needs of readers, attract and retain users.

2025-11-06

How does AnqiCMS optimize a website's performance in search engines using advanced SEO tools?

AnqiCMS as an enterprise-level content management system, its design from the beginning has always regarded search engine optimization (SEO) as a core element.It not only provides a concise and efficient system architecture, but also incorporates a rich set of SEO tools, aimed at helping website operators to comprehensively enhance the performance of their websites in search engines, thereby attracting and retaining users, and realizing the maximum value of content.AnQiCMS is deeply aware of the importance of a website's visibility in search engines for business growth.Therefore, the system integrates SEO-friendly concepts from the bottom architecture to the front-end display.It is developed based on Go language

2025-11-06

How to add and manage keywords in the AnQiCMS document?

As an operation expert who deeply understands the operation of AnQiCMS (AnQiCMS) and is dedicated to enhancing the value of website content, I know the core status of keywords in the content ecosystem.They are not only the basis for search engines to understand and index our content, but also the bridge for users to find us through search and achieve accurate traffic conversion.AnQiCMS provides a series of powerful and flexible tools for adding and managing keywords, aimed at helping us efficiently complete this key task.

2025-11-06

Can keywords be selected from the AnQiCMS keyword library for the document?

As an experienced website operations manager, I can clearly tell you that AnQiCMS (AnQiCMS) indeed provides the function of selecting keywords from the keyword library during the document content creation process, which greatly facilitates content operations and SEO optimization work.In the AnQi CMS content management module, especially in the interface for adding or editing documents (such as articles, products, etc.), you will notice the 'Document Keywords' item.In addition to allowing operators to manually enter keywords, the system provides a直观的“select keyword”button here. Click this button

2025-11-06

What is the word limit for the AnQiCMS document introduction?

As a senior content expert who deeply understands the operation of AnQiCMS, I know that the value of the document is not only in the breadth of content, but also in its accurate and efficient guidance to readers.About the **word limit of AnQiCMS documents, this is not a simple fixed number, but needs to be considered comprehensively based on the target audience of the document, the nature of its content, and its specific role in the user journey.The Anqi CMS project itself emphasizes the characteristics of

2025-11-06

How does the AnQiCMS document introduction automatically generate when not manually filled in?

As a user of AnQiCMS (AnQiCMS) who is proficient in content operation, I know that high-quality content is the cornerstone of website success.The content must be engaging and also consider search engine optimization (SEO), and the document summary (Meta Description) is an indispensable part of it.It directly affects the user's click intention on the search engine results page.However, during the process of content creation and publication, we sometimes encounter a problem: how does AnQi CMS handle it if the document summary is not filled in manually?

2025-11-06