How to get the SEO title, keywords and description of the specified Tag page using `tagDetail` tag?

Calendar 👁️ 63

As an experienced AnQiCMS website operator, I am well aware of the importance of every content detail for website SEO, especially for content entry points such as tabs, whose SEO configuration directly affects the crawling and ranking performance of search engines. In AnQiCMS,tagDetailTags are the key tools for obtaining detailed information about tab pages, which can help us accurately extract the required data and optimize the metadata of tab pages.

Get to know in-depthtagDetailTags to optimize tab page SEO

In AnQiCMS, each tag (Tag) is not just a content category, but also a page with independent SEO value.To ensure that these tabs have good visibility in search engines, we need to configure appropriate SEO titles (Title), keywords (Keywords), and descriptions (Description).tagDetailThe tag is the tool we use to get this information in the template.

tagDetailThe primary function of the tag is to obtain detailed data of the specified tag.In the absence of explicitly specifying an ID or alias, it defaults to fetching the tag details of the current page.idOr parameter (specify tag ID) ortokenParameters (specify the URL alias of the tag) for precise control. In a multi-site environment, it can also be done throughsiteIdSpecify the site parameter.

Get the SEO title of the tag page

The tab title is the primary element that search engines use to determine the relevance of page content.The tag name (Title) is usually used as the default SEO title.

<title>{% tagDetail with name="Title" %}</title>

This code will directly output the name of the current tab as the page titletitleLabel content.However, the AnQiCMS backend provides an independent "SEO Title" field in the tag management feature, allowing operators to set more targeted and optimized titles for tag pages to distinguish them from the display names of the tags themselves.tagDetailTags:

<title>{% tagDetail with name="SeoTitle" %}</title>

If the "SEO Title" field in the background is empty, the system will usually intelligently fallback to using the "Title" tag as the page title. To ensure the integrity of the title, especially when the SEO Title field may not be set, combinetdkLabel and utilizesiteNameAttribute, can construct a more perfect title structure.

Extract the SEO keywords of the tag page

Keywords are important hints that help search engines understand the core theme of a tab.The AnQiCMS tag management feature allows us to manually input multiple keywords for each tag.These keywords are crucial for enhancing the relevance of tabs in specific search queries.tagDetailTag to get these configured keywords:

<meta name="keywords" content="{% tagDetail with name="Keywords" %}">

This code will output the keyword list set in the background of the tab page, usually these keywords are separated by commas and conform to the common recognition format of search engines.

Get the SEO description of the tab page

The page description is a concise summary of the content, which is usually displayed as a snippet in search results to attract users to click.A well-written description can significantly increase click-through rate.In the AnQiCMS tag management interface, we can set a 'tag introduction' or 'tag description' field for each tag.This field's content is usually used directly as the page's SEO description.tagDetailTag to get it:

<meta name="description" content="{% tagDetail with name="Description" %}">

This will embed the description content configured in the background of the tag into the page.meta descriptionin the tag.

Integrated application and **practice

In the design of actual templates, in order to maximize the use of the SEO information of the tab, we usually combine these tags and place them in the HTML document's<head>Within the area. Here is a common combination application example:

<head>
    {# 获取标签页SEO标题,并附加网站名称 #}
    <title>{% tdk with name="Title" siteName=true %}</title>

    {# 获取标签页关键词 #}
    <meta name="keywords" content="{% tagDetail with name="Keywords" %}">

    {# 获取标签页描述 #}
    <meta name="description" content="{% tagDetail with name="Description" %}">

    {# 获取标签页的规范链接,CanonicalUrl可由tagDetail或tdk标签提供 #}
    {%- tdk canonical with name="CanonicalUrl" %}
    {%- if canonical %}
    <link rel="canonical" href="{{canonical}}" />
    {%- endif %}
</head>

In the above example, we usedtdktags to get the total title of the page (it will intelligently combinetagDetailThe label title and website name provided, and it is used directlytagDetailThe keywords and description of the label were obtained. For the canonical link (CanonicalUrl), it is usually accessed throughtdkLabel management is unified because it can more comprehensively handle the standardization needs of various page types.

By means of the aforementioned method, website operators can fully utilize the services provided by AnQiCMStagDetailTags and their related features, ensure that each tab has comprehensive SEO meta information, so that it can perform better in search engines.

Frequently Asked Questions (FAQ)

Q1: WhytagDetailThe document does not list "SeoTitle" or "Keywords" asnameavailable parameters?

This document may have some omissions in detail. Althoughtag-/anqiapi-tag/148.htmlofnameThe parameter list is not explicitly listedSeoTitleandKeywords, but the AnQiCMS backend tag management function (such ashelp-content-tag.mdShown) indeed provides the editing entry for these fields. As experienced operation personnel, we can infer that these fields are available and usually follow witharchiveDetailOther content details label similar naming conventions (such asname="SeoTitle"andname="Keywords"). It is recommended to try these names first in actual development, and to seek official confirmation or check other field names if problems arise.

Q2: If I have not set a specific "SEO title" or "tag keywords" in the tag management of the background,tagDetailwhat will the tags return?

When you have not set a special 'SEO title' for a tag in the background,{% tagDetail with name="SeoTitle" %}It usually returns an empty value. In this case, the website template usually falls back to using the default “Title” label (i.e.,{% tagDetail with name="Title" %}the value returned as the page's<title>. For "label keywords" it is similar, if not set,{% tagDetail with name="Keywords" %}It will return an empty string.To ensure that the page's SEO meta information always exists, we usually set up default fallback logic in the template or force the completion of these SEO fields in the background.

Q3: Can I use it on non-label pages (such as article detail pages or the homepage)?tagDetailDo you want to get SEO information for a specific tag?

Yes, you can.tagDetailTags support throughidortokenThe parameter is used to specify which tag details to retrieve, regardless of whether the current page is the details page of the tag. For example, to retrieve the SEO title of a tag with ID '123' on the article details page, you can use{% tagDetail with name="SeoTitle" id="123" %}.This is very useful when building the "related tags" module or referencing specific tag information on other content pages, but please note that excessive or improper use may lead to unnecessary database queries and affect page performance.

Related articles

How to apply TDK filters provided by AnQiCMS, such as `truncatechars`, to control the length of Description?

As a website content expert who is deeply familiar with the operation of AanQi CMS, I fully understand the importance of TDK (Title, Description, Keywords) for the performance of a website in search engines and attracting user clicks.Description tag, serving as the summary below the title on the search engine results page (SERP), the length control directly affects the initial impression of users on the content and their willingness to click.Too long to be truncated, cannot fully convey the information; too short may be contentless and lack吸引力.

2025-11-06

How to verify whether the TDK set on the AnQiCMS website conforms to the **practice** of search engines?

As an experienced website content expert who deeply understands the operation of Anqin CMS, I fully understand the core status of TDK (title, description, keywords) in search engine optimization.Under the powerful support of Anqi CMS, we can manage and verify the TDK settings of the website in a fine-grained manner, ensuring that they not only comply with the **practice of search engines but also effectively attract the target audience.

2025-11-06

In AnQiCMS, can the TDK settings of the content model affect the default TDK values of its subordinate documents?

As an experienced CMS website operator for security companies, I am well aware of the close connection between content creation and Search Engine Optimization (SEO).TDK (Title, Description, Keywords) is a fundamental element of website SEO, and the hierarchy and inheritance relationship of its settings are a focus for many operators.Today, let's delve deeply into whether the TDK settings of the content model in AnQiCMS can affect the default TDK values of its subordinate documents.

2025-11-06

What is the role of the `showParent` property in `{% tdk with name="Title" %}`, and how to use it?

As an experienced security CMS website operator, I am well aware of the importance of content strategy and SEO optimization for attracting and retaining users.In AnQi CMS, flexibly using template tags is the key to achieving fine-grained content display and SEO optimization.Today, let's delve into a very useful attribute of the `{% tdk with name="Title" %}` tag: `showParent`.

2025-11-06

How to get the SEO title, keywords, and description of a specified category page using the `categoryDetail` tag?

As an experienced CMS website operator, I am well aware of the core position of the category page in website structure and SEO strategy.A well-optimized categorization page that not only helps users quickly find the content they need, but also effectively improves the crawling efficiency and ranking of search engines.In Anqi CMS, we can accurately control the SEO metadata of each category page through a flexible tag system.

2025-11-06

How to get the SEO title, keywords, and description of a specified single page using the `pageDetail` tag?

As an operator who deeply understands the operation of AnQiCMS, I know the core status of content in website construction, and the high quality of content not only reflects its depth and breadth, but also lies in whether it can be effectively discovered by target users and search engines.SEO (Search Engine Optimization) titles, keywords, and descriptions are the bridge of communication between content and search engines.It is crucial to correctly obtain and apply these SEO elements for the single-page content in AnQiCMS.

2025-11-06

Does AnQiCMS provide a real-time preview feature for TDK settings, convenient for operation personnel to check the effect?

As a senior security CMS website operator, I fully understand your concern for TDK settings and their effect checks.TDK (Title, Description, Keywords) is the foundation of search engine optimization, and their correct configuration directly affects the visibility of a website in search engines.About whether AnQiCMS provides a real-time preview function for operation personnel to check the effect of TDK settings, I will explain it to you in detail.

2025-11-06

How to use the 'Custom URL' feature of AnQiCMS to set personalized TDK links for special pages?

As an operator who is deeply familiar with AnQiCMS, I know that every detail is crucial for the search engine performance and user experience of the website.Especially the personalized settings of page URL structure and TDK (Title, Description, Keywords), which are crucial for attracting search engine crawling and meeting user needs.The AnQi CMS provides a powerful 'custom URL' feature, combined with flexible TDK settings, allowing us to easily tailor exclusive optimization solutions for special pages.--- ###

2025-11-06