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

Next, we will delve deeper into how to configure in AnQiCMS.tdkof the filtersep(Separator) andshowParent(Parameter for whether to display the parent category title).

UnderstandingtdkFilter and its importance

tdkThe filter is a very practical template tag in AnQiCMS, mainly used to output the page title (Title), keywords (Keywords), and description (Description) and other SEO meta information.Using it correctly can help the website content be better understood and displayed by search engines.Generally, we would be on the page HTML's<head>The region 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.). But sometimes, we need more personalized or informative titles, at that timesepandshowParentit comes in handy.

ConfigurationsepParameter: Custom title separator

sepThe parameter allows us to customize the separator between the various components of the page title. AnQiCMS uses a hyphen by default (-)as a separator for parts of the title. However, depending on the design style or SEO strategy, you may want to use other symbols, such as a vertical line (|)、an underscore (_Or space and so on.

Assuming your website name is "AnQiCMS", the title of an article page is "AnQiCMS Function Details", if the website name is set to be displayed at the same time, it may be displayed by default as: "AnQiCMS Function Details - AnQiCMS". If you want to change the separator to a vertical bar, you can configure it like this:

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

Thus, the page title will be changed to: "AnQiCMS Feature Explanation | AnQiCMS". Simply modifysepThe value, you can easily adjust the visual effect of the title to make it more consistent with your brand image or reading habits.

Remember,sepParameters are onlytdkThe filter is used to output the page title (i.e.name="Title"It is valid only when

ConfigurationshowParentParameter: Display parent category title

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

By default,showParentThe value of the parameter isfalseIt means that the page title only displays the title of the current content and does not automatically include the parent category information.

For example, you have a product “Latest Smartphone”, which belongs to the “Phone” category, and the “Phone” category belongs to the “Electronics” major category. If you want to display the complete hierarchical 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 product page title may be displayed as: "Latest Smartphone - Phone - Electronic Products - AnQi Mall".

This title structure allows users to clearly understand the position of the current content on the website, and it also provides richer contextual information for search engines, which helps to improve the ranking of relevant keywords. Similarly,showParentParameters also only apply toname="Title"the situation.

Integrate and practice with **practical applications

In practical applications,sepandshowParentParameters are often combined to create a title that is both aesthetically pleasing and SEO-friendly.

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_Top Category Title_Website Name'.

When configuring these parameters, 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, accurately conveying the content of the page.
  • Brand consistency: Choose a consistent delimiter style and apply it to the entire website to maintain the professionalism and consistency of the titles.
  • Testing and adjustment:After configuration is complete, be sure to test on different types of pages (such as article detail pages, category list pages, single pages, etc.), check if the title display meets expectations, and adjust according to search engine performance and user feedback.

By flexibly using AnQiCMS'stdkin the filtersepandshowParentParameter, you can better control the page title of the website, laying a solid foundation for your content operation and SEO optimization.


Frequently Asked Questions (FAQ)

Q1: Why did I set up on my page.showParent=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 documents (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 an assigned category, this parameter will have no effect.Moreover, ensure that you arename="Title"oftdkThe tag is set.showParent.

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

Q3:sepandshowParentWill the parameter affect the page URL or content itself?A3: No.sepandshowParentThe parameter only affects the page HTML.<title>The display format of the label. It does not change the actual URL address of the page, nor does it modify the main content of the page.These parameters are purely used for SEO and user interface display of metadata configuration.