In website operation, Search Engine Optimization (SEO) is a key link to enhance website visibility.Among them, the page title (Title), keywords (Keywords), and description (Description), known as TDK, play a crucial role.They are not only the primary information for search engines to understand the content of the page, but also an important factor to attract users to click.In AnQiCMS (AnQiCMS), we can easily implement the dynamic display of TDK, allowing each page of the website to have relevant and attractive TDK information.

The AnQi CMS took SEO needs into full consideration from the beginning, therefore, it provides a flexible and intelligent TDK management mechanism.The core concept is: by setting the default TDK globally on the website and then allowing personalized settings on more specific page types (such as articles, categories, single pages, and tag pages), the dynamic adaptation of TDK is achieved.This ensures that even if a page does not have a separate TDK set, it can still have a reasonable default value, while also allowing important pages to have precise optimization of TDK.

To implement the dynamic display of TDK, we mainly use a powerful tag in the Anqi CMS template -tdkThe tag is designed to intelligently judge the type of the current page and the TDK information configured, and automatically output the most suitable TDK for the current page.This means that you just need to place in the public header file of the website template (such asbash.htmlorheader.htmlConfigure once in the}tdkLabels, no need to write TDK logic for each page individually, greatly simplifies the maintenance of templates.

Integrated in the templatetdkTag

Generally, TDK information is located in the HTML document.<head>Area. Below is an example of the TDK core code that you can add to the template file/template/您的模板目录/partial/header.html

<head>
    <meta charset="UTF-8">
    <title>{% tdk with name="Title" siteName=true sep=" - " %}</title>
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    <meta name="description" content="{% tdk with name="Description" %}">
    {%- tdk canonical with name="CanonicalUrl" %}
    {%- if canonical %}
    <link rel="canonical" href="{{canonical}}" />
    {%- endif %}
    {# 其他头部元素,如样式表、Favicon 等 #}
</head>

This code is the foundation of dynamic TDK. Let's delve deepertdkHow do tags work intelligently on different pages.

TDK configuration on the homepage

For the website's home page TDK, AnQi CMS provides a dedicated backend setting entry.You can directly fill in the title, keywords, and description of the homepage in the "Homepage TDK Settings" in the background.When the user visits the homepage of the website, the template mentioned above includestdkTags will automatically extract and display this preset homepage information.

TDK for articles and product detail pages.

In content management, whether it is publishing articles or products, Anqi CMS provides detailed SEO setting options for each piece of content.When editing articles or products, you can find fields such as "SEO Title", "Document Keywords", and "Document Description".

  • SEO title: If you enter content here,tdkthe tag will be used first as the page<title>. If left blank, it will intelligently backtrack to the title of the article itself.siteName=trueThe parameter ensures that your website name is automatically appended to the title, enhancing brand recognition. You can alsosepcustom separator parameters, for examplesep=" | ".
  • Document keyword: The keywords entered here will be directly used on the page.<meta name="keywords">.
  • Document Introduction: The document summary content will be automatically filled in the page.<meta name="description">tag. If not filled, the system will try to automatically extract the first 150 characters from the article text.

This layered setting method ensures that each piece of content has highly relevant TDK.

TDK of the category list page.

For the article or product category list page, you can set independent TDK for each category in the background "Document Category" management.In the category editing interface, the same fields such as 'SEO title', 'keywords', and 'category description' are provided.

  • SEO titleIf a SEO title is set for the category, it will become the title of the category list page. If it is empty, the category name will be used as the title, and the website name can be appended.
  • KeywordsThis is used as the keywords Meta tag for the category list page.
  • Category introductionThis is the description Meta tag content for the category list page.

Such, different content categories pages can also have their own exclusive SEO optimization.

Single-page TDK

Similar to independent single pages such as "About Us", "Contact Information", etc., their TDK management method is similar to that of article detail pages.When editing a single page in the "Page Management", you can set the "SEO Title", "Keywords", and "Single Page Description" for each page.tdkTags will call this information accordingly.

TDK of tag detail page

The Anqi CMS also supports setting TDK for 'Tags' (Tag) in the website.In the 'Document Tags' management, you can edit the 'SEO Title', 'Tag Keywords', and 'Tag Description' for each tag.When the user visits the detail page of a specific tag,tdkThe tag will dynamically load the TDK information corresponding to the tag.

Application of the specification link (Canonical URL)

In SEO, the canonical URL is used to tell search engines which is the preferred version of the page, to avoid SEO issues caused by duplicate content. Anqi CMS'stdkTags also support dynamic output of specification links. The 'specification link' field entered in the article or category settings, will be{% tdk with name="CanonicalUrl" %}Label output. It is worth noting that this code is usually wrapped in a conditional judgment to ensure that it only outputs when the page indeed has a standard link, thus avoiding the output of an empty label.

Summary

AnQi CMS through a unifiedtdkLabel and multi-level backend configuration make the implementation of dynamic TDK extremely simple and efficient.From global default to page customization, to intelligent rollback, every link is aimed at providing **SEO support for the website.This means that website operators can focus more on content creation and overall strategy, without spending too much energy on the cumbersome configuration of TDK, thereby enabling the website to perform better in search engines.


Frequently Asked Questions (FAQ)

1. If I do not set TDK separately on the article or category page, how will AnQi CMS handle it?

AnQi CMS has an intelligent rollback mechanism. If the page (such as articles, categories, single pages, tag pages) does not set an independent SEO title, keywords, or description, the system will automatically obtain and fill in according to a certain priority.For example, if the article does not have an SEO title set, it will use the title of the article itself;If no document summary is set, the first 150 characters will be automatically extracted from the article content.Finally, if all page-level settings are missing, it will also fallback to the website global default TDK that you have configured in the background "Home TDK Settings", ensuring that each page has basic TDK information.

2.tdklabel'ssiteName=trueHow do the parameters work? Can I customize the site name and delimiter?

siteName=trueparameter is mainly used fortdkTags are automatically appended to the page title with your website name, for example, "Page Title - Your Website Name", which helps enhance brand exposure.You can set the "Website Name" in the "Global Function Settings" on the backend.Regarding the separator,tdkTags provide asepparameters, for example{% tdk with name="Title" siteName=true sep=" | " %}Can I change the default hyphen (-) to?