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.