As a senior website operations expert, I am well aware that how to flexibly and efficiently display information in a content management system is the key to website success.English CMS (EnglishCMS) provides many conveniences in this aspect due to its powerful features.Category Details Tag (categoryDetail)Look at how it plays a core role in content operation.
The design concept of Anqi CMS is to provide users with a highly customizable and easily expandable content management platform that supports diverse content display.In the structure of website content, categories play a role of bridging the past and the future. It is not only the classification of content, but also an important path for users to explore and for search engines to understand the structure of the website.While 'Category Details Tags' is designed to display these category information in the most abundant and convenient way for users.
The core role and value of the classification detail tag
In simple terms, the "classification detail tag" is used in the Anqi CMS.Get and display all detailed information of a specific categoryA tool for that. Unlike the 'Category List Tag' used for listing multiple categories,categoryList),“Category details tag”focuses on extracting detailed data of a single category, including its basic attributes, media resources, and custom parameters.This allows website operators to build highly personalized, content-rich category pages on the frontend.
Imagine a travel website's "Europe ToursAll these requirements can be met through the "Category Details Tags
rich application scenarios, helping content marketing and user experience
The strength of this tag lies in its wide range of applications:
Build a dedicated category landing page:The most direct use is to create independent detail pages for each category. Here, you can use tags to get the title of the category (
Title) and detailed description (Description),even carefully edited categorized content (Content,let users fully understand the themes and features covered by the category as soon as they enter it. For example, as mentioned in the 'Document Classification Usage Help', the category introduction can be used as the content of the description in the TDK tags, the category content editor has rich functions, supports various text operations, and all these can be accessed throughcategoryDetailLabel is displayed.Enhance navigation and breadcrumb experience:In the navigation structure of the website, users often need to understand the hierarchical relationship of the current category. With the "Category Details Tag", you can easily obtain the parent ID of the category.
ParentId) Thus, it constructs a clear breadcrumb navigation, helping users quickly locate and improve the usability of the website. Although the breadcrumb navigation tags themselves (breadcrumb)Can achieve this function, but in some scenarios that require fine-grained control of classification information,categoryDetailmore flexibility can be provided.Enhance visual appeal and brand image:Visual elements are crucial for attracting users. Through this tag, you can easily retrieve the banner images uploaded under categories (
Images) or thumbnails (Logo/Thumb), Apply it to the top Banner, sidebar, or list items on the classification page. For example, 'Document Classification Help' clearly states that banners and thumbnails can be set for categories, all of which are done throughcategoryDetailGet and render.Associate category information in the content list:When you are in the article list (such as using)
archiveList标签(Labels)中展示多篇文章时,每篇文章往往会归属于某个分类。Now, you can use 'Category Details Tags' nested in the article loop, according to the article's category ID to fetch and display the name, link, and even the thumbnail of the category, making the list information richer and guiding users to related categories.For example, when displaying a list of articles, showing the name and link of the category to which each article belongs can greatly enhance the relevance of the content.SEO optimization and fine management:Auto CMS highly values SEO, and category information is an important part of SEO strategy. "Category detail tags" can directly output the category title and description (
Title,DescriptionThese are the key metadata that search engines crawl and understand the content of web pages.Cohabiting with the SEO title and keywords set in the background, it can bring better search engine visibility to the category page.Display the number of documents under the category:In scenarios where you need an overview of information, such as category navigation or category list pages, you may want to display how many articles are under each category. The "Category Details Tag" provides
ArchiveCountThe field can conveniently display the total number of documents under the category, helping users quickly understand the richness of the category content.
How to conveniently use the "Category Details Tag"
In the template files of AnQi CMS, the general syntax for the 'Category Details Tag' is: {% categoryDetail 变量名称 with name="字段名称" id="1" %}
Here are several key points to understand:
name="字段名称": This is the core parameter, it tells the tag which specific attribute of the category you want to get. For example,name="Title"will retrieve the title of the category,name="Content"to get the detailed content of the category.id="1"ortoken="your-category-alias": When you need to getSpecific categorywhen information is provided, it can beidspecify the ID of the category through thetokenspecify the URL alias of the category. If neither of these parameters is specified, the tag willDefaultly get the category information associated with the current page.变量名称: You can specify a variable name for the category information obtained (e.g.,)categoryInfo), so you can use it in the template code later{{categoryInfo.Title}}This way to refer. If you do not need to define a variable name, the label will directly output the value of the field.siteId: If your CMS has multiple site management functionality deployed and you need to retrieve category information under other sites, you can specify the site ID throughsiteIdparameter.
The following are some common field applications:
- Category name:
{% categoryDetail with name="Title" %}or{{category.Title}}(IncategoryDetailHas been defined as:categoryWhen it is a variable). - Category links:
{% categoryDetail with name="Link" %}To generate clickable category URLs. - Category Description:
{% categoryDetail with name="Description" %}Is usually used in HTML meta tags or page descriptions. - Category detailed content:
{% categoryDetail with name="Content" %}If the category content includes Markdown format, you can add parameters to render it as HTML, for examplerender=trueparameters to render it as HTML, for example{% categoryDetail with name="Content" render=true %}. - Category thumbnail/Banner image:
{% categoryDetail with name="Logo" %}(Large image),{% categoryDetail with name="Thumb" %}(Thumbnail) or{% categoryDetail categoryImages with name="Images" %}(Multiple Banner images, usually requires coordination with)forloop traversal). - Number of documents under category:
{% categoryDetail with name="ArchiveCount" %}.
The call of a custom field:Safe CMS allows you to customize additional fields for content models and categories (as described in the "Content Model Usage Help" section). These custom fields can also becategoryDetailTag to get. For example, if you add a field namedcontactPersonto the category in the background, you can call it like this:{% categoryDetail with name="contactPerson" %}. If you need to display all custom fields in a loop, you can use{% categoryDetail extras with name="Extra" %},then traverseextrasa variable.
Through these flexible parameter settings and field retrieval, website operators can meet actual needs, and present category information in the most aesthetic,