How to dynamically generate and display the page's SEO title, keywords, and description (TDK)?

Calendar 👁️ 63

Search engine optimization (SEO) is a key factor in the success of a website, and the page title (Title), keywords (Keywords), and description (Description), which we often call TDK, are also the core elements that search engines understand and display your web page content.They not only affect the willingness of users to click on search results, but also directly relate to the ranking performance of the website in search engines.

AnQiCMS as a corporate-level content management system has always given full consideration to SEO friendliness from the beginning of its design.It provides a flexible and efficient mechanism that allows you to easily dynamically generate and display these important TDK information, thereby helping your website content to be more easily discovered and understood by search engines.

Next, we will delve into how to effectively utilize these features in AnQiCMS.

Overview of TDK settings in AnQiCMS

In AnQiCMS, the TDK settings are not fixed, but provide multi-level configuration options based on page type and specific content to achieve fine-grained management.Understanding these setting levels is crucial for dynamically generating and displaying TDK.

Firstly,you can set a global homepage TDK for the entire websiteNext,for various content detail pages of the website,includingThis is usually completed in the 'Background Settings' under the 'Home Page TDK Settings'.Here, you can define the default title, keywords, and description for the home page of the website.These settings will serve as the final fallback content on pages without more specific TDK definitions.

Articles,products,single pages,categories and tagspages,AnQiCMS provides an independent TDK setting area.When editing articles, products, single pages, categories, or tags, you will see special "SEO title", "keywords", and "description" fields.For example, in "Add document" or "Document category help" there are clear SEO title and keyword/description settings.

These page-level TDK settings have higher priority.This means that when a page (such as a specific article) has its own TDK settings and the global homepage TDK, the system will prioritize the TDK defined by the page itself.If a page does not explicitly set a description but contains a lot of text, the system will also intelligently extract some text from the page content automatically to ensure that each page has complete TDK information.This flexible configuration method ensures that each page of your website has the most accurate and relevant SEO metadata.

Display TDK dynamically in the template

AnQiCMS provides powerful template tags, allowing you to easily dynamically call and display TDK information on the front-end template of the website. Among them,tdkThe universal tag is the core tool to achieve this goal, it can intelligently output the most suitable title, keywords, and description according to the type of the current page and the configured TDK priority.

Generally, you will use these tags in the<head>area of the template file.

Page Title (Title)

Page'sTitleTags are the content that search engines and users see first, and it is crucial to control them accurately. Usetdkwhen using tags, byname="Title"The parameter can be used to obtain the title of the current page.

You can display the page title in the following way:

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

In many cases, we want the page title to include the name of the website to enhance brand recognition. At this time, you can usesiteNameProperty.

{# 显示网站名称后缀 #}
<title>{% tdk with name="Title" siteName=true %}</title>

By default,siteName=trueIt will append the website name to the title and use a hyphen-As a separator. If you want to use a custom separator, you can usesepattribute:

{# 自定义分隔符为下划线 "_" #}
<title>{% tdk with name="Title" siteName=true sep="_" %}</title>

For category or content detail pages, sometimes you may also need to reflect the name of the parent category in the title to enhance the sense of hierarchy and relevance.showParent=trueAttributes can help you achieve this:

{# 显示上级分类标题 #}
<title>{% tdk with name="Title" siteName=true showParent=true %}</title>

Page Keywords (Keywords)

Keywords are important clues to help search engines understand the theme of a page. In the AnQiCMS template, bytdkLabel collaborationname="Keywords"you can dynamically obtain and display.

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

Page Description (Description)

The page description is a summary of the search engine results below the title, which usually affects the click-through rate. ThroughtdkLabel collaborationname="Description", you can easily output the page description information.

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

Standard Link (CanonicalUrl)

Standard linkCanonicalUrlIt is an important SEO element used to tell search engines which is the authoritative version of a page, especially when there is duplicate content or multiple URLs pointing to the same content.AnQiCMS can also intelligently generate standard links.

In the template, you need to first check if the standard link exists, and then set it to avoid outputting empty tags.

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

**Tips and Techniques

During the process of dynamically generating and displaying TDK, adhering to some practices can maximize your SEO effect:

  • UniquenessEnsure that the TDK of each page is unique and highly relevant. Avoid using the same TDK on a large number of pages, as this will dilute the weight of each page.
  • Keywords naturally integrateIn the title and description, naturally integrate the core keywords, but avoid cluttering. The description should be a short, attractive text that summarizes the page content and encourages users to click.
  • The difference between SEO title and content titleRemember that the content you fill in the 'SEO Title' field in the background is for search engines to see, while 'Document Title' and so on are for users to read on the page.These can be the same or different, strategically utilizing this difference can optimize search engine crawling while兼顾 user experience.
  • Utilizing a keyword library: AnQiCMS has built-in keyword library management functionality.Fully utilize it, it can help you easily select and manage keywords during content editing, ensuring the standardization and consistency of TDK.
  • Focusing on user intent: Always think about the keywords your target users might search for when writing TDK, and what kind of wording might attract them to click.

By using the flexible and powerful TDK management mechanism provided by Anqi CMS, you can easily achieve dynamic generation and precise control of the website's TDK.Properly configure the background settings and combine the clever use of template tags, so that your website content will have better visibility in search engines, thereby attracting more target visitors.

Frequently Asked Questions (FAQ)

**1. AnQiCMS page T

Related articles

How to correctly obtain and display contact information in the template?

In website operation, clearly and effectively displaying contact information is crucial for user experience and business conversion.AnQiCMS (AnQiCMS) provides us with flexible and powerful features, allowing us to easily retrieve and display these key information in templates. --- ### **Backend Configuration: Source of Contact Information** All website contact information is centralized in the backend for unified management in AnQi CMS.This means that whether you need to modify the contact phone number, email, or add new social media links, you do not need to touch any code, just perform simple operations in the background

2025-11-08

How to accurately call the system settings (such as website name, Logo) in the template for display?

As AnQi CMS users, we often need to ensure that the core information of the website, such as the website name, Logo, filing number, etc., is displayed accurately and correctly on all pages of the website.This concerns the unity of brand image, and it directly affects user experience and search engine optimization.AnQi CMS with its efficient architecture based on the Go language and template engine syntax similar to Django, makes the invocation of these basic information intuitive and flexible.Next, let's explore how to easily call and display these important system settings in the Anqi CMS template.Useful ###

2025-11-08

What flexibility does the Django template engine syntax provide in content display?

AnQi CMS as an efficient and flexible content management system, its flexibility in content display is largely due to its support for Django template engine syntax.For us content operators and website administrators, this means we do not need to deeply learn complex programming languages, but can freely organize and present website content as if we were building with blocks.Then, what flexibility does the Django template engine syntax bring to our content display?### One, direct and efficient data call and display First

2025-11-08

How can AnQiCMS improve the loading and display speed of website content through static caching?

In today's fast-paced digital world, website loading speed is no longer just a bonus, it has become a key determinant of user experience and search engine rankings.When visitors click on your website link, they expect the content to appear instantly.Any delay can lead to customer loss. Fortunately, content management systems like AnQiCMS have already regarded website speed optimization as one of their core strengths, especially through their powerful static caching mechanism.Why is website speed so important?\n\nImagine you visit a website

2025-11-08

How to build a multi-level navigation menu in AnQiCMS to optimize the display of the website structure?

The website's navigation system, like a city map, guides visitors to explore every corner of your website. A clear, intuitive multi-level navigation not only greatly enhances the user experience but is also an indispensable part of Search Engine Optimization (SEO), helping search engines better understand the structure of the website and thereby improve content inclusion and ranking.In AnQiCMS, building a set of efficient and beautiful multi-level navigation menus is actually simpler than you imagine. It provides flexible backend configuration and powerful template tags, allowing you to easily implement it.Build Navigation Basics

2025-11-08

How can the breadcrumb navigation of the current position be displayed on the page?

In website navigation, Breadcrumb navigation is a very practical auxiliary tool.It clearly shows the user's current position on the website, provides a convenient return path, thereby significantly improving the user experience, and also has a positive effect on search engine optimization (SEO), helping search engines understand the structural hierarchy of the website.AnQiCMS has fully considered this point and provided a simple and powerful way to display breadcrumb navigation on the page.With built-in template tags, even without complex programming knowledge, this feature can be easily implemented.###

2025-11-08

How to display category lists on the homepage or category pages?

In Anqi CMS, managing and displaying the category list is the core of website content organization.It is crucial to clearly display the classification structure for optimizing user navigation experience or improving search engine crawling efficiency.The Anqi CMS provides concise and powerful template tags, allowing you to easily display your content categories on the homepage, category pages, or any place you need.### Understanding Core: `categoryList` Tag In the AnQiCMS template system, the main tag used to retrieve the category list is `categoryList`

2025-11-08

How to retrieve and display detailed information for a specific category, such as the category logo and introduction?

In website operation, a clear and informative classification display is the key to attracting visitors, improving user experience, and optimizing search engine rankings.AnQiCMS provides a user-friendly and powerful template tag system that allows you to flexibly obtain and display detailed information of various categories on your website, such as category logo and introduction, thereby creating a more attractive content layout. ### Understand Category Information Management and Configuration Category information management is very convenient in the Anqi CMS backend.When you enter the 'Content Management' under 'Document Category' to add or edit

2025-11-08