In the daily operation of Anqi CMS, the Description field plays a crucial role. It not only affects how search engines understand the page content but is also the key copy that attracts users to click.Deeply understand how this field is displayed on the front-end page and how it can be flexibly cropped, which can help us better perform content layout and SEO optimization.

The various appearances and functions of the 'Description' field

In the AnQi CMS, the 'description' field is not a single concept; it takes on different forms and functions according to the content type and usage scenario.The most common and the one with the greatest impact on SEO is the webpage's Meta Description.<head>Area, it does not directly display in the content area of the front page, but it is that brief summary below the title on the search engine results page (SERP), which 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 types of 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 function of these introductions is to display in the list pages (such as article lists, product lists) or overview areas of detail pages within the website, providing users with a quick preview of the content.It is worth mentioning that if you do not manually fill in these summaries when creating content in the background, the system usually intelligently extracts a part of the text from the content body as the default description, which to some extent relieves the burden of content publishing.

Call and display description content on the front-end page

To display description content on the front-end page of the Anqi CMS, we need to use different template tags according to different scenarios.

For the Meta Description of web pages (located<head>area)We need to use the global TDK (Title, Description, Keywords) tags to call it. This is usually in your website template'sbase.htmlOr similar in the public header files 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 (home page, article detail, 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 the article detail page, it will give priority to the 'Document Introduction' of the article; and so on. 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 tag.

  • An overview of the article or product details page): You can directly access the description of the current content througharchivethe object in the article or product detail template.

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

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

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

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

    <div>
        <p>{% pageDetail with name="Description" %}</p>
    </div>
    
  • Brief introduction of each item on the list pageIn pages that display article lists, product lists, category lists, or tag lists, there is usually a loop to iterate over each item. Inside the loop, we can directly access the current item'sDescriptionProperties to display the 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 %}
    

    WhetherarchiveList/categoryList/pageListOrtagDataListAnd other list tags, in their loop body (for exampleitem), you can use{{item.Description}}to get the description content.

Flexible extraction with