I am using Frontmatter in connection with Hugo and wonder if it's possible to somehow use images as article image on the dashboard when they are defined in the resources section of the frontmatter.
I would expect the solution to show the image of the first resource (header.jpg). This can of course be "hacked" by adding an additional frontmatter item with the header image, but that would not be used in the theme at all and only for Frontmatter to look nice.
Page Resources is a fairly integral piece of Hugos page bundle system. This would have to check if the first item is an actual image though, because other media types could take that place.
I am using Frontmatter in connection with [Hugo](https://gohugo.io) and wonder if it's possible to somehow use images as article image on the dashboard when they are defined in the `resources` section of the frontmatter.
**frontmatter sample**
```yaml
---
...
resources:
- title: "caption"
id: "id1"
src: "header.jpg"
- title: "caption2"
id: "id2"
src: "header2.jpg"
---
```
I would expect the solution to show the image of the first resource (`header.jpg`). This can of course be "hacked" by adding an additional frontmatter item with the header image, but that would not be used in the theme at all and only for Frontmatter to look nice.
[Page Resources](https://gohugo.io/content-management/page-resources/#readout) is a fairly integral piece of Hugos page bundle system. This would have to check if the first item is an actual image though, because other media types could take that place.
<!-- github-sync-id:1174573277 -->
Hi @davidsneighbour did you define a block field for the resources metadata?
By default FM does not show or use resources, as you need to tell it what to render/use. That said, the block field allows you to re-use predefined fields to create list data. This would allow you to create the appropriate data for your theme.
Hi @davidsneighbour did you define a block field for the resources metadata?
By default FM does not show or use resources, as you need to tell it what to render/use. That said, the block field allows you to re-use predefined fields to create list data. This would allow you to create the appropriate data for your theme.
<!-- github-comment-id:1073294436 -->
I tried that but am still not able to get to what I want. The block field works nicely, but what I want to achieve is, that the article image, which is defined in the block is shown on the dashboard, not the website. Currently it shows the markdown symbol:
I will go through the field docs again and see what I misunderstand. Basically, isPreviewImage for my block would be nice ;)
I tried that but am still not able to get to what I want. The block field works nicely, but what I want to achieve is, that the article image, which is defined in the block is shown on the dashboard, not the website. Currently it shows the markdown symbol:

I will go through the field docs again and see what I misunderstand. Basically, [`isPreviewImage`](https://frontmatter.codes/docs/content-creation/fields#image) for my block would be nice ;)
The config in question is [here](https://github.com/davidsneighbour/kollitsch.de/blob/feat/frontmatter/frontmatter.json#L141).
I'll add to this issue when I am further.
<!-- github-comment-id:1079910415 -->
Changed the src field to type image and set it as the preview image.
The preview image for block fields is not yet supported, but I'll push a new update in a couple of minutes to have this supported as well.
In your case, what you have to do is update the `resources` field group as follows:
```json
{
"id": "resources",
"labelField": "src",
"fields": [
{
"title": "Path/Filename",
"name": "src",
"type": "image",
"isPreviewImage": true
},
{
"title": "Title",
"name": "title",
"type": "string",
"single": true
},
{
"title": "Name (Identifier)",
"name": "name",
"type": "string",
"single": true
}
]
}
```
> Changed the `src` field to type image and set it as the preview image.
<!-- github-comment-id:1080817484 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I am using Frontmatter in connection with Hugo and wonder if it's possible to somehow use images as article image on the dashboard when they are defined in the
resourcessection of the frontmatter.frontmatter sample
I would expect the solution to show the image of the first resource (
header.jpg). This can of course be "hacked" by adding an additional frontmatter item with the header image, but that would not be used in the theme at all and only for Frontmatter to look nice.Page Resources is a fairly integral piece of Hugos page bundle system. This would have to check if the first item is an actual image though, because other media types could take that place.
Hi @davidsneighbour did you define a block field for the resources metadata?
By default FM does not show or use resources, as you need to tell it what to render/use. That said, the block field allows you to re-use predefined fields to create list data. This would allow you to create the appropriate data for your theme.
I tried that but am still not able to get to what I want. The block field works nicely, but what I want to achieve is, that the article image, which is defined in the block is shown on the dashboard, not the website. Currently it shows the markdown symbol:
I will go through the field docs again and see what I misunderstand. Basically,
isPreviewImagefor my block would be nice ;)The config in question is here.
I'll add to this issue when I am further.
The preview image for block fields is not yet supported, but I'll push a new update in a couple of minutes to have this supported as well.
In your case, what you have to do is update the
resourcesfield group as follows:New beta version is available with this enhancement.
Perfectly working :) Thank you!