How to specify the `siteName` parameter when retrieving Title using the `{% tdk %}` tag?

Calendar 👁️ 49

As a senior website operator for Anqi CMS, I know that every detail of the website may affect user experience and search engine performance.During content creation and publishing, the TDK (Title, Description, Keywords) on the page is the foundation of SEO optimization.{% tdk %}The tag is used to obtain the page title,siteNamespecific usage and its importance of the parameters.

The template system of Anqi CMS provides powerful flexibility,{% tdk %}The tag is one of the core tools used to dynamically generate page TDK information.This tag can intelligently grab and output the corresponding title, keywords, and description based on the type of the current page (such as article detail page, category list page, single page, etc.)name="Title"),siteNameThe parameter plays a key role, determining whether the website name will be attached to the page title.

siteNameThe parameter is a boolean value, meaning it only acceptstrueorfalse. It controls whether the site name configured in the background "Global Settings" is appended to the current page's<title>label content after. By default, if not{% tdk %}Set explicitly in the tagsiteNameA parameter with the same effect assiteName=false, meaning that the page title will not automatically include the website name.

Let's understand through some specific examplessiteNameDifferent uses of the parameter.

When you want the page title to display only the content of the current page and not include the brand name of the website, you can omitsiteNamethe parameter, or explicitly set it tofalseFor example, if you only want the title to display as "Article Title" on the article detail page, rather than "Article Title - Your Website Name", you can use the following method:

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

In this case, assuming your article title is "AnQi CMS template tag explanation", then the page<title>tags will eventually be displayed as<title>安企CMS模板标签详解</title>This may be useful in certain specific SEO strategies, for example, when you think that a long title may dilute the keyword weight, or when a minimalist title is needed on certain special pages.

However, in most website operation scenarios, in order to maintain brand consistency, enhance users' recognition of the website, and better display the brand in search engine results pages (SERP), we usually choose to add the website name to the page title. At this time, it is necessary tositeNamethe parameter totrue.

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

If your AnQi CMS backend "Global Settings" is configured with "AnQi CMS Official Website" and the title of the current page is "AnQi CMS Template Tag Details", then the page's<title>Labels will be intelligently combined as<title>安企CMS模板标签详解 - 安企CMS官网</title>. The connector (-) is the default separator, you can also usesepCustomize the parameters. For example, if you want to use an underscore as a separator, you can set it like this:

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

This will generate<title>安企CMS模板标签详解_安企CMS官网</title>.This practice not only helps users quickly identify your website in browser tabs or bookmarks, but also helps display your brand in search engine results, especially when users may only remember the brand name and forget the specific content title.

In summary,siteNameThe parameter is a detailed and practical control option provided by Anqie CMS when processing page titles.It allows website operators to flexibly decide whether to integrate the website's name into the title of each page based on specific SEO strategies and brand display requirements.Make good use of this parameter to effectively enhance the professionalism and search engine friendliness of the website.


Frequently Asked Questions (FAQ)

Q1: If I do not fill in the "Website Name" in the "Global Settings" backend, or the website name is empty,siteName=truewill it still work?

A1: No.siteName=trueThe parameter's purpose is to read from the background "Global Settings" and append the "Website Name". If this setting item is empty or not configured, even if you willsiteNamethe parameter totrueThe page title will not appear with any additional website name suffixes, as there is no content to attach.To ensure that this feature works properly, please make sure to configure your website name correctly in the background.

Q2:siteNameThe parameter withsepWhat is the relationship between parameters? Can they be used together?

A2:siteNameandsepParameters are interrelated and can be used together.siteNameParameters determine whether the website name is appended, whilesepThe parameter specifies the separator between the title and the website name when the website name is appended. For example,{% tdk with name="Title" siteName=true sep=" | " %}it will use|as the separator. If you do not specifysepParameters, the system will use the default delimiter (usually a hyphen “-”).

Q3: In terms of SEO, is it better to include the website name in the title or not?

A3: Generally, it is recommended to include the website name in the page title, especially for the homepage and core business pages.This helps to enhance brand recognition, build trust with users of the website, and display the brand in search results.However, this is not absolute.If your page title is already very long and the keyword density is high, or in certain special scenarios (such as internal management pages), you may wish to omit the website name to keep the title concise.The final choice should be based on your specific SEO strategy and goals.

Related articles

How to use the `{% tdk %}` tag in AnQiCMS template to call the home page TDK information?

In the AnQiCMS content management system, the management of TDK (Title, Description, Keywords) information for website SEO is a crucial link.AnQi CMS provides convenient and powerful template tags for website operators, allowing flexible calls to this information on the front-end page.Among them, the `{{ tdk }}` tag is a universal tag specifically used to handle page TDK information.

2025-11-06

How to customize the separator between the website name and the main title in the AnQiCMS homepage title?

As a senior AnQiCMS website operations manager, I fully understand the key role of the homepage title in search engine optimization (SEO) and user experience.A clear and easily recognizable title can effectively convey the core theme of the website and help users quickly understand the content of the webpage, thereby improving click-through rates and retention.AnQiCMS as a flexible content management system provides rich features to meet our refined control requirements for content display, including the customization of the separator between the website name and the main title in the homepage title.###

2025-11-06

Does AnQiCMS support automatically adding the website name after the homepage title? How to enable or disable it?

As a senior security CMS website operation personnel, I fully understand the importance of reasonably integrating the website name into the title for SEO optimization and brand recognition.AnQiCMS is a system focused on efficient content management and naturally provides a flexible way to handle this common requirement. --- ### Does AnQiCMS support automatically adding the website name after the homepage title?How to turn on or off?

2025-11-06

If the homepage TDK is set to empty, how will AnQiCMS handle the page's Title, Keywords, and Description tags?

As an experienced enterprise CMS website operation personnel, I know the importance of TDK (Title, Description, Keywords) settings for website SEO optimization.It is not only the key entry point for search engines to understand web content, but also the first impression that users see in search results.Therefore, how AnQiCMS will handle the situation when the TDK setting on the homepage is empty is a very worthy topic for in-depth discussion.### The importance of the homepage TDK and the configuration entry of AnQiCMS First

2025-11-06

How to adjust the `sep` parameter of the `{% tdk %}` tag to change the connection symbol between TDK elements?

As a website operator who is deeply familiar with AnQiCMS, we know that every detail of the website can affect its performance in search engines and the user experience.Among them, TDK (Title, Description, Keywords) is the most critical metadata of the web page, and its setting is particularly important.In AnQiCMS, the `{% tdk %}` tag provides a convenient way to manage these important SEO elements.This article will focus on a practical parameter of this tag - `sep`

2025-11-06

How to get the Keywords or Description of the homepage separately by using the `{{ tdk }}` tag?

As a senior personnel deeply involved in the operation of AnQiCMS (AnQiCMS) website, I am well aware of the importance of TDK (Title, Description, Keywords) for website search engine optimization (SEO), especially for the 'face' of the website - the homepage. The precise setting and effective invocation of TDK is of paramount importance. AnQiCMS provides a powerful and flexible template tag system, among which the `{% tdk %}` tag is a powerful tool for managing page meta-information.

2025-11-06

What are the advantages of AnQiCMS' "Universal TDK Tag" in the home page TDK settings?

As an experienced website operator proficient in AnQiCMS and skilled in content creation, editing, publishing, and optimization, I am well aware of the crucial role that every detail plays in website SEO, especially for the 'face' of the website - the homepage. The setting of the TDK (Title, Description, Keywords) tags is of utmost importance. The 'universal TDK tag' feature provided by AnQiCMS in this field demonstrates excellent advantages in homepage settings, bringing great convenience and efficiency improvement to website operations

2025-11-06

How to set and manage TDK for other pages in AnQiCMS except for the homepage?

As an experienced CMS website operation person, I know that the setting and management of TDK (Title, Description, Keywords) on other pages of the website, except for the homepage, is crucial for improving search engine rankings and user experience.The Anqi CMS provides flexible and powerful tools to ensure that every page of the website has precise optimized TDK information.

2025-11-06