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.