How to call the TDK (Title, Keywords, Description) information of the page in AnQiCMS template?

Calendar 👁️ 50

As a website operator who deeply understands the operation of AnQiCMS, I am well aware of the importance of TDK (Title, Keywords, Description) information for the performance of the website in search engines and the user's intention to click.AnQiCMS was designed with SEO-friendliness in mind from the beginning, providing us with flexible and powerful mechanisms to manage these key metadata.Correctly calling TDK in the template is the basis for ensuring that website content is indexed efficiently, improves click-through rates, and enhances user experience.

Understand the importance of TDK in AnQiCMS

The website's Title, Keywords, and Description are not just a few HTML tags; they are the core elements that search engines use to understand the page topic, determine ranking, and allow users to initially judge the content of the page in the search results page.AnQiCMS as a content management system focusing on SEO optimization integrates TDK management into each content unit, providing detailed configuration options for homepages, articles, products, categories, and single pages.Call this information in the template, which is to present the carefully configured optimization strategy on the user and search engine.

The core calling tag of TDK information in AnQiCMS template

In the AnQiCMS template system, the TDK information of the called page is mainly through a namedtdkThe universal tag to implement. This tag is designed to be very flexible, able to automatically retrieve and output the corresponding TDK data according to the type of the current page (such as the homepage, article detail page, category list page, etc.), and also allows for additional customization and adjustment.

Called page title (Title)

The page title is the most important component of the TDK information, which directly affects the display of the search engine results page and the initial perception of the user for the page content. In the AnQiCMS template, we can call the page title in the following way:

<title>{% tdk with name="Title" %}</title>

This code will output the title tag content of the current page.AnQiCMS will intelligently generate the most appropriate title based on the type of page and backend configuration.For example, on the article detail page, it may prioritize the article's SEO title, and if it is not set, it will fallback to the article title.On the category page, the category's SEO title or category name will be used.

To better control the display of the title,tdkthe tag provides several optional parameters:

  • siteName: This parameter is used to control whether the website name is appended to the page title. When set tositeName=trueWhen, the system will automatically append the name configured in the website background to the page title after it, separated by the default delimiter “-”. If set tofalse, it will not be appended.
    
    {# 显示网站名称后缀 #}
    <title>{% tdk with name="Title" siteName=true %}</title>
    
  • sepThis parameter allows us to customize the separator between the website name and the page title.By default, the separator is the hyphen “-”, we can change it to an underscore “_” or other symbols.
    
    {# 自定义分隔符为下划线 #}
    <title>{% tdk with name="Title" siteName=true sep="_" %}</title>
    
  • showParentThis parameter is particularly useful on the category page. When set toshowParent=trueIf the current category has a parent category, the page title will include the title of the parent category, forming a hierarchical title structure that is clearer.
    
    {# 在分类页面显示上级分类标题 #}
    <title>{% tdk with name="Title" showParent=true %}</title>
    

The combination of these parameters allows us to finely control the performance of each page's Title, thus better serving the SEO strategy.

Call page keywords (Keywords)

The keyword is another key component of TDK, although its direct ranking weight has decreased in modern SEO, it still helps search engines understand the content of the page, and it still has reference value for some vertical search engines and old algorithms. The way to call the page keyword in the AnQiCMS template is as follows:

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

Similar to Title, AnQiCMS automatically retrieves the corresponding keywords according to the page type.On the article or product detail page, it will prioritize the keyword field of the content; on the category page, it will use the category keywords; on the homepage, it will use the keywords in the background "homepage TDK settings".

Page Description (Description)

The page description is the summary information below the Title on the search engine results page, which is the key copy to attract users to click.An engaging, accurate description of the page content that can significantly increase the page click-through rate (CTR).

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

The intelligence of AnQiCMS lies in the fact that if we do not explicitly fill in the Description for a specific page in the background, it will automatically extract the first 150 or so characters from the page content as the description.Of course, we can also manually fill in SEO descriptions when publishing content, managing categories, or pages, and these manually filled content will have higher priority.

Canonical URL (Canonical URL)

The canonical URL is not the traditional TDK, but it plays a crucial role in SEO, used to solve content duplication issues.When multiple URLs point to the same or very similar content on a website, by setting the Canonical URL, we can tell search engines which is the preferred version of the content, thus avoiding search engine penalties and concentrating page authority.

{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}

We used a conditional judgment here{% if canonical %}Because the Canonical URL is not required for all pages or must be set.Only when the page background explicitly sets the standard link, will it be output, which is a good SEO practice.AnQiCMS allows us to set independent specifications links in the article, category, single page, and other editing interfaces.

TDK information call priority and **practice

AnQiCMS TDK information call follows a clear priority mechanism:

  1. Specific content page settingsFor example, the article detail page will prioritize reading the SEO title, keywords, description, and canonical link of the article itself.
  2. Category page settingsIf the current page is a category list page, it will read the SEO title, keywords, and description of the category.
  3. Single page settings: Single-page will use its independent configuration of SEO title, keywords, and description.
  4. Home TDK settings: For the homepage of the website, it will call the information configured in the background "Homepage TDK settings".
  5. Content is automatically extractedIf the page does not explicitly set the description, the system will automatically extract a portion of the content as Description.

As website operators, we should make full use of these flexible settings provided by AnQiCMS.Write a unique and attractive Title and Description for each page, and choose the most relevant Keywords, which is the key to improving search engine visibility and click-through rate.At the same time, pay attention to the setting of Canonical URL to avoid SEO issues caused by duplicate content and ensure the healthy development of the website.By correctly and intelligently calling these TDK information in the template, we can lay a solid foundation for the website's SEO performance.

Frequently Asked Questions

Q1: Why is my page title not displaying the website name suffix?A1: Page title is not automatically appended with the website name suffix by default. If you want the website name to be displayed after the page title, you need to explicitly add it in thetdktag.siteName=truefor example:<title>{% tdk with name="Title" siteName=true %}</title>.

Q2: If I do not fill in the SEO description for the article or category, how will AnQiCMS handle it?A2: AnQiCMS is very intelligent.If you do not explicitly fill in the SEO description (Description) for an article, product, category, or single page, the system will automatically extract the first 150 or so characters of the content on the page as the page Description.This ensures that even without manual configuration, the page always has a description, enhancing search engine friendliness.

Q3: Can I use different TDK separators for different types of pages?A3:tdklabel'ssepThe parameter is a global separator setting for the Title tag, which will apply to allsiteName=trueThe Title call. If you need to use different separators for different types of pages (such as article pages and product pages), you may need to make conditional judgments when calling the Title and set them separatelysepParameters, or directly include the required separator when customizing TDK in the background, no longer dependentsepParameters are added automatically.

Related articles

How to get contact information in AnQiCMS template (such as phone, email)?

As a website operator who has been deeply involved in AnQiCMS for many years, I know the importance of clearly and effectively displaying key information, especially contact information, on the website front-end template.This is not only about user experience, but also the key to building trust and promoting communication.AnQiCMS was designed with this in mind from the beginning, providing intuitive and flexible template tags that allow developers to easily access and display this information.Next, I will elaborate on how to obtain and display contact information in the AnQiCMS template, such as phone and email.

2025-11-06

How to get system configuration information (such as website name, Logo) in AnQiCMS template?

As an expert in the long-term operation of AnQiCMS content, I fully understand the importance of dynamically obtaining system configuration information in the template.Efficiently display the website name, logo, and other core elements, which not only ensures brand consistency but also can flexibly adapt to changes in operational strategies.AnQiCMS's powerful template engine provides intuitive and feature-rich tags, making it easy to obtain these system-level configurations in front-end templates.

2025-11-06

How to use double curly braces to define variables and single curly braces with percentages to define tags in AnQiCMS templates?

As an experienced website operator who deeply understands the template mechanism of AnQiCMS, I know that template language is the foundation for the efficient presentation and management of website content.In AnQiCMS, the template system adopts a syntax similar to the Django template engine, with the core being two main syntax structures: double curly braces `{{ ... }}` and used for controlling logic and executing specific operations with single curly braces percent sign `{% ...Invalid JSONUnderstanding and mastering these two structures is the key to building efficient, dynamic website templates.

2025-11-06

What are the basic conventions and file directory structure for AnQiCMS template creation?

As a senior practitioner who deeply understands the operation of AnQiCMS, I know the core position of templates in website construction.A well-structured template that follows conventions can not only present content efficiently but is also the foundation of website SEO and user experience.Below, I will elaborate on the basic conventions and file directory structure of AnQi CMS template creation, hoping to provide strong support for your content creation and management on AnQiCMS.

2025-11-06

How to get and display the navigation list and its sub-menu in AnQiCMS template?

## AnQiCMS Navigation List and Submenu Display in Templates As an experienced AnQiCMS website operations personnel, I am well aware of the importance of a clear and efficient website navigation for user experience and content access.AnQi CMS provides a powerful and flexible navigation list tag `navList` for template developers, making it easy to obtain and display the main navigation, footer navigation, and even more complex multi-level navigation structures with submenus on the website front-end.

2025-11-06

How to call the article or product category list in AnQiCMS template and implement multi-level nesting?

As a senior website operator at AnQiCMS, I fully understand that efficient content organization and presentation are crucial for user experience and SEO.Categorization list, especially multi-level nested categorization lists, can clearly present the hierarchical structure of the website's content, guide users to discover more interesting content, and also provide clear site structure information for search engines.This article will detail how to call the article or product category list in the AnQiCMS template and implement a multi-level nested display effect.

2025-11-06

How to obtain document detail data and display content in AnQiCMS template?

As an experienced security CMS website operator, I know that it is crucial to efficiently and accurately obtain and present document detail data in terms of content display.A well-crafted detail page not only meets users' in-depth information needs, but also effectively enhances the website's stickiness and search engine performance through optimizing content structure and user experience.In Anqi CMS, taking advantage of its flexible Django template engine syntax, obtaining and displaying document detail data is a direct and powerful process.

2025-11-06

How to call the previous and next document links in AnQiCMS template?

As a senior CMS website operation personnel in an enterprise, I am well aware of the importance of content navigation for user experience and SEO.On a day when the content of the website is becoming richer and richer, how to guide users to smoothly browse related content is a key factor in enhancing user stickiness and reducing the bounce rate.Today, we will delve into how to cleverly call the links of the previous and next documents in the AnQiCMS template to optimize your website's content structure and user path.### Enhancing User Experience and SEO: Navigation of Previous and Next Documents in AnQiCMS Templates In the Content Management System

2025-11-06