How to customize the display logic of Title, Description, and Keywords in AnQi CMS template?
Calendar date 2025-11-07
👁️ 46
As an old soldier who has been deeply involved in website operations for many years, I know that every detail can affect the performance of a website in search engines.Among them, Title (title), Description (description), and Keywords (keywords) - commonly known as TDK, are the foundation of website SEO optimization.They are like the 'front door' and 'map' of a website, directly telling search engines and users what your page is about.
In AnQiCMS (AnQiCMS) such an efficient and customizable Go language content management system, customizing the display logic of TDK is not only flexible and convenient, but also helps us finely control the SEO strategy.Today, let's delve into how to cleverly customize the display logic of these key elements in the AnQiCMS template.
AnQiCMS TDK strategy: layered and flexible
AnQiCMS provides a hierarchical, step-by-step coverage strategy in TDK management, greatly enhancing our operational flexibility.This means that you can fine-tune the TDK for every page of the website from macro to micro.
First, inGlobal SettingsIn Chinese, you can configure TDK for the homepage of the entire website.This is usually a reflection of your brand name, core business, and overall positioning.In the "Homepage TDK settings
Furthermore, AnQiCMS allows you toat the content levelSet independent TDK for each specific content (such as articles, products, single pages, category pages, and tag pages).For example, when publishing a document, in addition to the article title and content, you will find special fields such as 'SEO Title', 'Document Keywords', and 'Document Summary'.The purpose of these fields is to allow you to optimize the search engine visibility of each piece of content specifically.Similarly, in "Document Classification
The elegance of this layered design lies in the fact that when a page has both global TDK and content TDK, the content-level TDK is often read first, thereby achieving more precise SEO control. The final TDK presented to the user is determined by yourTemplate codeDecide how to parse and display these data.
Core Tool: Universal TDK Tag{% tdk %}Exquisite application
The AnQiCMS template system uses a syntax similar to the Django template engine, one of the very powerful built-in tags being{% tdk %}. It is designed as a 'universal tag' that can intelligently capture and output the corresponding TDK information according to the current page type (home page, article page, category page, etc.).
Customization of Title (Page Title)
in the template's<head>area, you can use{% tdk with name="Title" %}Output the page's Title tag content.This label is very intelligent, it will try to get the content level (such as articles, categories, single-page SEO titles) according to the context of the current page first, and if it is not set, it will fall back to the general title of the content, and finally fall back to the global home page title.
What's even better is,{% tdk name="Title" %}and also provides several practical parameters:
siteName=trueIf you want the website name to be automatically appended to the page title, you can set it totrueFor example,{% tdk with name="Title" siteName=true %}It may output 'Article Title - Your Website Name'.
sep="_"You can customize the separator between the website name and the page title, for example, set it to an underscore_.
showParent=true: Under some category pages, you may want the Title to display the title of the parent category, and this parameter can help you achieve that.
For example, in yourbase.htmlHeader:
<title>{% tdk with name="Title" siteName=true sep=" - " %}</title>
Control of Keywords (page keywords) and Description (page description)
For Keywords and Description, the usage is similar to Title:
<meta name="keywords" content="{% tdk with name="Keywords" %}">
<meta name="description" content="{% tdk with name="Description" %}">
They will also match intelligently based on the page context, prioritizing keywords and descriptions set at the content level, followed by their regular introduction, and finally falling back to the global settings.
The introduction of Canonical Url (standard link)
In SEO, standard linksCanonical UrlAre crucial for handling duplicate content. AnQiCMS also provides{% tdk with name="CanonicalUrl" %}The link to display the page standard. When content is published, if the article or single page is set to standard link, it will be output here. **Practical condition judgment:
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
This ensures that the label is only output when there is a standard link, keeping the code tidy.
Practical exercise in customizing TDK display logic.
Though{% tdk %}The tag is already smart, but in some specific business scenarios, we may need a more refined and prioritized TDK display logic.AnQiCMS's template flexibility allows us to directly write judgments in the template and customize the process of retrieving data.
Assuming you want to implement such logic on the article detail page:
- Use the article's own 'SEO title' first.
- If the "SEO title" is empty, then use the article's "Document title".
- Finally, add the website name uniformly.
You can use the article detail template (such asarchive/detail.html)的<head>parts are written like this:
`html
{% set pageTitle = "
{% set pageTitle = seoTitle %}
{% else %}
{# 如果SEO标题为空,则获取文章的常规标题 #}
{% archiveDetail articleTitle with name="Title" %}
{% set pageTitle = articleTitle %}
{% endif %}
{# Get the website name #}
{% system siteName with name=“SiteName” %}
{# Combined Final Title #}
{{<p>}}\n\n \n <article>\n\n <!-- Prev / Next -->\n <div class=\
</span>
</a>
</div>
<div class="flex-1 justify-end">
<a href="https://en.anqicms.com/blog/6572.html" class="prev-next-link group flex flex-col items-end px-5 py-3 rounded-lg border border-gray-200 dark:border-gray-700 hover:border-blue-500 dark:hover:border-blue-400 transition-all duration-200 min-w-[140px]">
<span class="text-xs text-gray-400 dark:text-gray-500 mb-0.5">Next</span>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors flex items-center gap-1">
What parameters should be paid attention to when using the `tdk` tag of Anqicms?<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</span>
</a>
</div>
</nav>
</div>
<!-- Related articles -->
<div class="mt-10">
<h3 class="text-base font-semibold text-gray-800 dark:text-gray-200 mb-4">Related articles</h3>
<div class="grid sm:grid-cols-2 gap-4">
<a href="https://en.anqicms.com/blog/6570.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group">
<h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">How long after setting the TDK tags of Anqicms can it be indexed by search engines?</h4>
</a>
</div>
</div>
<h4></h4> <p class="text-xs text-gray-400 mt-1 line-clamp-2">How long after setting the AnQiCMS TDK tags can they be indexed by search engines?A deep analysis by an operations expert
In the daily work of website operations, the setting of TDK (Title, Description, Keywords) tags is undoubtedly the foundation of SEO optimization.They are the key windows for search engines to understand the theme and content of a web page. Many users of AnQiCMS, after carefully configuring these important tags, are eager to know: 'How long will it take for my TDK tags to be indexed and displayed by search engines after they are set?'
<span class="text-xs text-gray-400 mt-2 block">2025-11-07
</span>
<a href="https://en.anqicms.com/blog/6569.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group">
<h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">
安企CMS的图片Alt标签与TDK关键词有什么关联?
</h4>
</a>
As an experienced website operations expert, I am more than happy to delve into the close correlation of AnQiCMS (AnQiCMS) in image Alt tags and TDK keyword optimization.In today's content-driven era, Search Engine Optimization (SEO) is the key to a website's success, and TDK (Title, Description, Keywords) as well as image Alt tags are indispensable elements in building this foundation.AnQi CMS as an efficient, SEO-friendly content management system</p><span class="text-xs text-gray-400 mt-2 block">2025-11-07</span><a href="https://en.anqicms.com/blog/6568.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group"><h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">How to configure differentiated TDK strategies for different content models in AnQi CMS? </h4></a><h4>
<p class="text-xs text-gray-400 mt-1 line-clamp-2"
## AnQiCMS Content Operation: Customized TDK Optimization Strategy for Different Content Models
As a senior website operation expert, we understand that in the highly competitive digital world, Search Engine Optimization (SEO) is the foundation of website success.While TDK (Title, Description, Keywords) serves as the "front page" of website content, its accuracy directly affects the search engine's understanding of the page content and the users' willingness to click.In AnQiCMS (AnQiCMS) such an efficient</p>
<span class="text-xs text-gray-400 mt-2 block">2025-11-07</span>
</a>
<a href="https://en.anqicms.com/blog/6567.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group">
<h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">Does the TDK tag content of AnQiCMS support HTML code or special characters??As an experienced website operations expert, I fully understand your concerns about the compatibility of various details in the process of content management and SEO optimization, especially the compatibility of TDK tag content.AnQiCMS (AnQiCMS) took full consideration of the needs of website operators from the very beginning of its design, striving to achieve a balance between flexibility, functionality, and security.Today, let's delve deeply into the topic "Does the TDK tag content of Anqi CMS support HTML code or special characters?".
### In-depth understanding of Anqi CMS TDK mechanism
In Anqi CMS</p>
<span class="text-xs text-gray-400 mt-2 block">2025-11-07</span>
</a>
<a href="https://en.anqicms.com/blog/6572.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group">
<h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">What parameters should be noted when using Anqi CMS 'tdk' tag?</h4> <p class="text-xs text-gray-400 mt-1 line-clamp-2">As an experienced website operations expert, I am well aware of the importance of TDK (Title, Description, Keywords) for the performance of the website in search engines.Anqi CMS, with its SEO-friendly design concept, provides us with powerful and flexible TDK management capabilities. Today, let's delve into the various parameters to be noted when using the `tdk` tag in Anqi CMS, to help everyone better master this core SEO element.
### Mastering Anqicms TDK Tags</p>
<span class="text-xs text-gray-400 mt-2 block">2025-11-07</span>
</a>
<a href="https://en.anqicms.com/blog/6573.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group">
<h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">What is the difference between `siteName=true` and `siteName=false` in the Title tag of Anqicms?</h4>
<p class="text-xs text-gray-400 mt-1 line-clamp-2">## The Secret of Title Tag in Anqi CMS: Deep Analysis of `siteName=true` and `siteName=false`
In the daily operation of Anqi CMS, we know that every detail of the website may affect its performance in search engines and the willingness of users to click.The title tag serves as the 'facade' of a webpage, its importance is self-evident. It is not only a key signal for search engines to understand the theme of the page, but also the primary information that users determine at a glance in the search results.AnQi CMS as an efficient and customizable content management system<p></p><span class=\In today's digital world, every detail of a website can affect its performance in search engines and the first impression of users.The page title (Title) serves as the 'face' of the website content, its importance is self-evident. It is not only a key clue for search engines to understand the theme of the page, but also a direct factor for users to decide whether to click in the search results.AnQiCMS (AnQiCMS) understands this and is committed to providing users with an efficient, customizable content management solution, including fine-grained control over page titles.As an experienced website operation expert</p> <span class="text-xs text-gray-400 mt-2 block">2025-11-07</span> </a> <a href="https://en.anqicms.com/blog/6575.html" class="p-4 rounded-xl bg-gray-50 dark:bg-gray-900 hover:bg-blue-50 dark:hover:bg-blue-900/20 border border-gray-100 dark:border-gray-800 transition-colors group"> <h4 class="text-sm font-medium text-gray-800 dark:text-gray-200 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">How Anqicms uses the `showParent=true` attribute to display richer hierarchical information in the Title? </h4> </a><h4>
<p class="text-xs text-gray-400 mt-1 line-clamp-2"
安全CMS, as an enterprise-level content management system that deeply understands the way of content operation, its powerful function design reflects a profound understanding of user needs and search engine optimization.The importance of the page title (Title) in website operation is self-evident. It is not only the first entry for users to click but also the core basis for search engines to judge the relevance of page content.Today, let's delve into how Anqi CMS cleverly utilizes the `tdk` tag's `showParent=true` attribute to enrich and add a sense of hierarchy to the page title</p>
<span class="text-xs text-gray-400 mt-2 block">2025-11-07</span>
</a>
</div>
</div>
</div>
<!-- Sidebar categories -->
<aside class="lg:w-64 flex-shrink-0 mb-8 lg:mb-0">
<!-- Search -->
<div class="mb-4 max-w-lg mx-auto">
<form action="/search" method="get">
<div class="relative">
<svg class="absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
<input type="text" name="q" placeholder="Search articles..." value="" class="w-full pl-12 pr-4 py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</form>
</div>
<nav class="space-y-1 bg-white top-24">
<a href="/help/" class="block px-3 py-2 text-sm font-medium rounded-lg text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 transition-all">All Articles</a>
<a href="https://en.anqicms.com/help" class="block px-3 py-2 text-sm font-medium rounded-lg text-gray-600 dark:text-gray-400 hover:text-blue-600 hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">Anqicms User Manual</a>
<a href="https://en.anqicms.com/manual" class="block px-3 py-2 text-sm font-medium rounded-lg text-gray-600 dark:text-gray-400 hover:text-blue-600 hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">Anqicms Template Tag Manual</a>
<a href="https://en.anqicms.com/anqiapi" class="block px-3 py-2 text-sm font-medium rounded-lg text-gray-600 dark:text-gray-400 hover:text-blue-600 hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">Anqicms API Help</a>
<a href="https://en.anqicms.com/changelog" class="block px-3 py-2 text-sm font-medium rounded-lg text-gray-600 dark:text-gray-400 hover:text-blue-600 hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">Anqicms Update Log</a>
<a href="https://en.anqicms.com/plugin" class="block px-3 py-2 text-sm font-medium rounded-lg text-gray-600 dark:text-gray-400 hover:text-blue-600 hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">Anqicms Function Introduction</a>
</nav>
<div class="mt-8">
<h3 class="text-sm font-semibold text-gray-800 dark:text-gray-200 mb-3 px-1">Recommended</h3>
<div class="space-y-2">
<a href="https://en.anqicms.com/blog/3480.html" class="block p-3 rounded-xl bg-gray-50 dark:bg-gray-800/50 hover:bg-blue-50 dark:hover:bg-blue-900/10 border border-gray-100 dark:border-gray-800/50 hover:border-blue-200 dark:hover:border-blue-800 transition-all group">
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors line-clamp-2">How to enable remote debugging of Chrome browser, supports windows and MacOS, Linux</h4>
<p class="text-xs text-gray-400 mt-1 line-clamp-2">Here are the methods to enable remote debugging of Chrome browser on various operating systems: Windows operating system: Make sure you have installed Chrome browser and it is up to date.Open a Command Prompt window (press Win + R, enter "cmd", and then press Enter). C:\Program Files\Google\Chrome\Application\chrome.exe
<span class="text-xs text-gray-400 mt-1.5 block">2023-06-22</span>
<a href="https://en.anqicms.com/help-basic/112.html" class="block p-3 rounded-xl bg-gray-50 dark:bg-gray-800/50 hover:bg-blue-50 dark:hover:bg-blue-900/10 border border-gray-100 dark:border-gray-800/50 hover:border-blue-200 dark:hover:border-blue-800 transition-all group">
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors line-clamp-2">AnqiCMS 2.x installation</h4>
<p class="text-xs text-gray-400 mt-1 line-clamp-2">AnqiCMS, a corporate site content management system developed using GoLang, is easy to deploy, software is safe, the interface is elegant, small, executes quickly, and websites built with AnqiCMS can prevent many security issues from occurring.</p>
</a>The supported systems support Windows 7, Windows 8, Windows 10, Windows 11, W...How to choose the most suitable enterprise website building program has become one of the issues that enterprises must consider. So, how to choose the most suitable one among the many website building programs?Businesses should consider their own needs. The basic requirements for a business website should be: stable, secure, easy to use, and comprehensive in functionality. Therefore, when choosing a website building program, businesses need to pay close attention to these aspects.In terms of stability, it is recommended to choose large-scale website building programs or open-source projects that have been optimized multiple times. For example, WordPress, Discuz</p>
<span class="text-xs text-gray-400 mt-1.5 block">2023-04-12</span>
</a>
<a href="https://en.anqicms.com/blog/3476.html" class="block p-3 rounded-xl bg-gray-50 dark:bg-gray-800/50 hover:bg-blue-50 dark:hover:bg-blue-900/10 border border-gray-100 dark:border-gray-800/50 hover:border-blue-200 dark:hover:border-blue-800 transition-all group">
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors line-clamp-2">The benefits of building a corporate website with Anqicms</h4>
<p class="text-xs text-gray-400 mt-1 line-clamp-2">In recent years, with the rapid development of Internet technology, more and more enterprises have begun to realize the importance of establishing their own official websites on the Internet.While building a corporate website, how to choose a stable, easy-to-use, and feature-rich CMS platform is also a key issue that enterprises need to consider.Among many CMS platforms, Anqi CMS is undoubtedly an excellent solution worth choosing for enterprises. Anqi CMS is an open-source enterprise website management system with many advantages, particularly suitable for building corporate websites.First, Anqi CMS has a wealth of template and plugin resourcesTongliao website construction recommends using Anqi CMS system, compared to other CMS systems, Anqi CMS system has many advantages, the first being that the program is 100% open source, free and open source, which is very convenient for secondary development.The backend management operation is simple and easy to use, which is also very important for enterprises without technical expertise</p><span class="text-xs text-gray-400 mt-1.5 block">2023-04-12</span></a><a href="https://en.anqicms.com/blog/3474.html" class="block p-3 rounded-xl bg-gray-50 dark:bg-gray-800/50 hover:bg-blue-50 dark:hover:bg-blue-900/10 border border-gray-100 dark:border-gray-800/50 hover:border-blue-200 dark:hover:border-blue-800 transition-all group"><h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors line-clamp-2">What content and methods should be known when building an enterprise website</h4><p class="text-xs text-gray-400 mt-1 line-clamp-2">In the era of the Internet, the enterprise website has become a window for corporate brand promotion, and building an excellent enterprise website is an issue that every enterprise must face and cannot ignore.</p>So, what should be paid attention to when building an enterprise website? 1. Positioning Before planning an enterprise website, we first need to clarify the positioning of the website, that is, the theme and design concept of the site, as well as the content and style to be displayed.This is the core of building a website</p>
<span class="text-xs text-gray-400 mt-1.5 block">2023-03-20</span>
</a>
</div>
</div>
</aside>
</div>
</div>
</section>
<!-- ==================== FOOTER ==================== -->
<footer class="border-t border-gray-200 dark:border-gray-800 bg-white dark:bg-[#0f172a]">
<div class="max-w-[1440px] mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="grid grid-cols-2 lg:grid-cols-4 gap-8">
<div>
<div class="flex items-center gap-2.5 mb-4">
<div class="w-8 h-8 flex items-center justify-center">
<img src="https://en.anqicms.com/uploads/202606/15/2144e205d561d0a5.webp" alt="搜外科技安企CMS" />
</div>
<span class="text-lg font-bold text-gray-800 dark:text-gray-100">搜外科技安企CMS</span>
</div>
<p class="text-sm text-gray-500 dark:text-gray-400 leading-relaxed">Based on GoLang, memory usage is reduced by about 80% compared to PHP CMS, supports multi-site, multi-language, AI intelligent dialogue and tool calls, and is the preferred solution for small and medium-sized enterprises to build high-performance websites.</p> <div class=\
al.src = "/api/log?action=views&code=200&id=6571&path=http%3A%2F%2Fwww.anqicms.com%2Fblog%2F6571.html&type=archive&nonce="+Date.now();document.body.appendChild(al);
})();
</script>
</html>