How does AnQiCMS dynamically display the page keywords (Keywords) and description (Description)?

Calendar 👁️ 65

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.  **后台未保存:** 确保您在后台对关键词和描述的修改

Related articles

How to set the page title (Title) in AnQiCMS template and automatically append the website name?

In website operation, the page title (Title) is a crucial element, it not only directly affects the willingness of users to click in the search engine results page (SERP), but is also a key indicator for search engines to judge the relevance of page content.A clear, standardized title that includes the website brand name, which can effectively enhance the professionalism and brand recognition of the website.AnQiCMS provides a flexible and powerful mechanism for setting website titles, allowing you to easily control the title of each page and automatically attach the website name

2025-11-08

How to customize the URL static rules of the article detail page in AnQiCMS?

In website operation, a clear and friendly URL structure is crucial for search engine optimization (SEO) and user experience.AnQiCMS provides flexible URL rewriting (URL rewrite) functionality, allowing users to customize the URL format of article detail pages according to their needs.This article will introduce in detail how to customize the URL static rules for the article detail page in AnQiCMS.Why do you need to customize URL static rules?

2025-11-08

How to display the publish time and update time of articles in AnQiCMS templates?

Understand the publication and update time of an article, which not only helps readers judge the timeliness of the content and avoid outdated information, but also is an important consideration for search engine optimization (SEO).AnQiCMS as an efficient content management system provides flexible template functions, allowing you to easily display these key time information on your website.

2025-11-08

How does AnQiCMS implement intelligent recommendation and display of related articles?

In content operation, effectively recommending relevant articles to readers can not only significantly increase user stay time and page views, but also indirectly promote search engines to crawl and allocate weights to the website's content through internal link optimization.AnQi CMS is well-versed in this, providing a smart and flexible mechanism to help users easily implement the recommendation and display of related articles.How does AnQiCMS implement intelligent article recommendation?

2025-11-08

How to implement the display of Canonical normative links in AnQiCMS templates to optimize SEO?

In the field of website operation and Search Engine Optimization (SEO), Canonical (standard) links are a very important concept.It can help search engines identify and handle duplicate content issues on websites, ensuring that the authority and ranking of the website are not affected by scattered content.In AnQiCMS (AnQi CMS), implementing the display of canonical links is a key step in optimizing website SEO, and through its flexible template system, this process becomes intuitive and efficient.

2025-11-08

What URL static mode does AnQiCMS support to optimize search engine crawling?

In today's internet world, an excellent website not only needs to provide high-quality content, but also needs to make it easy for users and search engines to discover this content.The importance of the structure of the URL (website address) is self-evident.A clean, meaningful URL not only improves user experience, but is also a key factor in search engine optimization (SEO).AnQiCMS (AnQiCMS) knows this and therefore took full consideration of the flexibility of pseudo-static URLs from the beginning, aiming to help users build websites friendly to search engines.Why is URL rewriting so important for SEO

2025-11-08

How to implement image lazy loading (Lazy Load) in AnQiCMS article content?

When building and operating a website, page loading speed is always a key factor in user experience and search engine optimization.Images are an important part of website content and are often one of the main reasons affecting loading speed.Implementing image lazy loading (Lazy Load) can significantly improve website performance, reduce unnecessary bandwidth consumption, and allow users to see page content faster.AnQiCMS as a powerful content management system, provides many conveniences for content operation.

2025-11-08

How to set the default thumbnail for AnQiCMS and automatically display it when there is no image in the article?

In website content operation, maintaining the unity of visual style is crucial for enhancing user experience.Especially for the article thumbnail, if some articles are missing images, blank spaces or placeholders appear on the page, which makes it look unprofessional.AnQiCMS (AnQiCMS) provides us with a very practical feature that allows us to easily set a default thumbnail, ensuring that even if the article does not have a dedicated image, it can automatically display a preset image, maintaining the beauty and consistency of the website interface.

2025-11-08