Associating multiple images with a single tiddler

Hi. I would like to have certain of my tiddlers feature a gallery of images. I don’t want to:

  1. add images into my wiki directly
  2. create separate image tiddlers using the canonical_uri field
  3. store information in a separate data tiddler

Ideally, I could just create a comma-separated list of file names which would correspond to the files as they exist on my web server, and then filter this to output my gallery code.

I have thought about using the tags/list fields for this, as they are set up to handle multiple values, but perhaps they only work with Tiddler titles. I have also thought about listing the images with their paths in the tiddler and having a filter which extracts them and allows me to format them as needed.

None of these avenues seems to be bearing fruit. Perhaps it is against the “rules” to bring in a significant chunk of external content and have it be so loosely indexed?

Try this:

  1. First, create a tiddler field (e.g., images) containing a space-separated list of images. If the images are to be stored in a subfolder relative to the folder in which your TiddlyWiki file resides, then use relative URI references such as “images/picture1.jpg images/picture2.gif …” For images hosted online, provide the full URL reference for each image. If an image reference contains spaces, enclose that reference within doubled square brackets.
  2. To display these images in the same tiddler as the images list field, then you can write something like this to show them all:
<$list filter="[enlist{!!images}]"><img src=<<currentTiddler>> /></$list>

Notes:

  • Using this technique, there’s no need to create any other tiddlers to hold _canonical_uri references or a separate lists of images.

enjoy,
-e

8 Likes

So is it possible using a technique like this to provide the name of a folder and, assuming the folder only contains images, then all the file names are collected and then the images are displayed in a tiddler… I guess like diplaying images (files) in ‘File Explorer’ etc.

Many thanks,

@Ant Yes it’s possible, see Wiki farm — with WebDAV by saqimtiaz

2 Likes