As an experienced website operations expert, I am well aware of the crucial role of structured data (Structured Data) in modern search engine optimization (SEO).It is like a 'resume' of your website content, directly telling search engines what your page is about and what key information it contains.While Json-LD is a recommended structured data format, its@typeThe correct setting of properties is also the core to ensure that search engines can accurately understand the content of your page. Today, let's delve into how to efficiently and accurately configure Json-LD for different page types in AnQiCMS.@typeProperty.

Ensure that the CMS different pages Json-LD is secure@typeA practical guide to proper settings

In the vast sea of content on the Internet, search engines have to process a massive amount of information every day.In order to better understand and present web content, they need us to provide clear, standardized 'prompts'.Json-LD is a hinting mechanism that presents the key information of a page in a structured way to search engines, thereby potentially enabling richer search results display (Rich Snippets), such as the publication date of articles, product price reviews, event locations and times, etc., all of which can greatly enhance the click-through rate and user experience of the website.

The core of Json-LD lies in@typeProperty. This property is like attaching an accurate "label" to your page content, telling the search engine what type of entity the page represents.Is it a news article? Is it product information? Or is it our introduction page? Different@typeGuide search engines to interpret and index your content in a different way. Incorrect.@typeSetting may not only make your structured data invalid, but may also mislead search engines, affecting the SEO performance of your website.


I. How AnQi CMS helps with structured data deployment

AnQi CMS was designed with SEO needs in mind from the beginning, providing a series of advanced SEO tools and flexible content management features, including support for Json-LD.AnQiCMS through its powerful template engine allows you to easily manage structured data while maintaining flexibility and customizability.

here,{% jsonLd %}This unique template tag plays a key role. It allows you to customize Json-LD code on the page and intelligently merge it with the structured data generated by the system by default.This means, you can keep the basic information automatically filled in by the system, and supplement or overwrite specific fields according to specific needs.When we discuss different page types@typeWhen setting, the flexibility of this label will be our helpful assistant.


Secondly, set for different page types@typepractical strategy

The 'Flexible Content Model' feature of AnQi CMS allows us to define various content types such as articles, products, and single pages according to business needs. It is based on these content models and page types that we can accurately set up Json-LD's@type.

1. Article detail page (for example: blog post, press release)

The most common content published under the 'article model', such as blog posts, press releases, technical tutorials, etc.@typeSelect yesArticleor more specificBlogPosting/NewsArticle.

  • Recommended@type: Article,BlogPosting,NewsArticle

  • How to set:In the template file corresponding to the article detail page (usually){模型table}/detail.htmlIn it, you can use{% jsonLd %}Tag to define or modify Json-LD. Anqi CMS'sarchiveDetailTags(tag-/anqiapi-archive/142.html)It can easily obtain various details of the current article.

    {% jsonLd %}
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "BlogPosting", {# 明确指定为博客文章类型 #}
      "headline": "{{archive.Title}}", {# 使用文档标题 #}
      "image": "{{archive.Logo}}", {# 使用文档封面图 #}
      "datePublished": "{{stampToDate(archive.CreatedTime, "2006-01-02T15:04:05Z07:00")}}", {# 发布时间 #}
      "dateModified": "{{stampToDate(archive.UpdatedTime, "2006-01-02T15:04:05Z07:00")}}", {# 修改时间 #}
      "author": {
        "@type": "Person",
        "name": "{% system with name='SiteName' %}" {# 作者可以是网站名称或具体人名 #}
      },
      "publisher": {
        "@type": "Organization",
        "name": "{% system with name='SiteName' %}",
        "logo": {
          "@type": "ImageObject",
          "url": "{% system with name='SiteLogo' %}"
        }
      },
      "description": "{{archive.Description}}" {# 文档描述 #}
    }
    </script>
    {% endjsonLd %}
    

    Here we utilize{{archive.Title}}/{{archive.Logo}}Variable dynamically fill in article data and usestampToDateThe filter formats timestamps into ISO 8601 standard format, which is a common requirement for time fields in Json-LD.

2. Product Details Page

If your page is displaying specific products or services, for example, the content under "Product Model", thenProductThe type is your best choice. It can include price, stock, brand, reviews, and other rich information.

  • Recommended@type: Product

  • How to set:Similarly, in the product details page template, usingarchiveDetailLabel to get product data. The 'Content Model Custom Field' feature of AnQi CMS (help-content-module.md)Allow you to add specific fields such as “brand”, “SKU”, etc. This information can be retrieved and filled into Json-LD.archiveParamsTags(tag-/anqiapi-archive/146.html)Get and fill in the information to Json-LD.

    ”`twig {% Ld %}