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 through
archivethe 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 example
archive), 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's
DescriptionProperties 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 is
archiveList/categoryList/pageListOrtagDataListList tags, in their loop body (for example)item), you can use directly{{item.Description}}To get the description content.