What is the role of the `showParent` property in `{% tdk with name="Title" %}`, and how to use it?

Calendar 👁️ 59

As an experienced CMS website operation person, I am well aware of the importance of content strategy and SEO optimization for attracting and retaining users.In Anqi CMS, flexibly using template tags is the key to achieving fine-grained content display and SEO optimization.Today, let's delve into it{% tdk with name="Title" %}A very practical attribute in the tag:showParent.

Security CMS{% tdk with name="Title" %}in the labelshowParentDetailed explanation and application of the attribute

In the template design of AnQi CMS,tdkThe tag is a key tool for outputting page titles (Title), keywords (Keywords), and descriptions (Description), which directly affect the website's performance in search engines and the first impression of users. Among them, when we need to control the display method of the page title, name="Title"Parameters are particularly important, andshowParentthe properties provide us with more detailed title level control.

showParentthe mechanism of the properties

showParentIs{% tdk with name="Title" %}A boolean type attribute of the label, which mainly determines whether the title of the current page includes the title of its parent category. By default,showParentThe value isfalseThis means that the page title will only display the title content of the current page and will not automatically attach the title information of the parent category.

This attribute is specifically designed for content with a hierarchical structure (such as an article detail page or a category list page). When set totrueWhen, the system will automatically detect the category level of the current page and intelligently add the title of the parent category to the title of the current page, thereby forming a title with more hierarchy and contextual relevance.

WhyshowParentIs the attribute crucial for website operation and SEO?

showParentThe attribute is not just a simple title concatenation, it has multiple values at the level of website operation and SEO:

first, Enhance user experience and content understandability. For users, a title containing parent category information can help them quickly understand the position and context of the current page in the overall website structure.For example, if a product page title is "Ultra-thin laptop", when enabledshowParentAfter, the title may change to "Ultra-thin Laptop - Laptop - Electronic Products".This makes it clear for the user to know that this laptop belongs to the 'Laptop' category, and 'Laptop' belongs to the 'Electronics' category, which greatly enhances the navigation sense and content relevance.

secondly,Optimize search engine rankings and click-through rate (CTR). From the perspective of SEO, the title is one of the most important elements on a page, as it not only conveys the page topic to search engines but also directly affects the click intention of users in search results.

  • Keyword coverage:The title of the parent category usually contains broader or more core keywords. ByshowParent=trueThe page title can cover both the long-tail keywords of the current page and the general keywords of the parent category, thereby increasing the page's exposure opportunities under various search queries.
  • Contextual relevance:Search engines also consider the contextual relevance of the title when evaluating page content.A title that includes hierarchical information, which can better display the depth and breadth of the page's theme to search engines and help improve the relevance score of the page.
  • Search results show:In some cases, a title that is more structured and clear may appear more professional and attractive in search results, thereby indirectly increasing the probability that users will click to enter the website.

Finally,Provide refined content strategy control. Website operators can flexibly decide whether to enable based on the characteristics of different content areasshowParentFor example, for core, independent thematic pages, it may tend to disableshowParentTo maintain the brevity and independence of the title; for product categories or article subcategories, it may be more willing to enable it to emphasize the hierarchy and keyword coverage.

showParentThe way to use properties

In the Anqi CMS template,showParentThe use of the property is very intuitive, it must be used withname="Title"together.

1. EnableshowParentattribute:

If you want the page title to include the parent category title, you canshowParentis set totrue.

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

For example, if the structure of your website is "Electronic Products" > "Laptop" > "Ultra-thin Laptop", and the current page is the detail page of "Ultra-thin Laptop". WhenshowParent=trueAs, the actual output title may be similar:超薄笔记本电脑 - 笔记本电脑 - 电子产品or超薄笔记本电脑 - 笔记本电脑(depending on the level depth and delimiter settings).

2. DisableshowParentAttribute (default behavior):

If you do not want the page title to include the parent category title, you can leave it unsetshowParentproperty (because its default value isfalse), or explicitly set it tofalse.

<title>{% tdk with name="Title" %}</title>
{# 或者明确指定 #}
<title>{% tdk with name="Title" showParent=false %}</title>

In this case, the title will only display the name of the current page, for example:超薄笔记本电脑.

3. Use in combination with other title attributes:

showParentThe properties can be withtdkOther related title attributes in the tag (such assiteNameUsed to display the website name,sepUsed to customize the separator) in combination to build a more complete page title structure.

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

If the website name is "AnQi Mall", the tags mentioned above may generate a title like this:超薄笔记本电脑 | 笔记本电脑 | 安企商城.

Summary

showParentThe attribute is a powerful and detailed control option provided by Anqi CMS when handling page titles.By appropriately applying it, website operators can not only provide users with clearer navigation information, but also effectively optimize the SEO performance of page titles, thereby enhancing the visibility and attractiveness of the website content in complex network environments.Understanding and mastering this attribute is an important step to mastering the optimization of Anqi CMS templates.


Frequently Asked Questions (FAQ)

Q1:showParentIs the attribute applicable to all types of pages, such as single-page or tag pages?

A1: showParentProperties are mainly used for content types with explicit parent-child relationships, such as article detail pages or category list pages, in order to display the title of the parent category.It is usually not applicable to Single Page or Tag pages, as these pages usually do not have the traditional 'parent category' structure to provide title concatenation.

Q2: StartshowParentAfter that, what should you do if the page title becomes too long and is truncated in search engines?

A2:Page titles that are too long may be truncated in search results. If you encounter this situation, it is recommended that you optimize from several aspects:

  1. Simplify the subcategory title:Keep the title of the current page concise and accurate.
  2. Strategic use:Not all category levels need to be enabled.showParentYou can only enable it in those deep categories where the parent titles significantly help with user understanding and SEO.
  3. Adjust the separator:Try using a more concise separator (such as-or|Reduce character usage.
  4. Monitor and adjust:Keep a continuous focus on enabling.showParentAdjust the search engine performance of the subsequent page, based on actual inclusion and click data.

Q3: I can directly configure in the AnQi CMS backendshowParent?

A3: showParentA property is a template tag parameter, which means it needs to be set and modified in the template file. The AnQi CMS backend interface usually provides the basic TDK settings, but likeshowParentThis more refined template tag attribute, then you need to directly edit the website template file (for exampleheader.htmlor a specific category, detail page template), in{% tdk ... %}the tag and manually add or modify.

Related articles

How can I implement AnQiCMS template tags to dynamically display some data in the home page TDK?

As a website operator deeply rooted in AnQiCMS (AnQiCMS), I am well aware of the importance of content in the digital age, as well as how to attract and retain users through carefully crafted and optimized content. In SEO work, TDK (Title, Description, Keywords) is one of the most fundamental and important optimization steps for a website, and how to make it dynamic to adapt to changing content and market demands is the key to improving website performance.

2025-11-06

How to ensure the safe output of TDK tag content in AnQiCMS template and prevent XSS attacks?

As a website operator who deeply understands the operation of AnQiCMS and has a profound understanding of content and user needs, I know the importance of website security in maintaining user trust and search engine rankings.TDK (Title, Description, Keywords) tags act as the 'face' of a website page, and the security of their content output is of utmost importance, especially to be cautious of cross-site scripting attacks (XSS).

2025-11-06

Does AnQiCMS provide a word limit prompt for TDK settings to comply with search engine practices??

As a user of AnQi CMS who has been deeply engaged in content operation for many years, I am well aware of the importance of TDK (Title, Description, Keywords) settings for the performance of a website in search engines.High-quality TDK can not only improve the click-through rate of the website, but is also a key element for search engines to understand the content of the page.Our CMS provides flexible and powerful support in this aspect, allowing operation personnel to easily practice the strategies of Search Engine Optimization (SEO).###

2025-11-06

How to use the "Link Push" feature of AnQiCMS to inform search engines of new TDK pages in a timely manner?

As an experienced CMS website operator for an enterprise, I am well aware of the importance of content being discovered by search engines in a timely manner, especially for new pages that have been carefully optimized for TDK (Title, Description, Keywords).The "Link Push" feature of AnQiCMS is exactly for this purpose, it can help us actively inform search engines, accelerate page inclusion, and thus gain more traffic and exposure faster.The following will elaborate on how to utilize this core feature of AnQiCMS to ensure that your new TDK page is timely indexed by search engines

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

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