[tw5] How to display an image from a data tiddler ?

Hello everyone,

I’m searching how to display an image whose name is a value in a tiddler data, but all my attempts do not succeed.

I’m probably not using the right syntax… or what I want to do is not possible?
Can you help me?

I use two tiddlers:

A data tiddler (BD-Test1) which contains:

Image: test.jpg
Fullimage: ./files/test.jpg
Value1: No
Value2 : Yes

A second tiddler (Defail-Test1) which contains:

<$tiddler tiddler={{{ [is[current]removeprefix[Detail]addprefix[BD]] }}} >

[img [./files/{{##Image}}]]

[img [{{##Fullimage}}]]

!!Print values :

*Value1: {{##Value1}}
*Value2 : {{##Value2}}
</$tiddler>

[img [./files/test.jpg]]

In advance, thanks for your help.

Arnaud


Unfortunately, you can't paste the image link wikitext together with the transclusion text that way.

What you can do is define a macro to do the pasting. If this were at the top of your tiddler:

\define image-there(name) [img [./files/$name$]]

(don't include the backticks)

then when you want the image you could invoke via the macrocall widget:

<$macrocall $name="image-there" name={{##Image}}/>

Thank you very much Mark! Your solution is exactly what I need.