The intelligent generation mechanism of the document introduction of AnQi CMS

In AnQi CMS, the generation of document summaries (i.e., brief introductions to articles, products, etc.) is a considerate design that balances automation and manual control.For websites or self-media that update frequently on a daily basis, writing a concise summary for each article is undoubtedly a huge task.AnQi CMS fully considers this point, it is built-in with a set of intelligent automatic extraction mechanisms.

When you publish or edit a document in the background, if the "Document Summary" field is left blank without filling it in, the system will not leave it empty. On the contrary,AnQi CMS will automatically extract a paragraph from the beginning of your main content as the introduction of the documentThis mechanism greatly reduces the burden on content operators, ensuring that each piece of content has a default summary, even when busy, to ensure the integrity of the website's content.

The word truncation rule: The system defaults to flexible control with the template

How does AnQi CMS follow the word count rules when automatically generating document summaries? According to the official documentation of AnQi CMS, the default automatic truncation rule is: Extract the first 150 characters from the beginning of the document as the document summaryThe '150 characters' is an empirical value that is often considered in the SEO field to be the rangedescriptionThe ideal length range for label extraction and display. With such a default setting, even system-generated summaries can meet basic SEO needs to some extent.

It is worth noting that this "150-character" rule mainly applies toThe automatic generation of document (article, product, etc.) summaries when not manually filled in.For category summaries or single-page summaries, the document does not explicitly mention an automatic generation mechanism. Typically, these page summaries need to be manually input by operators according to actual conditions to ensure their accuracy and relevance.

However, as an operations expert, we know that the display length of content is not constant. Sometimes, it is necessary to display different lengths of summaries under different pages or layouts. Anqi CMS is well-versed in this, providing highly flexible template hierarchical control, allowing operators toTemplate tags and filtersTruncate and optimize the number of characters in the summary when displayed on the front-end page.

This means that even if the backend system defaults to truncating 150 characters, in the front-end template, you can further shorten this 150-character abstract according to design requirements, or choose to display it in other ways without violating the default truncation logic. This mainly depends on the various features provided by AnQi CMS.Text Extraction FilterFor example:

  • truncatecharsFilterThis filter can truncate strings to a specified character count and add an ellipsis (...) at the end. For example, if you want to display only 50 characters of an abstract on the homepage, even if the system automatically generates 150 words, you can use it in the template.{{ item.Description|truncatechars:50 }}To implement. It will truncate exactly by the number of characters, even if the truncation position is in the middle of a word.
  • truncatewordsFilter: withtruncatecharsdifferent,truncatewordsTruncate the string according to the specified number of words and add an ellipsis as well.Its advantage lies in the ability to maintain the integrity of words, avoiding the situation of 'half-cut words' and making the abstract reading more natural.This is especially useful for English websites.
  • truncatechars_htmlandtruncatewords_htmlFilter: Considering that many summaries may contain HTML tags, directly using the first two filters may destroy the HTML structure.The Aanqi CMS provides a secure HTML version of the filter, which intelligently handles HTML tags while extracting text, ensuring that the output abstract is still a valid HTML fragment and avoids page display anomalies.

In summary, Anqi CMS provides out-of-the-box automation convenience for document introduction processing (default 150 characters auto-capture), and also gives operators a high degree of freedom in front-end display (through a variety of filters to flexibly control word count and display methods), perfectly balancing efficiency and the needs of refined operation.


Frequently Asked Questions (FAQ)

  1. Ask: Can the document introduction of Anqi CMS be manually edited? Is there a limit to the number of characters that can be manually edited?

    • Answer:Of course you can.When editing documents in the AnQi CMS backend, the "Document Summary" field is editable.If you manually fill in the introduction, the system will not automatically extract it.When editing manually, the system itself does not have a mandatory word limit, but to optimize the search engine effect and user reading experience, it is recommended that you keep the document summary within 150-200 characters.
  2. Ask: Besides documents (articles, products), does Anqi CMS have the function of automatically generating introductions for categories and single pages?

    • Answer:For categories and single pages, Anqi CMS usually does not provide the function of automatically generating introductions.These pages tend to have stronger structure and purpose, and their brief (or description) needs to be written accurately by operators according to the classification theme or page content to ensure the accuracy of information delivery.Therefore, you need to manually fill in the category description and single page description in the background.
  3. Ask: If I use it in a templatetruncatechars:80Summarize the abstract to 80 characters, but when the user clicks into the detail page, will it display the full 150-character automatically generated summary or the 80-character summary?

    • Answer:On the detail page, if your template is directly calling the original description field of the document (for example{{ archive.Description }}),Then it will display the complete 150-word abstract automatically generated by the system, or the complete introduction content you manually filled in.truncatechars:80This filter only affectscurrentThe display length of its template page (such as list page, home page) does not change the original summary content stored in the database.