Publish an image in my note using its URL from the Frontmatter

Things I have tried

I have looked up the forums here and there, but found nothing satisfying.

What I’m trying to do

Please continue below this line. →
I have the URL to a picture (a book cover) in my frontmatter.
I would like to use this link in an automated fashion, to publish the picture in the body of my note, without having to manually copy the link each time.
Since it is only one element I want to publish, I’m not sure a dataview table is the best way to achieve this.
I’m sorry if this question sounds stupid, but I’m fairly new to Obsidian…Thank you for your help !

2 Likes

You need to give us more precise info (to avoid “ifs” or misreading)… something like:

  • the format (syntax) of your field in frontmatter;

By “publish” you mean “see the image in the outputted rendered note”?

My frontmatter looks something like this :
Example FrontMatter
I would like to be able to retrieve the info (URL) on the image contained in the frontmatter to make the image visible in the outputted rendered note, yes.
I guess dataview serves that purpose, but creating a table for just one element seems strange to me.

First point: your link is a real link to an image?
If yes, you can use this inline code instead of a table query

`="![im](" + this.cover + ")"`

(“im” is the displayed name… you can choose any… but in embeds you don’t see it)

If you want to control the size of the image:

`="![im|300](" + this.cover + ")"`

(play with the width value)

1 Like

That works just fine !
Thank you very much !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.