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

Calendar 👁️ 56

As an experienced CMS website operation personnel, I am well aware of the core position of the category page in the website structure and SEO strategy.An meticulously optimized categorization page, which 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.

In Anqi CMS, obtain the SEO title, keywords, and description of the specified category page, although it can depend partially oncategoryDetailLabel to get basic information, but a more comprehensive and recommended approach is to combine usageUniversal TDK tagstdk. BecausetdkThe tag is designed by the system specifically for outputting the page header SEO metadata, it will intelligently assemble or call the SEO information configured in the background according to the current page type (including category pages).

Configure the category page SEO information

Firstly, we need to understand how to configure SEO information for category pages in the Anqi CMS backend. Under the 'Document Category' feature in the content management module, when we edit or create a category, we will find that the 'Other Parameters' section provides special SEO settings:

  • SEO title: This is the independent title set for the category page, which will be displayed in the browser tab and search engine results.If not set here, the system will usually use the category name as the default title.
  • Keywords: Specify relevant keywords for the category page, separated by English commas,These keywords help search engines understand the theme of the category page.
  • Category introductionHere you fill in the category introduction, which not only will be displayed in the page content, but more importantly, it will be used as the Meta Description of the category page, that is, the content of the page description tag.

This SEO information is meticulously configured in the background and is the basis for obtaining and displaying SEO metadata in our front-end templates.

UtilizetdkTags obtain SEO metadata

In AnQi CMS template design, in order toheadRegion correctly outputs SEO titles (Title), keywords (Keywords), and descriptions (Description) etc. The most recommended and powerful tag istdk.tdkThe tag can intelligently identify the current page as a category page, document page, or other special page, and automatically obtain and render the most appropriate SEO information according to the backend configuration.

Get SEO Title (Title)

UsetdkThe tag for getting the SEO title of the category page is very intuitive. It automatically prioritizes the "SEO title" field set for this category in the background.If the 'SEO title' is empty, the category's 'category name' will be used, and the website name can optionally be appended.

<title>{% tdk with name="Title" siteName=true sep=" - " %}</title>

In this code block:

  • name="Title"Specify that we are getting the page title.
  • siteName=trueThis indicates appending the website name after the category title, which is very useful for brand display and long-tail keyword optimization.
  • sep=" - "This defines the separator between the category title and the website name, the default is-.

Get SEO keywords (Keywords)

Similarly,tdkThe tag is also responsible for retrieving the SEO keywords of the category page. It directly calls the "Keywords" field configured for the category on the backend.

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

Herename="Keywords"Indicate the tag that returns the keyword string of the current page and is used directly<meta name="keywords">label'scontentProperty.

Get SEO description (Description)

The description information of the category page also passes throughtdkThe tag retrieves it, it will call the background for the category description filled in for this category as the page Meta Description.

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

name="Description"Make sure we get the description content for the category page, for<meta name="description">.

categoryDetailThe role and limitations of tags

AlthoughcategoryDetailThe tag does not directly provide an integrated SEO metadata output, but it plays an important role in obtaining the category's own properties, including the category name and category description, which are SEO metadata.Original Component.

  • Get Category Name (Title):categoryDetailCan get the display name of the category.

    <div>当前分类名称:{% categoryDetail with name="Title" %}</div>
    

    ThisTitleIt is the name of the category displayed on the website front end, which may betdkThe tag is used as the default SEO title.

  • Get category description (Description):categoryDetailCan get the brief introduction of the category.

    <div>当前分类简介:{% categoryDetail with name="Description" %}</div>
    

    ThisDescriptionIt is the text introduction of the category, it will betdkThe tag is directly used for the page's Meta Description.

categoryDetailThe main purpose of the tag is to get the category ID, link, parent information, images, etc.Category detailed dataIn order to display related information in the page content area or to build navigation.For example, you may need to display the full description text of the category on the page or show a category thumbnail in the list.

{# 示例:在页面中显示分类的名称和完整描述 #}
<h1>{% categoryDetail with name="Title" %}</h1>
<p>{% categoryDetail with name="Description" %}</p>

Practical suggestions

Manage the category page SEO in Anqi CMS, my suggestion is:

  1. Background configuration takes priorityAlways fill in the "SEO Title", "Keywords", and "Category Description" in detail on the category editing page of the AnQi CMS backend. This is the foundation and core of SEO optimization.
  2. tdkTags are used for<head>In the template file,<head>the part is unified usingtdktag to output<title>/<meta name="keywords">and<meta name="description">. This is the practice to ensure that the page SEO metadata is complete, accurate, and follows the internal logic of the CMS.
  3. categoryDetailfor the content areaOn the page,<body>Part, when you need to display the name, description, image, and other specific content of the category, usecategoryDetailLabel to retrieve this data. For example, you may need to display the category overview as part of the page content, or as the introduction of some module.

By this division of labor, you can ensure that the SEO metadata of the category page remains consistent and accurate throughout the website, and can also flexibly call and display detailed information about the category in the page content.

Frequently Asked Questions (FAQ)

1. Why did I set the "SEO Title" for the category, but the front<title>tag still shows the category name?

This is usually because your templatetdkused tags, but they were not configured correctlysiteNameorsepparameters, or intdkThe tag processing logic has a lower priority than other settings. Please check your template code to ensuretdkThe label can correctly retrieve and output the 'SEO Title' you set in the background. If the 'SEO Title' field in the background is empty,tdkThe label will intelligently fallback to using the 'category name' as the title.

2.categoryDetailCan the label directly obtain the 'SEO title' and 'keywords' fields set in my backend?

According to the AnqiCMS tag document,categoryDetaillabel'snameNo parameter is directly exposed with the nameSeoTitleorKeywordsfield.categoryDetail主要用于获取分类的基础属性,如TitleCategory name andDescription(Category overview), these are part of the SEO metadata but not the final SEO output. To get the final SEO title, keywords, and description, use the specialtdkThe tag aggregates all the SEO-related information configured on the backend and performs priority processing.

3. If I want to display the 'custom URL' of the category on the category page instead of its ID, which tag should I use?

You can usecategoryDetailLabel to get the custom URL alias for categories. When configuring categories in the background, you can set the 'Custom URL' field.In the template, this custom URL is usually displayed incategoryDetailofLinkin the field.

<div>当前分类自定义链接:<a href="{% categoryDetail with name="Link" %}">{% categoryDetail with name="Title" %}</a></div>

Please note that the effect of using a custom URL also depends on the website's URL rewrite rule configuration.

Related articles

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

As an experienced AnQiCMS website operator, I fully understand the importance of every content detail for website SEO, especially for aggregation content entry pages like tabs, whose SEO configuration directly affects the search engine's crawling and ranking performance.In AnQiCMS, the `tagDetail` tag is a key tool for obtaining detailed page information, which helps us accurately extract the required data to optimize the metadata of the page.

2025-11-06

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

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

How to set TDK editing permissions when there are multiple administrators on a website to ensure content consistency?

As a website operator familiar with AnQiCMS, I know that TDK (Title, Description, Keywords) is crucial for the performance of a website in search engines.How to effectively manage the editing permissions of TDK when a website is maintained by multiple administrators, ensuring the unity and professionalism of the content is a crucial aspect of operation.AnQi CMS with its flexible permission control mechanism provides the foundation for achieving this goal.###

2025-11-06