What is the tag syntax for getting the category title, category link, and category description on the current page?

Calendar 👁️ 68

As an experienced website operation expert, I am fully aware that in an efficient content management system like AnQiCMS, it is crucial to flexibly call page data to build a user-friendly and SEO-friendly website.Today, we will focus on a common and core requirement: how to accurately obtain the category title, category link, and category description of the current page in the Anqi CMS template.

The Anqi CMS template secret: easily get the current page category title, link, and description

In the powerful world of Anqi CMS, content managers and developers can always find efficient tools to manage and display information.How to accurately obtain the information of the current page's category (Category), such as its title, link, and detailed description, is an indispensable part of building a dynamic website.This article will deeply explore the core template tags used in Anqi CMS to achieve this goal, helping you master the classification data in the most concise and powerful way.

Anqi CMS template language overview

AnQi CMS uses a template language similar to Django, which has an intuitive syntax and is easy to learn. You will often see two main tags: double curly braces{{ 变量 }}Used for outputting data, while a single curly bracket followed by a percentage sign{% 标签 %}is used for controlling logic and calling specific function tags. When writing templates, variable names usually follow camel case naming, such asitem.Title/category.LinkAnd be case sensitive, pay attention.

Core tags:categoryDetailThe mystery of

To get the category information of the current page, AnQi CMS provides a namedcategoryDetailcore template tag. The key to this tag is itsnameThe parameter, it determines the specific category attributes you want to retrieve.

When you are on the category list page, category detail page, or any document detail page that belongs to a categorycategoryDetailif a tag is not specifiedidortokenThe parameter, it will intelligently recognize and automatically obtainCurrent pageThe associated category data. This means you do not need to manually pass the category ID, the system will complete the identification for you, greatly simplifying the template development process.Of course, if you need to obtain specific category information from a non-current page, you can also do so byid="分类ID"ortoken="分类别名"To specify clearly. For users with multi-site operations,siteIdParameters can help you call classification data across sites.

Next, we will explain in detail how to usecategoryDetailTags to get the category title, link, and description.

Get the category title (Title)

The category title is one of the most common requirements for building navigation or page header information. You can usename="Title"Parameter to achieve.

If you just want to output the title directly, you can do it like this:

<div>当前分类标题:{% categoryDetail with name="Title" %}</div>

To make the template code clearer and easier to manage, you can also assign the obtained title to a variable, for examplecurrentCategoryTitleReference it multiple times in other places of the template.

{% categoryDetail currentCategoryTitle with name="Title" %}
<div>当前分类标题:{{ currentCategoryTitle }}</div>
Get the category link (Link)

The category link is a bridge guiding users to browse other related content. Usename="Link"Parameters, you can easily obtain the URL of the current category.

Directly output the link:

<div>当前分类链接:<a href="{% categoryDetail with name="Link" %}">点击进入</a></div>

Assign the link to a variable: “`twig {% categoryDetail currentCategoryLink with name=“Link” %}

Current category link:

Related articles

How to accurately call the detailed information of a specified category through the category ID or category alias (token)?

As an experienced website operations expert, I know that being able to accurately and flexibly call data is the key to improving operational efficiency and website performance.AnQiCMS (AnQiCMS) relies on its powerful template tag system, providing us with many conveniences, especially in calling category detail information, whether through category ID or category alias (token), it can achieve accurate operations.Today, let's delve into how to obtain and display detailed information of a specified category in Anqi CMS through these two methods.

2025-11-06

What is the main purpose and application scenario of the 'Category Details Label' in Anqi CMS?

As an experienced website operations expert, I know that how to flexibly and efficiently display information in a content management system is the key to the success of the website.AnQiCMS (AnQiCMS) provides many conveniences in this aspect with its powerful functions.Today, let's delve deeply into a very practical and powerful template tag in Anqi CMS, the **category detail tag (`categoryDetail`)**, and see how it plays a core role in content operation.

2025-11-06

How is the loading speed of AnQiCMS comment captcha under low bandwidth network conditions, can it be optimized?

As an experienced website operations expert, I know that it is crucial to achieve a balance between user experience and website security in an increasingly complex network environment.AnQiCMS (AnQiCMS) has won the favor of many users in the content management field with its high-performance architecture based on the Go language.Today, let's delve deeply into a frequently discussed issue in actual operation: 'How fast does AnQiCMS comment captcha load in low bandwidth network environment, can it be optimized?'

2025-11-06

How does the backend program handle the `captcha` field of AnQiCMS when submitting?

As an experienced website operations expert, I am very familiar with the fact that every seemingly small field in a content management system carries important functions and security responsibilities.AnQiCMS (AnQiCMS) is an efficient and secure system with Go language as its core, and its captcha mechanism design naturally reflects this concept.Today, let's delve into how the backend program cleverly handles the `name="captcha"` field in the form submission in AnQiCMS.

2025-11-06

Can the category detail tag display the complete content (Content)? How can you ensure correct rendering?

As an experienced website operations expert, I know that how to flexibly and accurately display content in a content management system is the key to operational success.TodayHow to operate to ensure correct rendering?

2025-11-06

Markdown formatted category content, how to automatically render it into HTML format through category detail tags?

In the daily operation of the AnQiCMS website, content creators often need to find a balance between creative efficiency and the final presentation effect.Markdown format, with its concise and intuitive syntax, has undoubtedly become the preferred tool for many content editors.How can one elegantly and efficiently render Markdown-written categorized content into browser-readable HTML format in the powerful AnQiCMS content management system?

2025-11-06

How to get the SEO title, keywords, and description of a category to optimize the search engine inclusion of the category page?

In the vast realm of website operations, category pages are like lighthouses of navigation, guiding users to the content they are interested in, while also showing search engines the organization and depth of the website's content.A well-optimized category page, which can not only significantly improve user experience, but is also the key to gaining search engine favor and winning natural traffic.

2025-11-06

Does the category detail label support displaying the category thumbnail (Thumb) and large image (Logo)? What are

As an experienced website operations expert, I am well aware of the importance of visual presentation of website content in attracting users, enhancing brand image, and optimizing search engine rankings.When using AnQiCMS for daily operations, we often need to handle various image resources, especially how to flexibly display categorized visual elements on different pages.TodayWhat is the role of each?

2025-11-06