AnQiCMS has always been committed to providing flexible and powerful functions in content management and SEO optimization, among which the dynamic display of page keywords (Keywords) and descriptions (Description) is one of its core highlights.For any website that wants to perform well in search engines, accurate TDK (Title, Description, Keywords) configuration is indispensable.AnQiCMS not only allows you to easily manage this information in the background, but also provides an intelligent and dynamic calling mechanism in the front-end template to ensure that each page has customized SEO metadata.

How does AnQiCMS manage page keywords and descriptions?

In AnQiCMS, the management of page keywords and descriptions is hierarchical and highly flexible, covering all levels from the website as a whole to individual content entities.This ensures that no matter the size of your website, you can fine-tune the TDK.

  1. Global homepage TDK settings:For the overall appearance of the website - the homepage, AnQiCMS provides a dedicated setting entry.You can configure independent titles, keywords, and descriptions for your homepage in the "Backend Settings" -> "Homepage TDK Settings" on the backend of your website.This is usually used to define the core theme and brand information of a website, which is crucial for the overall SEO strategy of the website.

  2. Content entity level TDK settings:One of AnQiCMS' core strengths lies in the flexibility of its 'content model'.Whether it is an article, product, single page, or category and Tag tags, AnQiCMS allows you to set independent TDK for each content entity.

    • Documents (articles, products, etc.):When adding or editing a document, you will see the "Document Keywords" field, where you can manually enter multiple keywords separated by commas. At the same time, the "Document Summary" is usually used as the page Description, and you can also fill in the "SEO Title" to specify a unique one for the page.<title>Tag content.
    • Category:For different content categories, AnQiCMS allows you to set the "category description" as the page Description, as well as the "keywords" and "SEO title".This enables category pages for different topics to have optimized metadata as well.
    • Single Page:Like "About Us
    • Tag label:Even on the Tag list page, you can set 'SEO title', 'tag keywords', and 'tag description' for each Tag to further refine the SEO granularity of the website.

Through these multi-level management, AnQiCMS ensures that the TDK information of the content can be optimized according to its type and specific content.

How does AnQiCMS dynamically display the keywords and description of a page?

In the front-end template, AnQiCMS provides an extremely flexible way to dynamically display this TDK information.This is mainly realized in two ways: Universal TDK tags and direct access to content fields.

  1. Using the universal TDK tag (tdk)This is the recommended and most powerful dynamic display TDK method of AnQiCMS.tdkThe 'universal' aspect of tags lies in their ability to automatically judge and extract the most suitable TDK information based on the type of the current page (home page, article detail page, category list page, single page, Tag page, etc.). This means that you can use the universal header template of the website (such asbase.htmlConfigured uniformly, without having to write complex logic for each page type.

    • Display the keywords of the page:You can use HTML's<head>The area uses the following code to dynamically display the keywords of the current page:

      <meta name="keywords" content="{% tdk with name="Keywords" %}">
      

      {% tdk with name="Keywords" %}The tag will automatically retrieve the keywords of the current page.For example, if the current page is the article detail page, it will display the keywords set for the article; if it is a category page, it will display the keywords for the category.

    • Display the description of the page:Similarly, to dynamically display the description of the page, you can use:

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

      This label intelligently retrieves the corresponding Description content of the current page, which may be an article summary, category summary, or single page summary.

    • Dynamically display the page title:Although the topic is not Title, TDK usually appears at the same time, and it is briefly mentioned here.tdkTags also support more dynamic features when processing Title:

      <title>{% tdk with name="Title" siteName=true sep="_" %}</title>
      

      HeresiteName=trueThe website name will be automatically appended after the page title,sep="_"which specifies the separator.tdkThe power of the tag lies in the fact that you only need tobase.htmlConfigure it once, and it can automatically generate the correct title, keywords, and description based on the type of page being accessed, greatly simplifying template development and maintenance work.

  2. Directly access the content fieldOn certain specific content detail pages (such as article detail pagesarchive/detail.html, category detail pagescategory/detail.htmlwait), when you have clearly known the content object of the current page, you can also choose to directly access its Keywords and Description fields through template variables.

    • Article detail page (with object asarchivean example):
      
      <meta name="keywords" content="{{archive.Keywords}}">
      <meta name="description" content="{{archive.Description}}">
      
    • Category detail page (with object ascategoryan example):
      
      <meta name="keywords" content="{{category.Keywords}}">
      <meta name="description" content="{{category.Description}}">
      
      This method is very useful when you need to perform additional processing for a specific page type's TDK, or make conditional judgments. Usually,tdkThe universal tag can meet most situations, but direct access to fields provides more detailed control capabilities.

**Practical and SEO Suggestions

  • Uniqueness:Ensure that each page's keywords and descriptions are unique and avoid repetition. This is crucial for search engine crawling and ranking.
  • Relevance:The keywords and description should highly summarize the page content and be closely related to the page topic.
  • Length control:The description should be around 100-150 characters, too long will be truncated, and too short will lack information. The number of keywords should not be too many, 3-5 core keywords are enough.
  • Attractiveness:The description must include keywords and also be able to attract user clicks because it is directly presented in the search results.
  • Avoid stacking:Keywords should be naturally integrated into the description, avoiding deliberate stacking, which may be considered cheating by search engines.

AnQiCMS provides an intuitive backend management and powerful template tags, allowing you to easily control your website's Keywords and Description, thereby better optimizing SEO and enhancing your website's performance in search engines.Whether you are a beginner or a senior operator, AnQiCMS can provide efficient and convenient solutions to help you build a high-quality website friendly to search engines.


Frequently Asked Questions (FAQ)

Q1:tdkUniversal tags and direct access{{archive.Keywords}}What is the difference? Should I choose this way?A1:tdkThe Universal Tag is an intelligent aggregator that automatically retrieves the most suitable TDK information according to the type of page being accessed (such as the homepage, article details, category list, etc.). You usually only need to place it in the general header template of the website (base.htmlUsed oncetdkThe tag can take effect on all pages. While accessing directly{{archive.Keywords}}In this way, you need to clearly know which content object the current page is processing (such asarchiveorcategory),and manually add it to the corresponding detail page template. For most cases, it is recommended to usetdkThe versatile tag, it is more concise and efficient, and can intelligently adapt to different pages. When you need to perform more complex logic judgment or customization on a specific page, you can consider directly accessing the content field.

Q2: Why is my page not displaying or showing errors even though I have set keywords and descriptions?A2: This usually has several reasons:

1.  **模板未配置:** 您的前端模板(尤其是`base.html`或相应页面的头部文件)可能没有正确使用`tdk`标签或直接访问字段的代码来输出TDK信息。
2.  **后台未保存:** 确保您在后台对关键词和描述的修改