Embed image with ´$=dv´

What I’m trying to do

I want to embed a image from file automatically, but it seem it isnt working

Things I have tried

$=dv.fileLink(dv.page(dv.current().x).img, true)

these two just show the name of the image in a paragraph


this make a link to the image but it doesent embed

thank you for the help

This thread has some pointers to the most reliable way of embedding images.

1 Like

oh thanks, i used you code to do
$=dv.span('<img src="' + app.vault.getResourcePath(dv.fileLink(dv.page(dv.current().x).img)) + '" />')
but i couldnt find a way to resize the image, do you know how can i do it?

At this point it’s an ordinary <img> so you could use attributes and styles, and what ever you like.

1 Like

thanks man

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