How to use a tiddler field as the source for an external image?

93 views
Skip to first unread message

Marcio Augusto

unread,
Jun 27, 2018, 10:35:41 AM6/27/18
to TiddlyWiki
Hi,

I am trying to get the source for an external image from a tiddler field.

After unsuccessfully testing both the img declaration ([img[source={!!myfield}}]) and the image widget (<$image source={{!!myfield}/>), I also tried using a macro to output those statements, or just to take the field and output the source, with no luck either.

Does anyone knows how to do this, or if it is possible at all?

Regards,
Marcio.

Jed Carty

unread,
Jun 27, 2018, 10:47:30 AM6/27/18
to TiddlyWiki
I couldn't get the img version to work but the image widget should work, you are missing a } in it.

<$image source={{!!my_field}}/>


I don't think that the img shorthand works with text references. This works


but not this

[img{!!my_field}]

Marcio Augusto

unread,
Jun 27, 2018, 12:09:18 PM6/27/18
to TiddlyWiki
Hi Jed,

Thanks a lot! I couldn't believe I overlooked this missing } all the time!

Regards,
Marcio.

Marcio Augusto

unread,
Jun 27, 2018, 3:01:09 PM6/27/18
to TiddlyWiki
Hi Jed,

Now I am trying to get the source from a combination of a path (output by a macro) and the tiddler field, again with no success testing many different approaches.

Would you have any tips on this?

Regards,
Marcio.

On Wednesday, June 27, 2018 at 11:47:30 AM UTC-3, Jed Carty wrote:

Jed Carty

unread,
Jun 27, 2018, 4:40:15 PM6/27/18
to TiddlyWiki
I wrote about concatenating strings here http://inmysocks.tiddlyspot.com/#Concatenating%20text%20to%20make%20dynamic%20URLs

It should cover what you need.

Marcio Augusto

unread,
Jun 27, 2018, 10:05:20 PM6/27/18
to TiddlyWiki
Jed,

Thank you very much, this was very helpful. I added your wiki to my bookmarks to check the rest of the stuff later.

It took some time, though, as I had a third macro which transforms the tiddler field, and I had to experiment for a while until I got it right.

Regards,
Marcio.

Mohammad

unread,
Jun 28, 2018, 12:00:11 AM6/28/18
to TiddlyWiki
Jed,
 I would like to thank you for your great work! This way you used to answer question we have
  •  working code
  •  documentation
  •  archive

I encourage other expert / advanced users / developer to use the same way. Having a tiddlyspot wiki and
answer the question there and give the link here.

/Mohammad
Reply all
Reply to author
Forward
0 new messages