In website operation, each page's Title (title), Keywords (keywords), and Description (description) information, which is what we often call TDK, plays a vital role.They are not only the key for search engines to understand the content of the page, but also important factors to attract users to click.In AnQiCMS, dynamically setting this information for each page is much more efficient and flexible than you might imagine.
How can AnQiCMS make TDK settings efficient and convenient?
One of AnQi CMS's design concepts is to focus on SEO optimization and content management efficiency.It is not like some traditional CMS that only provides a global TDK setting and then makes all pages use it.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, and even tag pages.This fine-grained control ensures that each page can have the most accurate and relevant metadata, thereby achieving better performance in search engines.
This is mainly achieved through two core steps: first, fill in the TDK information in the corresponding content editing interface of the Anqi CMS background; second, use the TDK tags provided by Anqi CMS in the website template files to dynamically call this information.
Step 1: Configure TDK information for each page in the background
The AnQi CMS admin interface is intuitive and powerful, you can find the corresponding TDK setting entry in different modules according to the page type.
1. Website Home Page TDK Settings
The homepage is the face of the website, and its TDK configuration is particularly important. You can navigate toBackend settings-u003eHome TDK settingsModify the title, keywords, and description of the homepage. The information entered here will be directly applied to the homepage of your website.
2. TDK settings for article and product detail pages
For specific articles or product pages, you can configure during content publishing or editing: EnterContent Management-u003ePublish document(or edit an existing document), scroll down on the editing page to see a “.The collapse box. Expand it and you will find:
- SEO title: This is the title displayed in the search engine results for the page, which is usually more concise or more promotional than the actual article title.
- Document keywordEnter keywords highly relevant to the current article or product content, separated by English commas
,Separated. - Document IntroductionThis usually corresponds to the page Description, used to describe the page content.If you leave it blank, AnQi CMS will automatically extract the first 150 characters of the article content as a summary.
3. TDK settings for the category page
Category pages (such as "News Information", "Company Products") also need independent TDK to enhance the SEO effect of their categorized content: EnterContent Management-u003eDocument CategorySelect or edit a category. You will see this in the category information editing interface:
- SEO titleThis is used as the search engine title for the category page.
- KeywordsThe keywords for this category page, using English commas as well
,Separated. - Category introductionThe Description for this category page, describing the overall overview of the content under the category.
4. TDK settings for a single page
Independent single pages such as "About Us", "Contact Us", etc. also need their own TDK: EnterPage Resources-u003ePage ManagementSelect or edit a single page. In the interface for editing single page information, you will see:
- SEO titleTitle for the single page displayed in search engine results.
- KeywordsThe single page's keywords.
- Single page introductionThe description of the 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: EnterContent Management-u003eDocument TagSelect or edit a tag. You will see in the tag information editing interface:
- SEO title: Used as the search engine title for the tag page.
- Tab keywords: Keywords for the tag page.
- Tab description: As the Description of this tag page, describe the general overview of the aggregated content of the tag.
By meticulously filling in the TDK information at these locations in the background, you have laid a solid foundation for dynamic display.
Step two: Properly 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. Anqi CMS provides powerfulUniversal TDK tagstdkThis process becomes very simple. Usually, these TDK tags need to be placed in your website template file (such asbase.html)的<head>Within the area.
The following is how to use it in the templatetdkUse tags 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 downtdkParameters in the tag:
name="Title": indicates the title information of the page you are calling.siteName=true: Optional parameter, if set to.true, AnQiCMS will automatically append the name you set in.Global feature settingsto the page title.sep="_"Optional parameter, used to set the separator between the title and the website name, the default is a hyphen-You can adjust it as needed, for example, set it to an underscore_or a vertical line|.showParent=trueOptional parameter, mainly used for category pages. If set totrueIt will display the parent category title in the title, making the hierarchy clearer.
name="Keywords"This indicates the keyword information of the page you are calling.name="Description"This indicates the description information of the page you are calling.name="CanonicalUrl"Used to generate the standard link of the page. The standard link is an important part of SEO, it tells the search engine which URL is your preferred version, avoiding duplicate content issues due to URL parameters, protocols (HTTP/HTTPS), or subdomains.Pay attention to the use of here{% if canonical %}Make a judgment to ensure that the label is output only when there is a standard link on the page, which is a robust practice.
By configuring it this way, Anqi CMS will automatically search and output the corresponding TDK information based on the type of the current page being accessed (home page, article, category, single page, tag, etc.). When a page does not have a TDK set explicitly, the system will also have default handling logic, such asDescriptionIt will automatically extract from the content.
Some tips 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 naturally integrateIncorporate the core keywords naturally in the Title and Description, but do not clutter. The focus is to provide value to users and search engines.
- Write an attractive Description: Description is the content summary that users see in search results, and an attractive description can significantly increase click-through rates.
- Using long-tail keywordsConsider incorporating some long-tail keywords into the Description as well, to capture more specific search intentions.
- Regular review and optimization: It is necessary to regularly check and optimize TDK with the growth of website content and changes in search engine algorithms.
Frequently Asked Questions (FAQ)
Q1: How do I handle the situation where I have set TDK in the background, but the front-end page does not display or displays an error? A1: This usually has several reasons:
* **缓存问题:** 请首先尝试清除AnQiCMS的系统缓存(在后台菜单中找到“更新缓存”功能),并清除您浏览器自身的缓存。
* **模板标签未正确使用:** 请仔细检查您的模板文件(通常是`base.html`或相应页面的模板),确认是否正确使用了`{% tdk ... %}`标签,包括`name`参数是否正确,以及是否被放置在