Transclude File Path - One File Path for all Images

Hi there,

I already spent too much time for a very simple problem: I want to transclude one file path for all my linked images so that when I change the location of the folder with my images, I only have to change the file path once. This is what I have:

I have one tiddler with the title assetsfilepath containing the text ./_assets which represent the file path to my assets (images, pdfs, etc.).

In a new tiddler, I want to display an image using something like this
[img[{{assetsfilepath}}/MyImage.jpg]]
because I obviously would like to create this
[img[./_assets/MyImage.jpg]]
but it does not work.

I tried to learn from @EricShulman in this post but I cannot figure it out.
How can I solve this problem? Alternative solutions to my approach are very welcome :innocent:

1 Like

Hi @TiddlyPatrick
I suggested an answer in your previous post, but maybe I’m missing something obvious.
An image path can be set up and only needs changing in one config file.
See Tobias Beer’s example.
https://tobibeer.github.io/tb5/#External%20Image%20Path

2 Likes

Oh yes, I missed your post, @Scot. My fault :grimacing: this is what I was looking for.

It works beautifully! :raised_hands: Thank you!

@TiddlyPatrick
Glad it worked

$ _macros_ximg_path(1).json (416 Bytes)
$ _macros_ximg.json (706 Bytes)
<<ximg "some image.gif">>

1 Like