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>This
TitleIt 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>This
DescriptionIt 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:
- 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.
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.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.