How to integrate AnQiCMS category detail information (such as category name, description) into Json-LD?

Calendar 👁️ 77

As an experienced website operations expert, I am well aware that it is crucial to understand how to make our website content better understood and presented by search engines in an increasingly competitive online environment.Structured data (JSON-LD) is a powerful tool at our disposal, helping search engines parse page information more accurately, thereby giving us the opportunity to display richer search results and attract more users' attention.

Today, let's delve into a topic that is of great concern to AnQiCMS users: how to cleverly integrate the core information of category details in AnQiCMS, such as category names, descriptions, etc., into JSON-LD to optimize the performance of our category pages in search engines.

Embrace JSON-LD: Why does the category page need it?

In a powerful content management system like AnQiCMS, the category page often carries a large number of links to articles, products, and other content, which is an important hub for user navigation and information discovery.However, search engines may only treat these pages as a common list page when crawling them.If we can clearly tell search engines about a category page of a certain topic using a standard format like JSON-LD, including its name, description, and so on, then search engines can better understand the theme and structure of the page. This is undoubtedly a huge help in improving the SEO effect of the category page, such as displaying more relevant 'rich media summaries (Rich Snippets)' in search results.

AnQiCMS is a system that highly focuses on SEO optimization and provides flexible content solutions, its built-in functions provide a solid foundation for us to achieve this goal.From pseudo-static management to advanced SEO tools, AnQiCMS has always been committed to helping users stand out in search engines.And customizing JSON-LD is exactly the key step to pushing this optimization ability to a deeper level.

The way of integration of AnQiCMS JSON-LD: flexible and powerful coexist

AnQiCMS understands the importance of structured data and therefore provides very flexible JSON-LD customization capabilities in the system.It does not simply help you generate a static JSON-LD, but allows you to fine-tune it at the template level according to specific needs.This design concept allows us to fully utilize the AnQiCMS template tags to seamlessly integrate the dynamic data of category details into the JSON-LD structure.

The core integration mechanism lies in the AnQiCMS provided{% jsonLd %}The tag allows us to define custom JSON-LD data, and AnQiCMS will intelligently merge it with the default JSON-LD data that may already be on the page.This means that we can enjoy the basic structured data automatically generated by the system, and also add more personalized and precise data on this basis, such as for specific pages (such as category detail pages).

Step one: Understand the source of classified data

To integrate category information into JSON-LD, we first need to clarify how to obtain these data from AnQiCMS. Fortunately, AnQiCMS provides{% categoryDetail %}Labels, they can help us easily get the details of the current category or a specified category.

When we are on a category detail page,{% categoryDetail %}Labels can be automatically identified and retrieve the data of the current category without any additional parameters. We can specify the specific fields to be retrieved usingnameattributes, for example:

  • Category Name:{% categoryDetail with name="Title" %}
  • Category link:{% categoryDetail with name="Link" %}
  • Category description:{% categoryDetail with name="Description" %}
  • Category thumbnail/Logo:{% categoryDetail with name="Logo" %}or{% categoryDetail with name="Thumb" %}

The values of these fields will become the key elements in constructing JSON-LD.

Step two: Refine the JSON-LD structure.

Next, we will utilize{% jsonLd %}Tags and{% categoryDetail %}tags to build a JSON-LD structure suitable for category pages. For category pages,CollectionPageorWebPageand usingaboutThe property to describe the page theme is a common Schema type. Here we takeCollectionPageFor example, it can well express the meaning of a collection page (such as an article list page, product classification page).

Assuming we want to add the category name, description, URL, and possibly the category logo information to the JSON-LD, we can do so in the AnQiCMS category list template (for example{模型table}/list.htmlor{模型table}/list-{文档分类ID}.htmlAdd the following similar code:

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CollectionPage",
  "name": "{% categoryDetail with name='Title' %}",
  "description": "{% categoryDetail with name='Description'|striptags|truncatechars:150 %}", {# 确保描述是纯文本且长度适中 #}
  "url": "{% categoryDetail with name='Link' %}",
  {%- set categoryLogo = categoryDetail.Logo %} {# 获取Logo,如果不存在可尝试Thumb #}
  {%- if categoryLogo %}
  "image": "{% categoryDetail with name='Logo' %}",
  {%- elif categoryThumb = categoryDetail.Thumb %} {# 如果Logo不存在,尝试Thumb #}
  "image": "{% categoryDetail with name='Thumb' %}",
  {%- endif %}
  "mainEntity": {
    "@type": "ItemList",
    "numberOfItems": "{% categoryDetail with name='ArchiveCount' %}",
    "itemListElement": [
      {# 这里可以动态生成部分列表项的JSON-LD,例如前几个文章或产品 #}
      {# 假设我们只显示前3个文章作为示例,需要根据实际页面内容调整 #}
      {% archiveList archives with type="list" limit="3" %}
      {%- for item in archives %}
      {
        "@type": "ListItem",
        "position": {{ forloop.Counter }},
        "url": "{{ item.Link }}",
        "name": "{{ item.Title }}"
      }{%- if not forloop.Last %},{% endif %}
      {%- endfor %}
      {% endarchiveList %}
    ]
  }
}
</script>
{% endjsonLd %}

In this code, we:

  1. Define context and type:"@context": "https://schema.org"and"@type": "CollectionPage"It is clear that this is a Schema.org collection page.
  2. Integrate core dataThrough `{% categoryDetail with name=‘…’

Related articles

Does the URL path in Json-LD automatically adapt to AnQiCMS's pseudo-static settings?

AnQiCMS as an enterprise-level content management system focusing on SEO optimization, its pseudo-static (URL rewriting) function is undoubtedly one of the core strategies to enhance the search engine friendliness of the website.While Json-LD plays a crucial role as an important carrier of structured data in modern SEO.So, in Anqi CMS, can the URL path of Json-LD content automatically adapt to the website's pseudo-static settings?This is the issue that many operators and developers are concerned about.

2025-11-06

How to get the canonical URL of the current page in Json-LD?

AnQi CMS, as an enterprise-level system that specializes in content management, always makes every effort to improve the website's SEO performance.We know that it is crucial to clearly and accurately convey website information to search engines in the context of increasingly refined search engine algorithms.Amongst them, the clever combination of the规范链接(`canonical URL`)and structured data(JSON-LD)is a tool to optimize website visibility and avoid the penalty of duplicate content.

2025-11-06

What Schema.org types are commonly used in the development of AnQiCMS?

In today's digital marketing battlefield, the visibility and content understanding of a website are crucial to the success of enterprises and self-media operators.AnQiCMS (AnQiCMS) is an efficient content management system based on the Go language, which not only provides powerful content publishing and management capabilities, but also has put a lot of effort into SEO optimization.Among them, structured data, especially the Schema.org tags implemented through JSON-LD format, are important tools to help search engines deeply understand the content of websites and improve search rankings.

2025-11-06

`{% Ld %}` tag supports `with` variable assignment to organize complex Json-LD content?

As an experienced website operations expert, in the practice of AnQiCMS (AnQiCMS), we understand the importance of structured data (Schema.org Markup) for modern SEO.It is not only to make search engines better understand your content, but also to enhance the display form of the website in search results and obtain the key to 'rich media abstract'.

2025-11-06

How to reference the `moduleDetail` tag in Json-LD to get model information?

As an expert deeply familiar with website operations, I know that how to make our website content better understood and presented by search engines in today's information explosion is the core of gaining traffic and enhancing brand influence.While Json-LD is an important form of structured data, it is an indispensable tool for us to achieve this goal.AnQiCMS with its flexible content model and powerful template engine provides a solid foundation for us to build various types of websites.

2025-11-06

Does AnQiCMS support dynamic submission or updating of structured data through API?

## AnQiCMS's Json-LD structured data: In-depth analysis of API dynamic submission and updates As an experienced website operations expert, I am well aware of the core status of structured data in today's search engine optimization.Json-LD, as a lightweight and powerful structured data markup, can help search engines better understand web content, thereby enhancing the search visibility and richness of a website.

2025-11-06

How to ensure that the data is up-to-date when customizing Json-LD and avoid cache issues?

In website operation, Json-LD is a powerful structured data format that is crucial for enhancing the search engine's understanding of website content and increasing the display opportunities of the website in search results (such as rich media abstracts).AnQiCMS (AnQiCMS) takes advantage of its flexible template engine and good support for custom features, making it easy to integrate and manage Json-LD.You can directly use the `{% Ld %}` tag in the template to embed customized Json-LD code, thereby accurately describing the content of your page to search engines

2025-11-06

Can the `Json-LD` tag be used to generate structured data for a single page (`pageDetail`)?

As an experienced website operations expert, I am well aware of the crucial role of structured data in improving a website's search engine performance.AnQiCMS (AnQiCMS) was designed with a strong emphasis on SEO-friendliness, providing a wide range of space for us to deeply optimize website content with its flexible template system and tag mechanism.Today, let's delve into a topic that concerns everyone: 'Can Json-LD tags be used to generate structured data for single-page (pageDetail) generation?'}]

2025-11-06