How to add multiple image URLs in Json-LD, such as the thumbnail list of an article?

Calendar 👁️ 56

As an experienced website operations expert, I am happy to give you a detailed explanation of how to cleverly integrate the URLs of multiple thumbnails of articles into Json-LD data in AnQiCMS, thereby improving the search engine performance and user experience of the website.


Use AnQi CMS effectively: Efficiently integrate multiple image URLs in Json-LD to enhance the visual appeal and search engine performance of articles

In today's increasingly intense content marketing environment, it is crucial to make search engines better understand and display your content.Json-LD as a recommended structured data format can help search engines deeply understand page content, thereby improving the display effect in search results, such as obtaining eye-catching rich media summaries (Rich Snippets).For an article containing multiple images, accurately presenting the image URLs in Json-LD not only allows search engines to understand the visual richness of the content, but may also result in better display in image searches or specific scenarios.

The Json-LD basics and flexibility of AnQi CMS

AnQiCMS takes full consideration of SEO-friendliness in its design. By default, it will automatically generate basic Json-LD structured data for your page, which usually includes article title, publish date, description, and a thumbnail image.This lays a good SEO foundation for your website.

However, when our article content is far more than just a picture, the default Json-LD may not fully reflect its richness.For example, an article about product reviews may show multiple angles of the product, or a travel guide may include high-definition photos of multiple attractions.In this case, we hope to have Json-LD in theimageThe attribute can contain a list of URLs of multiple images, not just one.

AnQiCMS provides high flexibility for this, through built-in{% jsonLd %}Label, you can easily supplement or override the default generated Json-LD.This tag allows you to directly define or modify the Json-LD content in the template, AnQiCMS will automatically merge the part you define with the part generated by the system by default.If your custom field conflicts with the default field, the custom field will take precedence and display first, which provides a perfect entry for us to integrate multiple images.

Get a list of multiple thumbnails of the article

In AnQiCMS, multiple images of articles, products, or pages are usually stored in the content model'sImageswithin the field. For example, when you upload multiple images as cover group images while editing an article in the background, the URLs of these images will be collected in the article'sImagesthe attribute.

We can use template tags provided by AnQiCMS, such as{% archiveDetail %}(for articles),{% pageDetail %}(for single pages) or{% categoryDetail %}(Used for classification), to conveniently obtain these image lists. These tags are calledname="Images"and will return an array containing all image URLs.

For example, the code snippet to get the image list of an article may look like this:

{% archiveDetail archiveImages with name="Images" %}
{% for item in archiveImages %}
  {# 这里的 {{item}} 就是每张图片的URL #}
  <img src="{{item}}" alt=""/>
{% endfor %}
{% endarchiveDetail %}

ThisarchiveImagesNow it is an array containing all the image URLs of the article, each one{{item}}represents the complete path of an image.

Build multi-image Json-LD code: practical steps

Understood the custom mechanism of Json-LD and how to get the list of article images. The next step is to combine both of them. Json-LD'simageThe property, when it is an array, is usually expected to be a string array consisting of image URLs.

We will utilize{% jsonLd %}Label, and build one that conforms to the Schema.org standardimageArray. Specific steps and code examples are as follows:

  1. Find the appropriate position in the article detail template:Usually, Json-LD scripts are placed in the page<head>tag within, or follow<body>the tag afterward.

  2. Use{% jsonLd %}encapsulate your custom Json-LD:

    {% jsonLd %}
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Article",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "{% archiveDetail with name="Link" %}"
      },
      "headline": "{% archiveDetail with name="Title" %}",
      "image": [
        {% archiveDetail articleImages with name="Images" %}
        {% for item in articleImages %}
          "{{item}}"{% if not forloop.Last %},{% endif %}
        {% endfor %}
        {% endarchiveDetail %}
      ],
      "datePublished": "{{stampToDate(archive.CreatedTime, "2006-01-02T15:04:05+08:00")}}",
      "dateModified": "{{stampToDate(archive.UpdatedTime, "2006-01-02T15:04:05+08: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": "{% archiveDetail with name="Description" %}"
    }
    </script>
    {% endjsonLd %}
    

    Code analysis:

    • "image": [:Here, we explicitly declareimageThe property will be a JSON array.
    • {% archiveDetail articleImages with name="Images" %}We usearchiveDetailTags, to assign theImagesField content toarticleImagesVariable.
    • {% for item in articleImages %}: We traversearticleImagesarray,{{item}}Represent a picture URL in each loop.
    • "{{item}}"{% if not forloop.Last %},{% endif %}This is crucial. We enclose each image URL in double quotes to make it a valid JSON string.`{% if not forloop.Last %

Related articles

How to dynamically fill the `author` and `datePublished` fields in the Json-LD of AnQiCMS article page?

As an experienced website operation expert, I fully understand that in the current context where content marketing and search engine optimization (SEO) are increasingly important, it is crucial to effectively convey the core information of the page content to search engines.AnQiCMS (AnQiCMS) is an enterprise-level content management system developed based on the Go language, which provides us with great convenience with its efficient and customizable features.

2025-11-06

If a custom Json-LD field conflicts with the default field generated by AnQiCMS, which one will be displayed first?

In today's highly competitive online environment, structured data (JSON-LD) has become a key factor for website content to stand out in search engines.It can help search engines better understand the content of the page, thus giving it the opportunity to have richer display effects in the search results, which is what we commonly call 'rich media abstracts'.For a content management system like AnQiCMS (AnQiCMS) that focuses on SEO optimization, the built-in JSON-LD generation function undoubtedly provides great convenience to users.

2025-11-06

What is the basic syntax structure of custom Json-LD tags in AnQiCMS?

## Custom Json-LD tags in AnQi CMS: Master the Core Tool for Structured Data Optimization In today's digital marketing environment, Search Engine Optimization (SEO) is no longer just about keyword stuffing, but more about focusing on content quality and the presentation of structured data.AnQiCMS (AnQiCMS) is an enterprise-level content management system developed in Go language, which attaches importance to SEO-friendliness and knows the importance of structured data.

2025-11-06

The Json-LD custom call tag `{% Ld %}` should be placed at which position in the template?

In AnQi CMS, where should the Json-LD custom call tag `{% Ld %}` be placed in the template?In today's digital marketing era, the importance of Search Engine Optimization (SEO) is self-evident.And structured data, especially Json-LD, is one of the powerful tools to improve the visibility of websites in search results.AnQi CMS is an efficient system designed for enterprise-level content management and SEO optimization, naturally providing comprehensive Json-LD support.

2025-11-06

How to integrate the page's SEO title, keywords, and description into Json-LD using the `tdk` tag of AnQiCMS?

In today's highly competitive internet environment, Search Engine Optimization (SEO) is no longer an optional choice, but the foundation of website success.For systems like AnQiCMS, which are specifically designed for enterprise-level content management and SEO optimization, the various tools provided are aimed at helping operators stand out in search results.

2025-11-06

Does the Json-LD custom tag support dynamic retrieval of the website name and Logo from the `system` tag?

As an experienced website operations expert, I fully understand the importance of search engine optimization (SEO) in today's context, and structured data, especially Json-LD, is undoubtedly the key to improving the understandability and search ranking visibility of website content.Today, let's delve deeply into a common issue encountered by AnQiCMS (AnQiCMS) users: **Does the Json-LD custom tag support dynamic retrieval of the website name and Logo from the `system` tag?

2025-11-06

How to create a `Product` type Json-LD structured data for AnQiCMS product detail page?

AnQiCMS (AnQiCMS) is an efficient enterprise-level content management system that not only provides powerful content publishing and management functions, but also has done a lot of work in SEO optimization.For e-commerce websites or businesses with product display needs, how to make search engines better understand and display your products, and achieve higher click-through rates and conversion rates, is the key to operating success.In this, Json-LD structured data, especially the `Product` type, plays an indispensable role.

2025-11-06

How to dynamically reference the `contact` tag in Json-LD (such as phone, address)?

In today's highly competitive online environment, every detail of a website can affect its performance in search engines.As an experienced website operations expert, I am well aware of the key role that structured data plays in enhancing website visibility, and Json-LD, as a format recommended by search engines like Google, is of utmost importance.In particular for corporate websites, how to accurately and dynamically display a company's contact information to search engines, such as phone numbers and addresses, can not only enhance local search visibility but also greatly increase user trust.

2025-11-06