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

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.