In website operation, the page title (Title), keywords (Keywords), and description (Description), which we commonly refer to as TDK, are the foundation of search engine optimization.They not only help search engines understand page content, but are also key factors in attracting user clicks.AnQiCMS (AnQiCMS) fully understands the importance of TDK, through its powerful template tag system, especially the versatiletdkTags make it easy and efficient to dynamically generate and flexibly control page TDK.
How to dynamically generate TDK: The intelligent mechanism of Anqi CMS.
Of Security CMStdkThe tag design is very intelligent, it can automatically identify and capture the most relevant TDK information based on the type of the current page (such as the homepage, article detail page, category list page, single page, or tag page). This mechanism has a clear priority:
- Content level TDK priority:When you set SEO titles, keywords, and descriptions for specific articles, products, categories, single pages, or tags in the background,
tdkLabels will prioritize this information. For example, the "SEO Title", "Keywords", and "Description" entered in the "Publish Document" or "Edit Category" interface. - Home page TDK fallback:If the current page does not have a specific TDK setting,
tdkthe tag will revert to the content defined in the "Home TDK Setting" in the "Background Setting".
This means, you only need to fill in the content as needed when publishing,tdkTags can automatically display the most appropriate TDK on the front end, greatly reducing redundant work and ensuring fine-grained SEO management.
tdkThe application of tags in templates.
Apply TDK in your AnQi CMS website template, usually you need toheadusing tags insidetdktag to call the corresponding data.
1. Dynamically generate page titles (name="Title")
The page title is the most important element in TDK.tdkThe tag provides rich flexibility when obtaining the page title.
Basic usage:
The simplest way to call in the template is:
<title>{% tdk with name="Title" %}</title>
This simple code can make AnQiCMS automatically output the most suitable page title based on the context of the current page.For example, on the article detail page, it will display the SEO title of the article;On the category page, it displays the category name; on the homepage, it displays the homepage title.
Flexibly control whether to include the website name (siteNameparameter):
AnQiCMS'tdkThe tag provides a very practicalsiteNameParameter, allowing us to flexibly control whether the page title includes the website name. By default,siteNameIsfalseIt means that the website name will not be automatically appended to the title.
If you want the website name to be displayed after the page titlesimply set the parameter to
siteName=trueand it is done:<title>{% tdk with name="Title" siteName=true %}</title>For example, if the article title is “AnQi CMS template making tutorial”, and the website name is “AnQi CMS”, then the output title may be “AnQi CMS template making tutorial - AnQi CMS”.
If you do not want the website name to appear in the page titleor you want to manually control the display position and format of the website name, you can keep
siteName=false(or not write this parameter, as the default is already}false),then concatenate as needed.<title>{% tdk with name="Title" siteName=false %} - 我的自定义网站名</title>On a specific page, you can fully customize the way the website name is displayed to ensure consistency with your brand strategy.
Custom separator (sepparameter):
By default,tdkTags are used when combining the title and the website name-As a separator. If you have different needs, for example, you want to use_or|can be accessed throughsepSet the parameter:
<title>{% tdk with name="Title" siteName=true sep="_" %}</title>
In this way, your title will become 'Page Title_Website Name'.
Display the parent category title (showParentparameter):
For some category pages, we may want to reflect the parent category in the title.showParentThe parameter can bename="Title"effective attruewhen set to, the title will include the name of the parent category:
<title>{% tdk with name="Title" showParent=true %}</title>
2. Dynamically generate page keywords (name="Keywords")
Page keywords (Keywords) although their weight has decreased in modern SEO, they are still an important part of the page information.tdkThe label can automatically obtain keywords set in the background.
<meta name="keywords" content="{% tdk with name="Keywords" %}">
HereKeywordsContent is prioritized from the 'Keywords' field of the current page (article, category, single page, tag), if not set, it will fallback to the 'Home Page TDK' keywords.
3. Dynamically generated page description (name="Description")
Page description (Description) is a summary displayed to users on the search engine results page (SERP), directly affecting click-through rate.
<meta name="description" content="{% tdk with name="Description" %}">
DescriptionThe content will be prioritized from the 'Introduction' field of the current page (article, category, single page, tag), if not set, it will fallback to the 'Home Description' in the home TDK.
4. Dynamically generate page specification link(name="CanonicalUrl")
The canonical URL is crucial for avoiding duplicate content issues, as it tells search engines which is the preferred version of the page.tdkLabels can dynamically obtain this value.
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
Here we first assign theCanonicalUrlAssign the value tocanonicalA variable, and then through aifJudgment to ensure that the standard link exists before outputtinglinkTag, this is a good practice to avoid outputting empty.canonical.
**Practice of TDK application
In order to maximizetdkTags in the effect of SEO, there are several tips worth sharing:
- The uniqueness of TDK:Ensure that the TDK of each important page is unique and highly relevant. Avoid repetition, even for similar pages, and maintain subtle differences.
- Keyword layout:Naturally integrate the core keywords into the title and description, avoiding repetition.
- Attractiveness of the description:The page description should be concise and clear, able to attract users to click. It can be regarded as advertising copy.
- Length control:The title is generally recommended to be within 60 characters, and the description within 120-150 characters to ensure complete display on the search engine results page.
- Habits of TDK settings in the background:When publishing any new content (articles, products, categories, single pages, tags), it is a good habit to fill in the SEO title, keywords, and description, which can make full use of
tdkThe dynamic ability of tags, avoid using default values.
By making reasonable use of the Anqi CMS'stdkTags with rich parameters, you can not only manage the website's TDK information efficiently, but also for the website's