In website operation, each page's Title (title), Keywords (keywords), and Description (description) information, which is what we commonly call TDK, plays a crucial role.They are not only the key to search engines understanding page content, but also important factors in attracting users to click.In AnQiCMS, dynamically setting these information for each page is much more efficient and flexible than you imagine.
How to make TDK settings efficient and convenient in AnQiCMS?
One of the design philosophies of AnQi CMS is to focus on SEO optimization and content management efficiency.It does not provide a global TDK setting like some traditional CMS, and then let all pages follow suit.On the contrary, AnQiCMS allows you to independently configure TDK for almost all types of pages, including the homepage, article details, product details, category list pages, single pages, even tag pages.This fine-grained control ensures that each page has the most accurate and relevant metadata, thereby achieving better performance in search engines.
This is achieved through two core steps: first, fill in the TDK information in the corresponding content editing interface of the Anqi CMS backend; second, dynamically call this information using the TDK tags provided by Anqi CMS in the website template files.
First step: Configure TDK information for each page in the background
The backend management interface of Anqi CMS is intuitive and powerful, and you can find the corresponding TDK setting entry in different modules according to the page type.
1. TDK settings on the website homepage
The homepage, as the facade of the website, is particularly important for its TDK configuration. You can navigate toBackend settings-Homepage TDK settingsModify the title, keywords, and description of the homepage. The content you enter here will be directly applied to the homepage of your website.
2. TDK settings for article and product detail pages
For specific article or product pages, you can configure them when publishing or editing content: Go intoContent management-Publish document(or edit an existing document), scroll down on the editing page to see a ""Other parameterscollapse box. After expanding, you will find:)
- SEO titleThis is the title displayed in search engine results for the page, which is usually more concise or more marketing-oriented than the actual article title.
- Document keywordsHere you can fill in keywords highly relevant to the current article or product content, please use English commas between multiple keywords
,. - Document SummaryThis usually corresponds to the page's Description, used to describe the content of the page.If you leave it blank, Anqi CMS will automatically extract the first 150 characters of the article content as a summary.
3. TDK settings on the category page
Category pages (such as “News Information”, “Company Products”) also need independent TDK to improve the SEO effect of their category content: Enter.Content management-Document CategorySelect or edit a category. In the category information editing interface, you will see:
- SEO title: This is the search engine title for the category page.
- KeywordsThe keywords for this category page, using English commas as well.
,. - Category IntroductionThe Description for this category page, describing the overall overview of the content under the category.
4. Single Page TDK Settings
Independent single pages such as "About Us", "Contact Us", etc. also need their own TDK: EnterPage Resources-Page ManagementSelect or edit a single page. In the interface for editing single page information, you will see:
- SEO title: This is the title that will be displayed in the search engine results for the single page.
- KeywordsThe keywords of this single page.
- Single page introductionThe description of this single page in search engine results.
5. TDK settings of the tag page
The label page can aggregate and display related content of different categories or models, and its TDK can also be managed separately: Go intoContent management-Document LabelSelect or edit a tag. In the tag information editing interface, you will see:
- SEO title: The search engine title for this tag page.
- Tag keywords: The keywords for this tag page.
- Label Introduction: As the Description of this tag page, describe the general overview of the aggregated content of the tag.
By carefully filling in the TDK information at these positions in the background, you have laid a solid foundation for dynamic display.
Step 2: Correctly reference the TDK tags in the template file.
After configuring the background information, the next step is to correctly call these data in the website template. The Anqi CMS provides powerfulUniversal TDK tagstdkLet this process become very simple. Usually, these TDK tags need to be placed in your website template files (such asbase.html) of<head>areas.
Here's how to use them in the templatetdkTags to dynamically set Title, Keywords, and Description:
<!DOCTYPE html>
<html lang="{% system with name='Language' %}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# 页面标题(Title) #}
<title>{% tdk with name="Title" siteName=true sep="_" %}</title>
{# 页面关键词(Keywords) #}
<meta name="keywords" content="{% tdk with name="Keywords" %}">
{# 页面描述(Description) #}
<meta name="description" content="{% tdk with name="Description" %}">
{# 规范链接(Canonical URL) - 强烈建议添加,用于避免重复内容问题 #}
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
<!-- 其他CSS、JS引入等 -->
<link href="{% system with name="TemplateUrl" %}/css/style.css" rel="stylesheet">
</head>
<body>
<!-- 网站内容 -->
</body>
</html>
Let's break it down:tdkParameters in the tag:
name="Title"[en] : It indicates the title information of the page you are calling.siteName=true[en] : Optional parameter, if set astrue[en] , AnQiCMS will automatically append the information you entered in[en] Global function settings配置 the "Website Name".sep="_": Optional parameter, used to set the separator between the title and the website name, default is a hyphen.-. You can adjust it as needed, for example, set it to an underscore._or vertical line|.showParent=true: Optional parameter, mainly used for classification pages. If set totrue, it will display the parent category title in the title, making the hierarchy clearer.
name="Keywords"[en]: Indicates the keyword information of the page you are calling.name="Description"[en]: Indicates the description information of the page you are calling.name="CanonicalUrl"[en] Used to generate the specification link of the page.The规范link is an important part of SEO, telling search engines which URL is your preferred version, and avoiding duplicate content issues caused by URL parameters, protocols (HTTP/HTTPS), or subdomains.{% if canonical %}Make a judgment to ensure that the tag is only output when the page has a standard link, which is a robust practice.
Through such configuration, Anqi CMS will automatically find and output the corresponding TDK information based on the type of the current visited page (home page, article, category, single page, tag, etc.). When a page does not have an explicitly set TDK, the system will also have default processing logic, such asDescriptionIt will automatically extract from the content.
Some suggestions for optimizing TDK.
- Maintain uniqueness and relevance.Each page's TDK should be unique and accurately reflect the core content of the page. Avoid using the same TDK template.
- Keywords should be naturally integratedIntegrate core keywords naturally into the Title and Description, but avoid keyword stuffing. The focus is to provide value to users and search engines.
- Write an attractive Description【en】Description is the content summary that users see in search results. An attractive description can significantly improve click-through rates.
- 【en】Utilize long-tail keywords[en] : In addition to core keywords, also consider incorporating some long-tail keywords into the Description to capture more specific search intent.
- [en] : Regular review and optimizationWith the growth of website content and the changes in search engine algorithms, it is necessary to regularly check and optimize TDK.
Common Questions (FAQ)
Q1: I have set up the TDK in the background, but the front page does not display or displays incorrectly. What should I do? A1:This usually has several reasons:
* **缓存问题:** 请首先尝试清除AnQiCMS的系统缓存(在后台菜单中找到“更新缓存”功能),并清除您浏览器自身的缓存。
* **模板标签未正确使用:** 请仔细检查您的模板文件(通常是`base.html`或相应页面的模板),确认是否正确使用了`{% tdk ... %}`标签,包括`name`参数是否正确,以及是否被放置在