Hi All!
Is it possible to make query in Dataview to show all image files in some folder with their thumbnails? Something like Select * from 'folder'
Hi All!
Is it possible to make query in Dataview to show all image files in some folder with their thumbnails? Something like Select * from 'folder'
Hi.
‘Dataview operates on metadata in your Markdown files. It cannot read everything in your vault, but only specific data.’ So if you want to index images, they need to be referenced from markdown files.
```dataview
TABLE
embed(link(meta(image).path, "150")) AS "Thumbnail"
```
Thanks! So I can’t use Dataview to query image files? Only .md files?
Is there any way to query all image thumbnails in some folder? Maybe javascript?
You can use dataviewjs to reference any file in your vault, but you need to use a little coding to do so. It’s then also possible to filter your file at on folder or other criteria.
Using a pure dataiew query you do need to get them referenced using links or similar stuff.
Could you help me with js script or give a reference to smth like my query? I’m not familiar with js. Only python and little java. Thanks in advance
From this link:
```dataviewjs
const jpgFiles = app.vault.getFiles().filter(file => file.extension === 'jpg')
jpgFiles.forEach(file => dv.paragraph(`![[${file.path}]]`))
```
My final solution:
```dataviewjs
const imgFiles = app.vault.getFiles().filter(file => file.path.includes('_files folder')).sort((a, b) => a.name.localeCompare(b.name))
// imgFiles.forEach(file => dv.paragraph(file.name))
imgFiles.forEach(file => dv.paragraph(`![[${file.path}]]`))
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.