During the process of website operation and SEO optimization, the page title (Title) is a key element that attracts user clicks and improves search engine rankings. AnQiCMS provides flexibletdkFilter, allowing us to finely control the display of page TDK (Title, Description, Keywords). Where,sepandshowParentThese two parameters play an important role in constructing page titles with a sense of hierarchy and clarity.

Next, we will delve deeper into how to configure in AnQiCMStdkFilterssep(delimiter) andshowParent(Whether to display the parent category title) parameter.

UnderstandingtdkFilter and its importance.

tdk过滤器是AnQiCMS中一个非常实用的模板标签,主要用于输出页面的标题(Title)、关键词(Keywords)和描述(Description)等SEO元信息。Using it correctly can help website content be better understood and displayed by search engines.<head>Area uses it to dynamically generate these tags.

For example, a basic title output might look like this:

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

This will automatically output the title based on the type of the current page (such as articles, categories, single pages, etc.). However, sometimes we need more personalized or informative titles, at which timesepandshowParentit comes into play.

Configurationsep参数:个性化标题分隔符

sep参数允许我们自定义页面标题中各个组成部分之间的分隔符。AnQiCMS默认使用短横线(English)-)as separator for different parts of the title. However, depending on the design style or SEO strategy, you may want to use other symbols, such as vertical bars (|)、and the underscore (_) or spaces.

Assuming your website name is "AnQi CMS

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

Here, the page title will become: 'AnQiCMS Function Details | AnQi CMS'. Simply modifysepThe value, you can easily adjust the visual effects of the title to make it more in line with your brand image or reading habits of users.

Remember,sepThe parameter is only intdkThe filter is used to output the page title (i.e.,name="Title"Valid when specified.

ConfigurationshowParentParameter: Display parent category title.

showParentThe parameter is a feature that is very suitable for websites that need to emphasize the structure of content levels, such as product detail pages on e-commerce websites, or article pages on knowledge base websites. When this parameter is set totrueWhen, AnQiCMS will display not only the title of the current content in the page title, but also the title of the parent category (even the grandparent category at a higher level) it belongs to.

By default,showParentThe value of the parameter isfalse,意味着页面标题只显示当前内容的标题,不会自动包含父级分类信息。

For example, you have a product called 'Latest Smartphone', which belongs to the 'Phone' category, and the 'Phone' category is part of the 'Electronics' major category. If you want to display the full hierarchy title on the product page, you can configure it like this:

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

If your website name is “AnQi Mall”, then the page title of this product may display as: “Latest Smartphones - Phone - Electronic Products - AnQi Mall”.

This title structure allows users to clearly understand the current content's position within the website, and also provides more context information for search engines, which is helpful for improving the ranking of relevant keywords. Similarly,showParentThe parameter also only applies toname="Title"the situation.

An integrated application with **practice

In actual application,sepandshowParentParameters are often used together to create beautiful and SEO-friendly page titles.

A typical example is:

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

This may generate a title format like 'Article Title_Category Title_Main Category Title_Website Name'.

When configuring these parameters, it is recommended that you consider the following points:

  • SEO friendliness:Keep the title concise and clear, placing the most important keywords at the front of the title.showParentAlthough it increases the amount of information, it may also lead to a long title, which needs to be weighed.
  • User Experience:The title should be easy to read and understand, and accurately convey the content of the page.
  • Brand consistency:Choose a consistent delimiter style and apply it to the entire website, maintaining the professionalism and consistency of the titles.
  • Test and adjust:Configure it first, and then test on different types of pages (such as article detail pages, category list pages, single pages, etc.) to ensure that the title display meets expectations, and adjust according to search engine performance and user feedback.

Through the flexible use of AnQiCMS,tdkIn the filter.sepandshowParentParameters, you can better control the page title of the website, laying a solid foundation for your content operation and SEO optimization.


Common Questions (FAQ)

Q1: Why did I set up on my pageshowParent=trueBut the parent category is not displayed in the title?A1: Check if the current page belongs to a clear category.showParentThe parameter is only valid in the document (such as articles, products) or subcategory pages, and this content must be correctly categorized under at least one parent category.If the page is a single page or content without assigned categories, this parameter will have no effect.name="Title"oftdkset in the tagshowParent.

Q2: ChangeseporshowParentAfter the parameter, what do I need to do to make the website front-end display update?A2:In AnQiCMS, changes to template tags usually take effect immediately.But to ensure the page is fully refreshed and to clear any cache that the browser may have, you can try to clear the system cache of AnQiCMS backend (usually found in the "Update Cache" feature), then force refresh your browser (such as Ctrl+F5).If the website uses a CDN, it may also be necessary to refresh the CDN cache.

Q3:sepandshowParentDoes the parameter affect the URL or content of the page itself?A3:No.sepandshowParentThe parameter only affects the HTML of the page.<title>Label content display format.They do not change the actual URL address of the page, nor do they modify the main content of the page.These parameters are purely for SEO and user interface display of metadata configuration.