Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
estruyf opened this issue Feb 18, 2022 · 10 comments
Closed

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

estruyf opened this issue Feb 18, 2022 · 10 comments
Projects

Comments

@estruyf
Copy link
Owner

estruyf commented Feb 18, 2022

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.

@kristofzerbe
Copy link

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"
        }        
      ]
    }
  ]

@estruyf
Copy link
Owner Author

estruyf commented Feb 18, 2022

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

@estruyf estruyf added this to In progress in 6.1.0 Feb 18, 2022
@estruyf estruyf added this to the 6.1.0 milestone Feb 18, 2022
@kristofzerbe
Copy link

Works ... Love it :)

image

@estruyf
Copy link
Owner Author

estruyf commented Feb 19, 2022

Thanks 🙏

@estruyf estruyf closed this as completed Feb 19, 2022
6.1.0 automation moved this from In progress to Done Feb 19, 2022
@estruyf estruyf mentioned this issue Feb 28, 2022
@kristofzerbe
Copy link

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

@estruyf
Copy link
Owner Author

estruyf commented Mar 17, 2022

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

@kristofzerbe
Copy link

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...

@estruyf estruyf reopened this Mar 17, 2022
6.1.0 automation moved this from Done to In progress Mar 17, 2022
@estruyf estruyf removed this from In progress in 6.1.0 Mar 17, 2022
@estruyf estruyf added this to In progress in v7.0.0 Mar 17, 2022
@estruyf estruyf removed this from the 6.1.0 milestone Mar 17, 2022
estruyf added a commit that referenced this issue Mar 17, 2022
@estruyf
Copy link
Owner Author

estruyf commented Mar 17, 2022

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

@kristofzerbe
Copy link

Works like a charm ... thank you Elio

@estruyf
Copy link
Owner Author

estruyf commented Mar 17, 2022

Thank you for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants