In document management, how is the recommended attribute `flag` used to control the display of content on the homepage or other special locations?

Calendar 👁️ 69

In Anqi CMS, the "recommended attribute" of the document (flagIt is a powerful and flexible feature that allows you to finely control the display of website content on the homepage, category page, or other specific display areas.Understand and make good use of this attribute, it can significantly improve the content operation efficiency and user experience of your website.

What is the "recommended attribute" in Anqi CMS (flag)?

In the document management module of AnQi CMS, when you add or edit a document, you will find an option called 'Suggested Properties'.These attributes are not traditional categories or tags, but are used specifically to mark the importance of content or for specific display purposes.By checking one or more recommended properties for a document, you can tell the system where this content should be highlighted on the website.

AnQi CMS provides eight preset recommended attributes, each attribute is identified by a single letter, which is convenient for calling in templates:

  • Headline[h]: It is commonly used to mark the most important and eye-catching news or articles on a website, suitable for displaying in a large area at the top of the homepage.
  • Recommended[c]: Represents high-quality content edited or recommended by the system, which can be used in various recommendation modules.
  • Slide[f]Content specifically used for carousel or slide show, often used as the visual focus area on the homepage.
  • Featured[a]:It has more specificity than ordinary recommendations and may be used to display limited-time, exclusive, or thematic content.
  • Scrolling[s]:It is suitable for displaying short messages or the latest news in bulletin boards, news tickers, or scrolling lists.
  • Bold[b]: Mainly used for emphasizing text content style, such as highlighting in title lists.
  • Image[p]Label those contents that are mainly in the form of images, such as albums, photography works, or articles with large pictures.
  • Jump[j]: Indicates that the content may be an external link or an in-site jump, click to directly navigate to the preset URL.

When editing documents in the background, you just need to simply check the corresponding properties based on the importance of the content and the expected display position.A document can have multiple recommended attributes at the same time, which provides great flexibility for the diversified display of content.

How to use in front-end templatesflagControl content display?

Display specific attributes that need to be shown on the website front-endflagYou need to use the Anqi CMS template tags to display the content with propertiesarchiveList.archiveListThe tag is used to retrieve the core document list, and it throughflagParameters to filter out the content you need.

For example, if you want to create a carousel area on the homepage to display only those documents marked as 'slideshow', you can use it like this.archiveListTags:

{% archiveList archives with type="list" flag="f" limit="5" %}
    {% for item in archives %}
    <div class="swiper-slide">
        <a href="{{item.Link}}">
            <img src="{{item.Logo}}" alt="{{item.Title}}">
            <h3>{{item.Title}}</h3>
        </a>
    </div>
    {% endfor %}
{% endarchiveList %}

In this code block:

  • archiveList archivesDefined a namedarchivesThe variable is used to store the document list obtained.
  • type="list"Indicates that a regular list is obtained, not a paginated list.
  • flag="f"It is crucial, it tells the system to only retrieve documents marked as 'slide' attributes.
  • limit="5"It limits to displaying only up to 5 documents.

It should be noted that, as the document emphasizes,via the front endarchiveListwhen calling the tag, each list usually only uses oneflagto filter by attributeThis means you cannot use aarchiveListSpecify at the same time in the tagflag="h,f"to get the headline and slideshow content. If you need to display multipleflagThe content of the attribute, you need to use multiplearchiveListtags, call them separately.

exceptflagparameter,archiveListit also supportsexcludeFlagparameters, used to exclude those with specificflagThe document of the property. For example, you might have a list of 'latest articles', but you want it to not contain any content that has already been displayed in the carousel (slide), and in this case, you can useexcludeFlag="f".

Actual application scenarios and advantages

Recommended attributeflagThe introduction has greatly simplified the implementation of dynamic content display.

  1. Focus area on the homepageUtilizeflag="f"Provide content for the slide or carousel area,flag="h"Provide the most core information for the headline news module.
  2. Recommended List and Special Topics: Through the article list page or sidebar,flag="c"orflag="a"Quickly generate modules such as "Editor's Recommendations", "Featured Articles", and others.
  3. Visual content display: Use.flag="p"Filter documents with images and display them in a photo gallery or visually rich module.
  4. Announcements and Notifications: Passflag="s"Display the latest notifications in a scrolling公告 at the top or sidebar of the page.

The advantage of this mechanism lies in itsflexibility and operational efficiency. Content operators do not need to touch the code, just select the corresponding recommended attributes in the background, and they can adjust the display of content in key positions on the website in real time.This allows the website to quickly respond to changes in operational strategies, such as promoting new products, releasing important announcements, or adjusting the homepage focus, without relying on technical developers to frequently modify templates.It decouples the display logic from the content itself, greatly enhancing the convenience of content management.

Summary

The "recommended attribute" of Anqi CMS (flag) Provides powerful tools for website content operation, making content management more intuitive and efficient. Simply check in the background and work with the front end.archiveListFlexible tag calling, you can easily achieve precise content placement and personalized display, thereby optimizing the user browsing experience and improving the overall operation effect of the website.


Frequently Asked Questions (FAQ)

  1. Ask: Can a document have multiple recommended attributes at the same time? Answer:Yes, a document can have multiple recommended attributes checked at the same time. For example, an important news item can be a 'headline'[h]It can also be a slide[f]This does not mean that you can use onearchiveListin a tag at the same timeflag="h,f"to retrieve these documents. When calling from the front end, eacharchiveListtag usually can only be based on oneflagFilter by properties.

  2. Ask: If I set the recommended attribute but it does not display on the front end, what could be the reason? Answer:There are usually several possible reasons for this situation:

    • The template has not been called:You may not have used the tag in your front-end templatearchiveListorarchiveListThe tag is not set correctlyflagto get the content you expect.
    • flagParameter error:InarchiveListin the tag usedflagThe parameter value does not match the letter of the attribute set in the background document.
    • Cache problem:The website or browser may have a cache that causes the content to not be updated in time. Try clearing the AnQi CMS backend cache and browser cache.
    • Document status:Ensure that the document itself is published, not in draft or deleted status.
  3. Question: What is the difference between recommended properties and document categories, tags? Answer:Recommended attributes, categories, and tags are three different content organization and display mechanisms:

    • Category: It is the division of content levels, which determines the归属 of the content and the URL structure, such as "news", "product", "case", etc.
    • TagA keyword description of the content, used for non-hierarchical association and search, such as 'SEO optimization', 'website construction', 'Go language', etc.
    • Recommended properties (flag)A kind ofDisplayingThe tag does not affect the classification or tag attribution of the content, but is purely used to control the display priority and form of the content in specific areas of the website (such as the homepage carousel, recommended list).It focuses more on the operational level, emphasizing the 'visibility' and 'importance' of content in the user interface.

Related articles

How to configure independent SEO information and template display for a single page (such as "About Us") in the page management?

In website operation, each page has its unique value and goal.For pages such as "About Us", "Contact Us", and "Terms of Service", they often carry brand stories, core values, or important contact information, which are crucial for building corporate image and user trust.Therefore, configuring exclusive SEO information and personalized display templates for these specific pages is an effective way to enhance the professionalism and user experience of the website.AnQiCMS deeply understands these needs, providing flexible and powerful functions, allowing you to independently configure SEO information and specify personalized template display for each single page

2025-11-08

How to set custom parameters in the background and flexibly call them in the front-end template to display specific information?

In a content management system, flexibility is the key to improving operational efficiency and meeting personalized needs.AnQiCMS deeply understands this, providing powerful custom parameter functions, allowing users to flexibly expand content attributes according to business characteristics, and accurately display this information in front-end templates.This article will discuss in detail how to set custom parameters in the Anqi CMS backend, as well as how to call them in the front-end templates to create a more expressive and functional website.--- ### The Power of Custom Parameters

2025-11-08

How does the navigation settings support creating navigation at different locations to meet the diverse content display needs of the website?

In website operation, the navigation system plays a crucial role, it is not only the map for users to explore the content of the website, but also the key for search engines to understand the structure of the website.A well-designed navigation can significantly improve user experience, guide users to discover more interesting content, thereby extending visit time, and indirectly help the website's SEO performance.AnQiCMS provides a user-friendly and powerful navigation settings feature, allowing you to flexibly build various types of navigation to meet the diverse content display needs of the website.### Core Concept: Flexible Construction of Navigation AnQiCMS

2025-11-08

How to handle images (download remote, Webp, compress large images) to optimize page display speed in content settings?

As website operators, we all know that website loading speed is important for user experience and search engine rankings.Especially on content-rich websites, images are often a key factor affecting page speed.AnQiCMS (AnQiCMS) provides us with several very practical image processing features in the content settings, allowing us to flexibly optimize images and significantly improve the display speed of the website. ### Localizing remote images, controlling image resources During the process of content creation, we sometimes refer to images from other websites. At this time

2025-11-08

How to configure multi-site content display in AnQiCMS

Easily implement multi-site content management and display in AnQiCMS It is a challenge for users who operate multiple brands, sub-sites, or content branches to manage the content of each site uniformly.AnQiCMS provides powerful multi-site management features, allowing you to easily create and maintain multiple independent websites under a single system instance and flexibly control the display of their content.This article will give a detailed introduction on how to configure multiple sites in AnQiCMS and achieve independent management and display of content.### 1. Prepare the work

2025-11-08

How to randomly get a character or value from a string or array?

In Anqi CMS template design, we often encounter the need to dynamically display content, such as randomly recommended articles, randomly displayed product images, or randomly selecting one from a set of preset keywords for display.To achieve this flexible and varied content presentation, Anqi CMS provides simple and powerful template filters, including the `random` filter that can randomly select a character or value from a string or array.Understand and master the `random` filter, which can make our website content more vibrant and fresh, effectively enhancing the user experience

2025-11-08

How to safely concatenate string and numeric variables in the AnQiCMS template?

During the development of AnQiCMS templates, we often need to combine different text segments, numerical information, and even system variables to form a complete output content, such as building dynamic links, displaying formatted data, or generating user-friendly prompt information.This process involves concatenating strings and numeric variables, and how to safely and efficiently complete this operation is an indispensable aspect of template development.AnQiCMS's powerful template engine provides a variety of flexible mechanisms to support these needs.AnQiCMS template engine syntax is similar to Django

2025-11-08

How to correctly escape special characters in the AnQiCMS template to avoid display errors?

In website content management, we often need to display text containing various special characters.If these special characters are not handled correctly, it may lead to page layout chaos, functional anomalies, and even security vulnerabilities.AnQiCMS provides a powerful mechanism to help us handle these special characters during template rendering, ensuring the correct display of content and the security of the website.

2025-11-08