How to dynamically set and display the page's Title, Keywords, and Description using the `tdk` tag to optimize SEO?

Calendar 👁️ 91

In website operation, how to make our content better discovered by search engines and attract more potential users is a continuous challenge.Among them, the Title (Title), Keywords (Keywords), and Description (Description) these three TDK tags are like a series of 'business cards' on our website's search engine results page, which directly affect the user's click intention and the understanding of search engines.Anqi CMS knows this point and therefore fully considered the dynamic setting of TDK and SEO friendliness from the beginning of system design.

The importance of TDK: More than just a string of words

First, let's briefly review the importance of TDK.Title is a concise summary of the page content, directly displayed in the search results title bar, and is the information that users see first.Keywords help search engines understand the core theme of a page, although their weight has decreased, reasonable settings still have a辅助作用.Description provides a more detailed page summary, usually appearing as the text of search results, and is a key lure for attracting users to click.They collaborate together to build an initial understanding of the page content for search engines and users.

The dynamic TDK mechanism of Anqi CMS: Flexible and powerful

The reason why Anqi CMS emphasizes dynamic TDK is that it allows us to flexibly configure these SEO elements according to different page types and content characteristics, rather than taking a one-size-fits-all approach.This means that whether it is the homepage of the website, detailed article page, product display page, category list page, or a customized single page, we can tailor-made exclusive TDK information for them, greatly enhancing the refinement of SEO.

The implementation of this 'dynamic' mainly manifests in two aspects:

  1. The TDK configuration entry for a multi-level, multi-dimensional content management backend:AnQi CMS has reserved TDK setting fields in all content management modules of the website.
  2. The unified TDK tag calling mechanism in the template:Regardless of where the backend data source comes from, the front-end template uses a concisetdktag to dynamically retrieve and display this information.

Next, let's take a specific look at how to set TDK in the Anqi CMS backend and how to call it in the front-end template.

Set TDK in AnQi CMS backend: Customize 'business card' for each page

The AnQi CMS backend provides a very intuitive and detailed TDK setting entry, ensuring that each page can have the most suitable SEO information.

  • Website home page TDK configuration:This is the facade of our website, usually it needs to be set with the most core, most representative TDK of the brand and business.You can find the corresponding input box under the 'Background Settings' section in the 'Home TDK Settings', where you can fill in the home title, home keywords, and home description separately.These settings will be used as the default TDK for the website globally, especially for the homepage.

  • Content detail page (article, product, single page) TDK settings:For each article, product, or single-page created and published, Anqi CMS allows you to perform independent TDK optimization.When you publish or edit this content, you will see a "Other parameters" or similar collapsed area, which includes "SEO title", "keywords", and "document description" (or "single page description").

    • "SEO Title": This field will be directly used as the page's title.<title>Label content, if you do not fill in, the system will usually use the article title as the default value.
    • Keywords: Enter relevant keywords here, separated by English commas,This helps search engines better understand the page topic.
    • “Document Introduction”:This is not only a summary of the page content, but also the page itself<meta name="description">The source of the tag. Write an engaging description containing core keywords to effectively increase user click-through rate.
  • TDK settings for category list page and tag page:Categories and tag pages are also important entry points for users and search engines to understand the structure of a website.In the 'Content Management' under 'Document Category' or 'Document Tag', when you edit specific categories or tags, you will find fields such as 'SEO Title', 'Keywords', and 'Category Description' (or 'Tag Description').These settings will take effect on the corresponding category list page or tag aggregation page.

This multi-level setting logic of Anqi CMS allows the page TDK to achieve more accurate optimization according to the specific properties of the content.If a detail page does not set TDK, the system will usually trace up to use the TDK of its category, and if the category is also not set, it may use the TDK of the website homepage. This intelligent inheritance mechanism greatly simplifies daily operation work.

Dynamically call TDK in the front-end template: one line of code, universal adaptation

AnQi CMS provides an extremely convenienttdkThe tag allows you to dynamically retrieve and display the current page's TDK information without writing complex logical judgments in the website template.This tag automatically identifies the type of the current page (whether it is the homepage, article page, category page, or others), and fetches TDK data from the corresponding configuration in the background.

Generally, these tags are placed in the website template<head>area (such asbase.htmlorheader.html),to ensure that all pages can be loaded correctly.

<head>
    <meta charset="UTF-8">
    {# 动态设置页面标题 #}
    <title>{% tdk with name="Title" siteName=true sep="_" %}</title>
    {# 动态设置页面关键词 #}
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    {# 动态设置页面描述 #}
    <meta name="description" content="{% tdk with name="Description" %}">

    {# 动态设置Canonical URL,如果有的话 #}
    {%- tdk canonical with name="CanonicalUrl" %}
    {%- if canonical %}
    <link rel="canonical" href="{{canonical}}" />
    {%- endif %}

    <!-- 其他头部元素 -->
</head>

Let's interpret it in detailtdkUsage and parameters of the tag:

  • Get the page title(name="Title"): {% tdk with name="Title" %}This is the basic usage, it will retrieve the most matching SEO title on the current page.{% tdk with name="Title" siteName=true %}If you want to automatically add the website name at the end of the page title, you can setsiteName=true.{% tdk with name="Title" siteName=true sep="_" %}:sepThe parameter allows you to customize the separator between the title and the website name, for example, setting it to an underscore_.{% tdk with name="Title" showParent=true %}In the category or article detail page, if you want the title to include the name of the parent category, you can useshowParent=true.

  • Get the page keywords (name="Keywords"): {% tdk with name="Keywords" %}This tag will directly output the keyword string configured on the current page background.

  • Get page description (name="Description"): {% tdk with name="Description" %}This tag will output the description content configured on the current page background.

  • Get Canonical URL(name="CanonicalUrl"): {% tdk with name="CanonicalUrl" %}The Canonical URL (standard link) is very important in SEO as it helps solve the issue of duplicate content.The AnQi CMS also supports setting standard links for pages. In the template, we usually first check if there is a standard link before deciding whether to display it to avoid outputting empty.link.

Through this powerfultdkTags, you will find that maintaining the website TDK becomes exceptionally easy.Do not modify complex template logic, just configure at the corresponding position in the background, and the front-end can automatically display the correct SEO information.

Besides TDK, Anqi CMS's SEO toolkit

The TDK settings are just a缩影of the many SEO features of AnQi CMS. As a highly SEO-friendly system, it also includes many other tools to collectively safeguard the search engine performance of the website:

  • Manage static URLs and 301 redirects:Optimize URL structure, resolve the SEO loss caused by link changes.
  • Sitemap and Robots.txt configuration:Help search engines better crawl and understand website content.
  • Keyword library management and anchor text setting:Enhance content relevance and internal link value.
  • Multi-site and multi-language support:Localization of SEO for different markets and user groups.

The combination of these functions makes Anqi CMS not only a content management system but also a comprehensive SEO optimization platform.

Summary

AnQi CMS provides a set of efficient, flexible, and easy-to-operate dynamic TDK setting scheme. By detailed configuration for different page types in the background, and using simple templates in the front-end.tdkThe tags can be unified, and we can easily achieve precise management of the website's TDK.This has greatly enhanced the visibility and attractiveness of the website in search engines, and has also saved a lot of time and effort for operators, allowing them to focus more on the creation and dissemination of high-quality content.


Frequently Asked Questions (FAQ)

  1. Why did I set TDK for the article, but in the page source code I see the TDK of the homepage?This is usually because your template may not be used correctlytdkTag to dynamically obtain the TDK of the article level, ortdkThe parameter settings of the tag are incorrect (for example, some are missingnameattribute). Please check your template file(

Related articles

How to uniformly display the website's contact information, phone number, and email address with the `contact` tag?

How to efficiently manage and uniformly display a company's contact information, such as contacts, phone numbers, email addresses, and addresses, is a seemingly simple problem that often causes headaches.Imagine if this information were scattered across various pages of a website, and once an update is needed, you would have to search and modify each one individually. This is not only time-consuming and labor-intensive, but it is also prone to omissions or inconsistencies.Fortunately, AnQiCMS (AnQiCMS) provides an elegant solution - the `contact` tag, which helps us easily manage and flexibly display contact information.

2025-11-07

How to call and display the website name, Logo, filing number, and other global configuration information using the `system` tag?

Building a website in Anqi CMS, the basic information of the page, such as the website name, Logo, filing number, copyright information, etc., is an important element in forming the overall style and professionalism of the website.This information often needs to be managed uniformly and flexibly called at various corners of the website.AnQi CMS provides the `system` tag, which is like a central console that allows us to easily call and display these global configuration information.

2025-11-07

How to generate and display a clear hierarchical breadcrumb navigation on the AnQiCMS page using the `breadcrumb` tag?

In website operations, a clear navigation path is crucial for improving user experience and search engine optimization (SEO).When we browse websites, a concise and clear path can help us quickly locate and understand our current position.

2025-11-07

How to flexibly construct and display the top, side, or bottom navigation menu of a website using the `navList` tag?

When building a fully functional website, a clear and intuitive navigation menu is undoubtedly one of the core elements of user experience.AnQiCMS provides a powerful and flexible `navList` tag, allowing users to easily create and manage the top, side, or bottom navigation menus of the website, meeting different layout and content display needs. ### `navList` Tag Basic Usage The `navList` tag is a key tool in the AnQiCMS template engine used to obtain the website navigation list.

2025-11-07

How does the `archiveParams` tag display custom field data for AnQiCMS documents?

In AnQiCMS, the flexibility of website content is one of its highlights, which is attributed to its powerful content model custom field function.In addition to standard fields such as article title, content, and publication time, you can also add various custom fields according to business needs for different content models (such as articles, products), such as 'author', 'product model', 'house area', or 'service features'.These custom fields greatly enrich the expression of the website content, making it more closely aligned with practical application scenarios.So, when you tirelessly define and fill in these custom fields in the background

2025-11-07

How to build a dynamic filter using the `archiveFilters` tag to display documents that meet specific conditions?

How to help users quickly find the information they are interested in when managing a content-rich website, and improve the access experience, is a challenge that every content operator needs to face.AnQiCMS (AnQiCMS) understands this need and therefore provides a powerful `archiveFilters` tag, allowing you to easily build dynamic filters to provide flexible and diverse search methods for website content. Dynamic filter, as the name implies, is to automatically generate filtering conditions for users to choose from based on different attributes of the content.

2025-11-07

How to get and display the carousel or advertisement images on the homepage using the `bannerList` tag?

In the operation of a website, the homepage carousel or advertisement image is undoubtedly the golden area to attract visitors' attention, convey core information, and promote important content.They not only enhance the visual appeal of a website, but are also crucial for guiding user behavior and promoting content consumption.In Anqi CMS, the functions to implement and manage these carousel or ad images are all concentrated on a powerful and easy-to-use tag —— `bannerList`.

2025-11-07

How to display comments of the `commentList` tag

In website operation, article comments are an indispensable part of enhancing user interaction and activating the community atmosphere.AnQiCMS (AnQiCMS) provides us with a powerful and flexible comment management function, through the clever use of `commentList` tags, we can easily display the comments of articles on the website front-end.This article will delve into the various functions of the `commentList` tag and its practical application in templates, helping you create an interactive and user-friendly comment section.--- ### Core Tag

2025-11-07