Dataview render table with images containing internal links

Hello everyone,

i’m using this method to display an image and add a link to it.
When i click the image it will take me to the linked note.
[![[Newworld-20230730-1.png]]](Newworld=Name of the Note) ← This renders and works.

I’m also using this dataview query from Create a movie database - Minimal Documentation to display render a table with those images.

table without id
image as Image, 	file.link as Title
from #🎮GAMES
where image != null

Now i would like to click on the image to get to the linked note using this image: "[![[Newworld-20230730-1.png]]](Newworld)"

However the result looks like this and the image won’t render anymore but the link works.
image

Do you have any suggestions?

Hi Kani,

I have been doing something similar to achieve rendered images bound to links. This method still has some limitations when using Obsidian on a mobile device that I have yet to overcome but the approach works well for Obsidian desktop (tested on OSX, untested on Windows).

The solution is to use only markdown links not Wiki links or combinations of both. The correct syntax is :

"[![ {alt-text} | {image-size} ]( {full-path-to-image} )]( {linked-note-name} )"

  • Text must be double quoted in order for dataview to parse.
  • Image file must be a fully qualified path, relative paths won’t work.
  • Any spaces in pathnames must be replaced with ‘%20’
  • The note to link can be just named or referenced relatively. If you use fully qualified file paths here then the file opens in the default application associated with .md files - which for me opens vscode!
  • Web Images can be used instead of local image files by quoting the web url to the image instead of the fully qualified local path.

Using your example the syntax would be :

"[![Newworld|500](file:///full/path/to/image/file/location/Newworld-20230730-1.png)](Name of the Note)"

It would be helpful if anyone can offer any insight as to why the embedded markdown link has to be fully qualified whereas the outer markdown link can be relatively addressed?

2 Likes

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