In today's internet environment where content is exploding, Search Engine Optimization (SEO) is crucial for the visibility of websites.The Title (title), Keywords (keywords), and Description (description) of the website page, also known as TDK, are the key factors that search engines understand the content of the page, decide whether to display it to users, and whether users click.In AnQiCMS, a content management system designed specifically for small and medium-sized enterprises and content operation teams, flexibly and dynamically generating these TDK information is a powerful tool to improve website SEO performance and optimize user experience.
AnQiCMS thanks to its efficient and customizable features, provides powerful SEO tools, including fine-grained control over TDK.It is not just a static field entry, but also a dynamic mechanism that can be automatically generated or manually overridden based on page type and content attributes.tdkTags can dynamically generate the page Title, Keywords, and Description.
How does AnQiCMS manage TDK information?
In AnQiCMS, the management of TDK information is hierarchical, which gives the website great flexibility:
Global default settings (home page TDK):Firstly, you can configure the default Title, Keywords, and Description for the entire website's homepage in the "Background Settings" -> "Homepage TDK Settings" of AnQiCMS backend.These are the most basic and core SEO statements on the website. When a specific page does not have a separate TDK set, the system may use these global settings as a fallback (especially on the home pages of certain default templates).
Content hierarchy setting (article, product, single page, category, tag):In addition to global settings, AnQiCMS allows you to define independent TDK for each specific page in different types of content editing interfaces:
- Document (articles, products, etc.) publishing:When adding or editing documents, you can find fields such as 'SEO Title', 'Document Keywords', and 'Document Description'.The “SEO Title” will be used as the preferred content for the Title, while the “Document Summary” is usually used for the Description.
- Category Management:When creating or editing a category, there are also options such as 'SEO Title', 'Keywords', and 'Category Description'. These settings will affect the list page of the category.
- Single Page Management:For independent pages such as 'About Us', 'Contact Us', etc., there are also independent 'SEO Title', 'Keywords', and 'Single Page Introduction' for you to configure.
- Document tags:Even for tabs, AnQiCMS provides settings for 'SEO Title', 'Tag Keywords', and 'Tag Description' to ensure that each page is optimized.
This layered management mechanism means that you can first set a general TDK strategy, and then make refined adjustments for important or special pages to achieve the optimal SEO coverage.
Core tags:tdkUsage
AnQiCMS's template system is very powerful and easy to use, it uses syntax similar to Django template engine. To dynamically obtain and display TDK information, we mainly rely onIngenioustdktags.
tdkThe basic usage of the label is:{% tdk 变量名称 with name="字段名称" %}In which, the 'variable name' is optional. If you want to assign the value obtained to a variable for subsequent processing, you can specify it; if not specified,tdkThe label will directly output the result.nameThe parameter specifies which type of TDK information you want to obtain.
1. Dynamically generate page Title
The page title is one of the most important SEO elements. UsetdkThe label acquisition Title is very intuitive, and AnQiCMS provides a wealth of parameters to meet the needs of different scenarios.
To get the current page Title, it is usually written in the template's<head>area like this:
<title>{% tdk with name="Title" %}</title>
But AnQiCMS has given Title more dynamic features:
Additional Website Name:Many website titles are formatted as 'Page Title - Website Name'. You can
siteName=trueautomatically append the website name as a parameter:<title>{% tdk with name="Title" siteName=true %}</title>这样,如果您的页面标题是“AnQiCMS Tutorial”,网站名称是“AnQiCMS”,最终 Title 可能会显示为“AnQiCMS Tutorial - 安企CMS”。}]
Custom separator:By default, the website name and page title will be separated by a hyphen
-separated. You can usesepparameters to customize the separator:<title>{% tdk with name="Title" siteName=true sep="_" %}</title>At this moment, the Title will display as 'AnQiCMS Tutorial_Ancient CMS'.
display the parent category title:For content with a hierarchical structure (such as article detail pages), you may want the Title to include the name of its parent category to provide a more complete context.
showParent=trueThe parameter can achieve this:<title>{% tdk with name="Title" siteName=true showParent=true %}</title>If the article “Dynamic Generation TDK” belongs to the “Template Creation” category, then the Title may display as “Dynamic Generation TDK - Template Creation - Anqi CMS”.This is very helpful for search engines to understand the breadth and depth of the page topic.
By combining these parameters, you can achieve highly customized dynamic generation strategies for the website's Title, whether it is the homepage, category page, or detail page, it can automatically adapt and display the most SEO-friendly Title.
2. Dynamic page generation Keywords
Keywords tags are still able to provide auxiliary information about the page topic to search engines, although their weight has decreased in modern SEO.In AnQiCMS, Keywords will be automatically obtained from the corresponding backend settings of the page (article keywords, category keywords, etc.)
In the template, you can introduce Keywords like this:
<meta name="keywords" content="{% tdk with name="Keywords" %}">
or, if you want to assign the keyword content to a variable:
{% tdk seoKeywords with name="Keywords" %}
<meta name="keywords" content="{{seoKeywords}}">
Make sure you have set relevant keywords for each page in the background, they will be dynamically extracted and displayed here.
3. Dynamic page generation Description
Description tag is the summary displayed below the Title in the search engine results page, which directly affects the user's click intention.Description clear and attractive is crucial for improving click-through rate.AnQiCMS will automatically obtain from the corresponding backend settings of the page (document introduction, category introduction, etc.) in English.
In the template, you can introduce it like this Description:
<meta name="description" content="{% tdk with name="Description" %}">
Similar to Keywords, you can also assign it to a variable:
{% tdk seoDescription with name="Description" %}
<meta name="description" content="{{seoDescription}}">
A good Description should concisely and clearly summarize the page content, include relevant keywords, and attract potential visitors to click.
4. Generate Dynamic Specification Link (Canonical URL)
The canonical URL is an advanced SEO concept, used to inform search engines of the 'preferred' URL for a page, to avoid negative SEO impacts caused by duplicate content (such as multiple URL paths for the same article, paginated content, etc.).AnQiCMS similarly supports dynamically generating Canonical URL for pages.
Since not all pages require or have an independent Canonical URL, **the practice is to first check for its existence before setting it:**
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
This code attempts to retrieve the current page's Canonical URL. If there is a setting in the background (such as in the document editing interface), it will be rendered; otherwise, it will not output, avoiding unnecessary empty tags.
English practice cases with **practice
To make the TDK configuration more efficient and unified, we strongly recommend that you create a common header file in the AnQiCMS template (for examplepartial/_header.html),and then place all TDK-related tags together, and then reference them in all pages.{% include "partial/_header.html" %}This method is used to reference in all pages.
a typicalpartial/_header.htmlAn example might be as follows:
`twig <!DOCTYPE html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% tdk with name="Title" siteName=true showParent=true %}</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}}" />