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

Calendar 👁️ 64

As an expert deeply familiar with website operations, I know that in today's information explosion, how to make our website content better understood and presented by search engines is the core of attracting traffic and enhancing brand influence.While Json-LD is an important form of structured data, it is an indispensable tool for achieving our goals.

AnQiCMS with its flexible content model and powerful template engine provides a solid foundation for building various types of websites. Today, let's delve into a skill often overlooked in improving the SEO performance of AnQiCMS websites, yet it is crucial: how to cleverly reference in Json-LDmoduleDetailTags to dynamically obtain information about the content model.

I. The convergence of Json-LD and AnQiCMS content model value

Let's briefly review the value of Json-LD.Json-LD (JavaScript Object Notation for Linked Data) is a data format based on JSON, used to embed structured data in web pages.This data can help search engines better understand the meaning of web page content, and may be displayed in search results in the form of 'Rich Media Summary' (Rich Snippets), such as displaying star ratings, product prices, article publication dates, etc., thereby significantly increasing click-through rates.

One of AnQiCMS's core advantages lies in its 'flexible content model' feature.It allows us to customize various content types according to business needs, such as 'article model', 'product model', 'case model', etc.Each model can have its own unique fields, which allows AnQiCMS to adapt to diverse content structures.These models are not only the foundation of content organization, but also carry important metadata, such as the name of the model, description, URL alias, and so on.This metadata is the valuable source of information for us to build Json-LD structured data.

Imagine that if our website is about travel products, we might have a content model named "Travel Routes".In Json-LD, declaring this as a “Product” or “Service” type allows dynamically referencing the name, description, and even the unified entry link of this model, which is undoubtedly more flexible and intelligent than hardcoding this information and more in line with the operation requirements of dynamic websites.

Second,moduleDetailTags: The 'extractor' of model information.

In the AnQiCMS template system,moduleDetailThe tag plays the role of a special 'extractor' used to obtain detailed information about the content model.It allows us to easily access the metadata of any content model in the template without directly interacting with the database, greatly simplifying the template development process.

moduleDetailThe basic usage of tags is{% moduleDetail 变量名称 with name="字段名称" id="模型ID" %}. Among them,变量名称It is an optional parameter, if specified, the obtained model information can be assigned to the variable for subsequent reuse;nameThe parameter specifies the model properties we want to retrieve and;idortokenThe parameter is used to explicitly specify which model's information. In a multi-site environment, we can also go throughsiteIdThe parameter specifies the model information of the site.

moduleDetailTags can provide us with the following key model information:

  • Model ID (Id): The unique identifier of the model.
  • Model title (Title): The name displayed in the background, for example, "Article Model", "Product Model".
  • Model name (Name): The internal system name of the model, usually lowercase letters, may be used for internal identification or URL construction.
  • Model keywords (Keywords): Model-related keywords, can be used in Json-LD'skeywordsProperty.
  • Model introduction (Description): A brief description of the model, very suitable for use in Json-LD'sdescriptionProperty.
  • Model link (Link): The unified link pointing to the homepage or list page of the model, which can be used in Json-LDurlProperty.
  • Model table name (TableName): The database table name storing the model content.

By these fields, we can dynamically and flexibly inject information at the model level into the Json-LD structure, rather than manually writing it each time.

Third, tomoduleDetailIntegrated into the practice of Json-LD

AnQiCMS provided for us{% jsonLd %}Label, this is a very thoughtful feature. It allows us to embed JSON-LD JSON code directly in the template, and the system will automatically handle it<script type="application/ld+json">The package, more importantly, it can also intelligently merge the Json-LD we customize with the default Json-LD generated by the system, ensuring that the structured data output is complete and conflict-free.If the same named field exists, the custom content will override the system default value, which gives us great flexibility.

Now, let's look at a real example to see how to convertmoduleDetailwith the tag and{% jsonLd %}Combining tags to dynamically generate Json-LD data for a specific content model on a website. Assuming we have a content model named "product model", we want to display it in the product list page or detail page by usingWebSiteorOrganizationDeclare some general information about the model type.

"`twig {% Ld %} < script type

Related articles

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

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 the increasingly fierce 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 present richer search results and attract more users' attention.

2025-11-06

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

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

How to use the `archiveParams` tag to retrieve custom fields and include them in Json-LD?

As an experienced website operation expert, I am well aware of the importance of structured data in today's search engine optimization.Make good use of structured data, not only can it help search engines better understand your content, but also helps to get richer display opportunities in search results.AnQiCMS (AnQiCMS) is a powerful and flexible content management system that provides excellent support in this regard.

2025-11-06