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

Calendar 👁️ 54

As an operator who deeply understands the operation of AnQiCMS, I know that content is the core position in website construction, and the high quality of content not only manifests in its depth and breadth, but also 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 single-page content in AnQiCMS.

UnderstandingpageDetailThe role of tags in single-page content management.

In AnQiCMS,pageDetailThe tag is specifically used to retrieve detailed information of a single page from the database.It allows template developers and operators to flexibly extract various properties of a single page based on the page ID or URL alias, thereby displaying or further processing it on the frontend.pageDetailTags are tools to obtain the core content.

pageDetailThe basic usage of tags is for{% pageDetail 变量名称 with name="字段名称" id="1" %}. Among them,变量名称is an optional parameter, if specified, can assign the obtained field value to a variable for easy multiple references in the template; if not specified, the field value will be output directly.

This tag supports the following main parameters to specify which single page to retrieve:

  • id: Retrieve the details of the single page by specifying its ID. This is the most direct way to specify.
  • token: Access the details through a single-page URL alias (also known as a custom URL). This is very useful when the URL structure is clear.
  • siteIdIn a multi-site management environment, if you need to obtain single-page data from a non-current site, you can specify the site ID through this parameter. Usually, this parameter does not need to be filled in.

Get the title and description of a single page content

When we talk about the title and description of a single page, the first thing that comes to mind is the "content title" and "content description" as part of its core content components. AnQiCMS allows you topageDetailLabel directly retrieve these fields:

Get the title of a single page (Title)

Each single page has a main title, which is a brief summary of its content. You can get it by usingnamethe parameter to"Title"to get it.

{# 默认用法,自动获取当前页面单页的标题 #}
<div>单页标题:{% pageDetail with name="Title" %}</div>

{# 获取指定ID单页的标题 #}
<div>指定ID单页标题:{% pageDetail with name="Title" id="10" %}</div>

{# 将标题值赋给变量后使用 #}
{% pageDetail pageMainTitle with name="Title" %}
<div>当前页面主标题:{{ pageMainTitle }}</div>

Get the description of a single page (Description)

The content description of a single page is a summary of the page theme or content, usually used to introduce content in the main part of the page. UsepageDetailtags and setnameparameters for"Description"to get it.

{# 默认用法,自动获取当前页面单页的描述 #}
<div>单页描述:{% pageDetail with name="Description" %}</div>

{# 获取指定ID单页的描述 #}
<div>指定ID单页描述:{% pageDetail with name="Description" id="10" %}</div>

{# 将描述值赋给变量后使用 #}
{% pageDetail pageSummary with name="Description" %}
<div>当前页面摘要:{{ pageSummary }}</div>

Please note, the information obtained hereTitleandDescriptionMainly refers to the 'Page Name' and 'Page Summary' filled in when editing the single page in the background. They constitute the basic content information of the page.

Get the SEO title, keywords, and description of a single page

For content operators, it is not enough to simply obtain the content title and description of the page, we are more concerned with those SEO metadata that directly affect the search engine ranking, namely the page's<title>Tag content,<meta name="keywords">and<meta name="description">.

In AnQiCMS, although the background provides independent 'SEO title' and 'keywords' configuration options for single pages, butpageDetailThe design of the label itself focuses on obtaining the page.Content field. To provide a unified and dynamic SEO metadata retrieval mechanism, AnQiCMS introduces a more general tag: tdkLabel.This 'Universal TDK tag' can automatically extract and provide the most accurate SEO metadata based on the context of the current page (whether it is a single page, article detail page, or category list page).

Therefore, to obtain the SEO title, keywords, and description of a single page, we should prioritize usingtdk.

To get the page SEO title (Title)

tdkTagging for obtainingTitleSpecifically used for pages<title>Label.It will prioritize using the "SEO title

{# 最基础的SEO标题,不包含网站名称 #}
<title>{% tdk with name="Title" %}</title>

{# 包含网站名称作为后缀的SEO标题,使用默认分隔符 "-" #}
<title>{% tdk with name="Title" siteName=true %}</title>

{# 包含网站名称作为后缀,并自定义分隔符 "_" #}
<title>{% tdk with name="Title" siteName=true sep="_" %}</title>

{# 将SEO标题赋给变量后使用 #}
{% tdk seoPageTitle with name="Title" siteName=true %}
<title>{{ seoPageTitle }}</title>

Retrieve the page's SEO keywords (Keywords)

tdkTags can retrieve the SEO keywords specifically set for single-page by the backend, used to fill in the page's<meta name="keywords">.

{# 获取页面的SEO关键词 #}
<meta name="keywords" content="{% tdk with name="Keywords" %}">

{# 将SEO关键词赋给变量后使用 #}
{% tdk seoPageKeywords with name="Keywords" %}
<meta name="keywords" content="{{ seoPageKeywords }}">

Retrieve the page's SEO description (Description)

tdkThe tag can also retrieve the SEO description set for the single page on the backend, used to fill in the page.<meta name="description">Tag. It will use the SEO description configured in the background first, and if not configured, it may fall back to the page's "single-page introduction."

{# 获取页面的SEO描述 #}
<meta name="description" content="{% tdk with name="Description" %}">

{# 将SEO描述赋给变量后使用 #}
{% tdk seoPageDescription with name="Description" %}
<meta name="description" content="{{ seoPageDescription }}">

pageDetailwithtdkCollaboration and **Practice of Tag

As a content operation personnel, understandpageDetailandtdkThe focus of each tag is the key to efficiently optimizing website optimization.

pageDetailTags are the tools you use to obtain single-pagemain content fieldsuch as, in

Related articles

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 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

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

How does AnQiCMS's static cache mechanism affect the quick update of TDK and SEO effect?

As an experienced enterprise CMS website operator, I know that the core of a content management system (CMS) lies in how to efficiently publish, manage and optimize content to meet user needs and improve search engine performance.In an AnQiCMS system, which is characterized by high performance and SEO-friendliness, the static caching mechanism and the management of the website's TDK (Title, Description, Keywords) are key factors affecting the speed of website updates and search engine optimization effects.### AnQiCMS's static caching mechanism

2025-11-06