If you are using AnQiCMS to build or manage your website, you may encounter a common and important issue: how to finely control the home page of the website<title>In the tag, whether to display the website name as a suffix. This not only relates to the display effect of the website in search engine results, but also directly affects the user's recognition of the brand.AnQi CMS as a content management system that emphasizes SEO optimization and flexibility, provides simple and powerful control capabilities in this aspect.

First, let's clarify what is meant by the 'website name suffix' mentioned here.In the AnQiCMS backend, you can find a configuration item named "Website Name" under "Global Function Settings" in the "Backend Settings".The name you enter here, such as "Anqi CMS", may appear as a suffix at the end of the title of your website page by default.For example, if the title of your homepage is set to 'Leading Enterprise-level CMS Solution', then what is actually displayed in the browser tab or search engine results may be 'Leading Enterprise-level CMS Solution - Anqi CMS'.

How do we control whether the 'AnqiCMS' suffix is displayed in the home page title?

AnqiCMS providestdkThis powerful template tag is used specifically to manage the page title (Title), keywords (Keywords), and description (Description) information. For the home page title, we mainly configuretdklabel'ssiteNameProperties to achieve this control.

Generally, the homepage template of your website (such asindex.htmlorbash.htmlin the file<head>Part) will contain similar code to generate page titles:

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

When you use it like this, if not specified explicitlysiteNameProperty,tdkThe label defaults when outputting the homepage titlewon'tAutomatically add the website name you configured in the "Global Feature Settings" as a suffix.That is to say, it will output the title of the homepage as you fill it in in the "Homepage TDK Settings" backend.For example, if you fill in "Anqi CMS official website" in the "Home TDK settings", then<title>The content of the label is 'Anqi CMS official website.'

If you want the title on the homepage to beDisplayWebsite name suffix, for example, to make “AnQi CMS Official Website” become “AnQi CMS Official Website - AnQi CMS”, you just need to intdkput in the tag.siteNameset the attribute totrueand it is done:

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

Such, the label will intelligently append the website name you configured in the "Global Feature Settings" as a suffix to the title of your homepage.

Conversely, if you explicitly do not want to display the website name suffix, even if you are worried that it may be mistakenly added in some cases, you can explicitlysiteNameset the attribute tofalse:

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

Although when not setsiteNamethe default is when the attribute is setfalsethe effect, but this explicit setting can make the intent of your template code clearer.

In addition, if you feel that the default delimiter (usually)-)Does not match your brand style, Anqi CMS also allows you to customize the delimiter. You cantdkthe tag withsepuse the attribute to specify, for example, if you want to use|as a separator:

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

This will display the home page title as "AnQi CMS Official Website | AnQi CMS".

In general, AnQiCMS offers great flexibility, allowing you to easily control the composition of the homepage title according to your website's SEO strategy and brand display needs. By adjusting the template intdklabel'ssiteNameandsepAttribute, you can fully master the display method of the home page title.


Frequently Asked Questions (FAQ)

Q1: I have already filled in the homepage title in the "Homepage TDK settings" in the background, why is the website name still following when it is displayed on the front-end page?

A1: This is likely because your template file is calling the home page title,tdkthe tag is setsiteName=true. Please check yourindex.htmlorbash.htmletc. Find the home page template file,<title>in the label{% tdk with name="Title" ... %}confirm the part,siteNamewhether the attribute is set totrueIf you do not want to display the website name suffix, you can delete itsiteName=trueOr change it tositeName=false.

Q2: Does this control only apply to the homepage? How do you control the title suffix on article pages or category pages?

A2:siteNameThe attribute is intdkThe tag is universally effective. For article pages or category pages, if you have separately set the 'SEO title' on the edit page of an article or category, then this title will be displayed first.But if you still want to add the website name suffix at the end of these page titles, you can do so in the corresponding template (such asarchive/detail.htmlorcategory/list.html)的<title>Tags, the same usage{% tdk with name="Title" siteName=true %}to achieve.

Q3: I modified the template file, but the front page did not take effect immediately. What's the matter?

A3: The AnQiCMS default will use caching to improve website access speed.After you modify the template file, you may need to manually clear the cache to see the latest changes.You can log in to the backend management system, find the "Update Cache" feature (usually at the bottom of the left menu or in System Settings), and click to update the cache.In addition, browsers may also cache pages, it is recommended to try refreshing the page forcibly (Ctrl+F5 or Cmd+Shift+R), or clear the browser cache and view it again.