As an experienced website operations expert, I know the key role of structured data in improving the search engine performance of a website.AnQiCMS (AnQiCMS) has always paid great attention to SEO-friendliness from the beginning of its design. Its flexible template system and tag mechanism provide us with a wide space for in-depth optimization of website content.pageDetailStructured data?”}]

The answer is affirmative, and AnQi CMS provides{% jsonLd %}tags, making this process extremely flexible and powerful.

AnQi CMS overview of support for structured data

In today's highly competitive online environment, the importance of Search Engine Optimization (SEO) is self-evident.Structured data, as a standardized way for search engines to understand web content, can help our website obtain richer search result displays (Rich Snippets), thereby attracting more clicks.

A Quiet CMS has taken full consideration of SEO-friendliness from the beginning of its design, providing many built-in SEO tools.In order to handle structured data, the AnQiCMS system is inherently equipped with the basic capability to generate structured data.<script>A label that contains some basic information about the page, such as the title, description, etc. This out-of-the-box feature is sufficient for most websites.

However, for those who wish to have more fine-grained control over structured data, or need to apply more specific schema types for specific page types (such as single-page, product detail pages, etc., such asAboutPage/ContactPageorFAQPageFor the operator, AnQi CMS provides a more advanced customization method.

Core answer: The combination of Json-LD tags with single-page websites

For single-page pages (pageDetailThis is the specific requirement of generating structured data, my answer is:Absolutely, and Anqi CMS provides a very convenient custom tag for this.{% jsonLd %}.

This tag allows us to place it anywhere in the template (usually recommended to be placed in the<head>Embed customized Json-LD structured data within. Its strength lies in the fact that you can{% jsonLd %}and{% endjsonLd %}between, write any Json-LD content that conforms to the Schema.org specification.

Moreover, if you use it in the template,{% jsonLd %}Label, and it contains fields that conflict with the system-generated Json-LD, the content you customize willoverrideThe default value.This means you have absolute control over the structured data of the page, and can accurately describe its semantics based on the specific content of a single page (such as the "About Us" page, contact information page, etc.)

in a single page (pageDetail) Obtain data to fill Json-LD

To dynamically present single-page data in Json-LD, we need to use the templates provided in AnQiCMSpageDetail.pageDetailLabels can conveniently obtain various information of the current single page, such as:

  • Id: Single page ID
  • Title: Single page title
  • Link: Single Page Link
  • Description: Single Page Overview
  • ContentSingle page content
  • LogoSingle page thumbnail large image
  • ThumbSingle page thumbnail
  • Images: Single-page slideshow group image

We can embed these throughpageDetailthe data obtained by the tag, ingeniously into{% jsonLd %}the JSON structure within the tag.

For example, if we have a single-page "About Us", and we want to mark it withWebPageorAboutPageof the Schema type, we can write the template like this:

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebPage", {# 或者使用 AboutPage, ContactPage 等更具体的类型 #}
  "headline": "{% pageDetail with name='Title' %}",
  "description": "{% pageDetail with name='Description' %}",
  "url": "{% system with name='BaseUrl' %}{% pageDetail with name='Link' %}",
  {%- pageDetail pageImages with name="Images" %}
  "image": [
    {%- for img in pageImages -%}
    "{{ img }}"{% if not forloop.Last %},{% endif %} {# 动态获取多张图片 #}
    {%- endfor -%}
  ],
  {%- endpageDetail %}
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "{% system with name='BaseUrl' %}{% pageDetail with name='Link' %}"
  },
  "datePublished": "{{ stampToDate(page.CreatedTime, "2006-01-02T15:04:05+08:00") }}", {# 假设单页面有创建时间 #}
  "dateModified": "{{ stampToDate(page.UpdatedTime, "2006-01-02T15:04:05+08:00") }}"  {# 假设单页面有更新时间 #}
  {# 你还可以添加更多自定义字段,例如作者信息、联系方式等 #}
}
</script>
{% endjsonLd %}

In the above example, we make use ofpageDetailThe tag dynamically extracts the title, description, link, and image list of a single page and fills them into the Json-LD structure.{% system with name='BaseUrl' %}Then tag