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.