How to display and truncate the Description field of AnQi CMS on the front page?

Calendar 👁️ 75

In the daily operation of AnQi CMS, the Description field plays a crucial role. It not only affects the search engine's understanding of the page content but is also the key copy that attracts users to click.Learn how this field is displayed and flexibly truncated on the front page, which can help us better perform content layout and SEO optimization.

Describe the various aspects and functions of the field

In AnQi CMS, the 'description' field is not a single concept, it shows different forms and functions according to the content type and usage scenario.The most common and with the greatest impact on SEO is the Meta Description of the web page.This description is usually located in the web page code's<head>An area that does not directly display in the front page content area, but it is a short summary below the title on the search engine results page (SERP) that directly affects whether users choose to click and enter your website.

In addition to Meta Description, Anqi CMS also provides page-level description fields for various content, such as articles have "document summary", categories have "category summary", single pages have "single page summary", and even tags have "tag summary".The main purpose of these summaries is to display in the list pages (such as article lists, product lists) or the overview area of detail pages within the website, providing users with a quick preview of the content.It is worth noting that if you do not manually fill in these summaries when creating content in the background, the system will usually intelligently extract a portion of the text from the content正文 as the default description, which to some extent reduces the burden of content publishing.

Call and display description content on the front page

In order to display description content on the front page of AnQi CMS, we need to use different template tags based on different scenarios.

Web Page Meta Description (located in)<head>the area)We need to use the global TDK (Title, Description, Keywords) tags to call. This usually occurs in your website template'sbase.htmlOr similar in the public header file is set:

<meta name="description" content="{% tdk with name="Description" %}">

This code will intelligently output the corresponding Meta Description based on the type of the current page (homepage, article details, category page, etc.).If it is the homepage, it will call the description you have configured in the "Homepage TDK Settings" on the backend;If it is an article detail page, the article's "document summary" will be called first;This applies accordingly, for category pages, single pages, and tag pages, their respective introductions will also be called.

Description for the page content area (such as list preview or detail page overview)Then we need to use the corresponding detail or list label for the content.

  • An overview of the article or product details page: In the article or product details template, you can directly go througharchivethe object to get the description of the current content.

    <div>
        <p>{% archiveDetail with name="Description" %}</p>
    </div>
    

    or if you have already assigned the detail content to a variable (for examplearchive), then you can use it directly:

    <div>
        <p>{{ archive.Description }}</p>
    </div>
    
  • Category page introduction: In the category detail template, you can call the category description in this way:

    <div>
        <h3>分类简介:</h3>
        <p>{% categoryDetail with name="Description" %}</p>
    </div>
    
  • Single page content description: The calling method in the detail template of a single page is similar to that of articles:

    <div>
        <p>{% pageDetail with name="Description" %}</p>
    </div>
    
  • Brief introductions of various contents on the list pageIn the pages that display article lists, product lists, category lists, or tag lists, there is usually a loop to iterate over each item. Within the loop body, we can directly access the current loop item'sDescriptionProperties to display a brief introduction:

    {% archiveList archives with type="page" limit="10" %}
        {% for item in archives %}
        <div>
            <h4><a href="{{item.Link}}">{{item.Title}}</a></h4>
            <p>{{item.Description}}</p> {# 这里直接输出item的描述 #}
            {# ... 其他内容 ... #}
        </div>
        {% endfor %}
    {% endarchiveList %}
    

    whether it isarchiveList/categoryList/pageListOrtagDataListList tags, in their loop body (for example)item), you can use directly{{item.Description}}To get the description content.

Flexible extraction and

Related articles

How to implement SEO optimization display of article titles in Anqi CMS and differentiate them from regular titles?

How to implement SEO optimization display of article titles in AnQiCMS, distinguishing from the regular title?In the practice of content operation, we often face a challenge: how to balance the 'readability' of content with 'search engine friendliness'.A captivating title can catch the reader's attention and increase click-through rate;A title containing core keywords can help search engines better understand the content and improve rankings.AnQiCMS fully understands the importance of this requirement and therefore provides a flexible mechanism

2025-11-09

How to customize the content model in Anqi CMS to achieve personalized product display?

When building a successful website, especially for enterprises that need to display a variety of products, the personalization and precise presentation of content are crucial.Traditional website content management systems often provide fixed or limited content types, which may not be sufficient when facing products with different attributes and display requirements.AnQiCMS (AnQiCMS) understands this pain point, through its powerful customizable content model function, it provides users with flexible and efficient solutions, making personalized product display easily accessible.### AnQi CMS Content Model

2025-11-09

Under multi-site management, how to ensure that the independent content of each site is displayed correctly?

The practice of independent content display for multiple sites of AnQi CMS: Ensuring the unique style of each site In today's ever-changing digital world, many enterprises and content operators may need to manage multiple websites at the same time, whether it is to distinguish brands, sub-divide markets, or meet different business needs.AnQiCMS (AnQiCMS) provides an efficient and convenient solution for such needs with its powerful multi-site management function.

2025-11-09

In AnQi CMS, how should the article detail page correctly display the article title, content, and related information?

AnQiCMS (AnQiCMS) provides powerful and flexible content management features, especially when building article detail pages, which can help us efficiently present high-quality content.A well-designed article detail page can not only clearly display the core information of the article, but also effectively improve the user's reading experience and the stickiness of the website through the recommendation of related content. ### Article Title and Core Content: The Soul of the Page The core of the article detail page in Anqi CMS is the article title and main content.

2025-11-09

How to implement lazy loading of images in the `archiveDetail` tag of AnQi CMS?

In today's content is king era, the importance of website performance and user experience is self-evident.Especially for content pages with many images, how to avoid affecting user experience and search engine rankings due to slow image loading has become a common concern for website operators.AnQi CMS is well-versed in this, not only providing flexible and efficient content management functions, but also cleverly supporting image lazy loading (Lazy Load).

2025-11-09

How to generate the catalog navigation on the front page for the automatic extraction of article content (`ContentTitles`) feature?

In Anqi CMS, providing a clear directory navigation to help readers better understand the structure of long articles is the key to improving user experience.The Anqi CMS article content automatically extracts the title (ContentTitles) feature, which is for this purpose.It can intelligently identify the various titles in the article content and provide this structured information to the front-end template, making it easy for us to build a dynamic and practical directory navigation.###

2025-11-09

How to display the cover image (Logo) and thumbnail (Thumb) of an AnQi CMS article?

In content operation, the cover image (Logo) and thumbnail (Thumb) of the article play a crucial role. They not only attract readers' attention and increase click-through rates, but are also an indispensable part of search engine optimization (SEO).AnQiCMS (AnQiCMS) provides users with a flexible and convenient way to manage and display these visual elements.This article will discuss in detail how to configure and call the cover image and thumbnail of the article in AnQiCMS.## One, Configuration and generation of cover image and thumbnail In AnQiCMS

2025-11-09

How to display the publication time of articles in Anqi CMS and customize the date and time format?

When operating website content, the publication time of the article is an indispensable element.It not only helps visitors quickly understand the "freshness" of the content, but also has a positive impact on search engine optimization (SEO), as it conveys the signal that the website content is continuously updated.AnQiCMS provides great flexibility in content management, whether it is to obtain or customize the display time of published articles, it is very convenient.Next, we will explore how to flexibly display the publication time of articles in Anqi CMS

2025-11-09