Enhancement: Allow using preview images on multi-dimensional fields #205

Closed
opened 2026-10-05 02:33:23 +02:00 by adam · 10 comments
Owner

Related to this comment: https://www.eliostruyf.com/generate-open-graph-preview-image-code-front-matter/#comment-5744727905

This is what I thought too, but it seems that it doesn't work with the new subfields, regarding to https://github.com/estruyf/....

I tried among others (see GitHub issue) following taxonomy:

  • fields
    ...
  • title: photograph
  • name: photograph
  • type: fields
    ...
  • title: Social Media
  • name: socialmedia
  • type: image
  • isPreviewImage: true

But the image doesn't show up in the dashboard.

Related to this comment: https://www.eliostruyf.com/generate-open-graph-preview-image-code-front-matter/#comment-5744727905 This is what I thought too, but it seems that it doesn't work with the new subfields, regarding to [https://github.com/estruyf/...](https://disq.us/url?url=https%3A%2F%2Fgithub.com%2Festruyf%2Fvscode-front-matter%2Fissues%2F197%3AcS70Cxu1Tx9eZwwU_jfLV99Us8o&cuid=3638036). I tried among others (see GitHub issue) following taxonomy: - fields ... - title: photograph - name: photograph - type: fields ... - title: Social Media - name: socialmedia - type: image - isPreviewImage: true But the image doesn't show up in the dashboard. <!-- github-sync-id:1143466847 -->
adam closed this issue 2026-10-05 02:33:23 +02:00
Author
Owner

Here's my (little bit stripped) taxonomy with the social media image in a subfield, which doesn't work as a preview image on the dashboard via isPreviewImage:

  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string",
          "single": true
        },
        {
          "title": "Photograph",
          "name": "photograph",
          "type": "fields",
          "fields": [
            {
              "title": "File",
              "name": "file",
              "type": "string",
              "single": true
            },
            {
              "title": "Name",
              "name": "name",
              "type": "string",
              "single": true
            },
            {
              "title": "Social Media",
              "name": "socialmedia",
              "type": "image",
              "isPreviewImage": true
            }
          ]    
        },
        {
          "title": "Categories",
          "name": "categories",
          "type": "categories"
        },
        {
          "title": "Tags",
          "name": "tags",
          "type": "tags"
        },
        {
          "title": "Hidden",
          "name": "hidden",
          "type": "draft"
        }        
      ]
    }
  ]

Here's my (little bit stripped) taxonomy with the social media image in a subfield, which doesn't work as a preview image on the dashboard via ``isPreviewImage``: ``` "frontMatter.taxonomy.contentTypes": [ { "name": "default", "pageBundle": false, "fields": [ { "title": "Title", "name": "title", "type": "string", "single": true }, { "title": "Photograph", "name": "photograph", "type": "fields", "fields": [ { "title": "File", "name": "file", "type": "string", "single": true }, { "title": "Name", "name": "name", "type": "string", "single": true }, { "title": "Social Media", "name": "socialmedia", "type": "image", "isPreviewImage": true } ] }, { "title": "Categories", "name": "categories", "type": "categories" }, { "title": "Tags", "name": "tags", "type": "tags" }, { "title": "Hidden", "name": "hidden", "type": "draft" } ] } ] ``` <!-- github-comment-id:1044956557 -->
Author
Owner

@kristofzerbe enhanced the data processor and this should now be supported in the latest beta.

@kristofzerbe enhanced the data processor and this should now be supported in the latest beta. <!-- github-comment-id:1045063916 -->
Author
Owner

Works ... Love it :)

image

Works ... Love it :) ![image](https://user-images.githubusercontent.com/243113/154782595-945d2574-a0d2-4f26-bd6f-583157799224.png) <!-- github-comment-id:1045586866 -->
Author
Owner

Thanks 🙏

Thanks 🙏 <!-- github-comment-id:1045975703 -->
Author
Owner

The feature works now in the v6.1.1 release of Front matter, but not in the current Beta v7.0.1994549 !?

The feature works now in the v6.1.1 release of Front matter, but not in the current Beta v7.0.1994549 !? <!-- github-comment-id:1070808395 -->
Author
Owner

@kristofzerbe where do you store the images? In a public/static folder?

@kristofzerbe where do you store the images? In a public/static folder? <!-- github-comment-id:1070813775 -->
Author
Owner

A static one, defined in my taxonomy as described above, in the field PHOTOGRAPH > SOCIALMEDIA. Here's the Frontmatter of an article:

slug: lorem-ipsum
title: "Lorem Ipsum"
date: 2022-03-11 09:28:10
photograph:
  file: my-image.jpg
  name: My Image
  socialmedia: /static/images/social-media/lorem-ipsum.png

As I said, worked in the beta and now in release, but not in the beta from yesterday...

A static one, defined in my taxonomy as described above, in the field PHOTOGRAPH > SOCIALMEDIA. Here's the Frontmatter of an article: ``` slug: lorem-ipsum title: "Lorem Ipsum" date: 2022-03-11 09:28:10 photograph: file: my-image.jpg name: My Image socialmedia: /static/images/social-media/lorem-ipsum.png ``` As I said, worked in the beta and now in release, but not in the beta from yesterday... <!-- github-comment-id:1070831875 -->
Author
Owner

🤦‍♂️ found the issue, fix is coming up right now

🤦‍♂️ found the issue, fix is coming up right now <!-- github-comment-id:1071018507 -->
Author
Owner

Works like a charm ... thank you Elio

Works like a charm ... thank you Elio <!-- github-comment-id:1071036572 -->
Author
Owner

Thank you for reporting this!

Thank you for reporting this! <!-- github-comment-id:1071038940 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#205