tw5 - Field value as image url ?

560 views
Skip to first unread message

Måns

unread,
Apr 24, 2014, 5:17:37 AM4/24/14
to tiddl...@googlegroups.com
Hi TwWizards

I'm trying to do sth like this: [img[{{!!title}}|{{!!image}}]] where image is a custom field value... However it doesn't work... (I'm using TW5 5.0.10-beta)

I also tried to input the fieldvalue (an external image url) into the icon via the TagManager - which doesn't work either...

Should I expect something like this to be possible in the near future?

Cheers Måns Mårtensson

Jeremy Ruston

unread,
Apr 24, 2014, 5:30:03 AM4/24/14
to TiddlyWiki
Hi Måns

I'm trying to do sth like this: [img[{{!!title}}|{{!!image}}]] where image is a custom field value... However it doesn't work... (I'm using TW5 5.0.10-beta)

To do this you need to use the raw <$image> widget:

<$image source={{!!image}} tooltip={{!!title}}/>


Best wishes

Jeremy



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Måns

unread,
Apr 26, 2014, 1:55:25 PM4/26/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy

Thank you.

Are there any plans to let the icon field value accept/use external images (via URLs http or file)?

eg. icon: http://somedomain.com/someimage.png

Cheers Måns Mårtensson

Jeremy Ruston

unread,
Apr 27, 2014, 11:14:54 AM4/27/14
to Måns, TiddlyWiki
Hi Måns

Are there any plans to let the icon field value accept/use external images (via URLs http or file)?


At the moment, the templates use transclusion for the icon:


We could switch it to use the <$image> widget instead, which does understand how to embed remote image URIs. However, the <$image> widget can't display images that are actually wikitext tiddlers containing SVG tags (eg, $:/core/images/delete-button).

So, as things stand we have a tradeoff:

* Stick with transclusion, allowing us to use images and wikitext images
* Switch to the image widget, losing the ability to use wikitext images

There is a workaround, though: create a "stub" tiddler representing the remote image, with the text containing a reference to the remote image (eg `[img[http://blah.com/blah.jpg]]`. If you give it the tag $:/tags/Image then it will be recognised by the tag manager as an image and included in the image dropdowns.

Best wishes

Jeremy

Måns

unread,
Apr 27, 2014, 12:31:52 PM4/27/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy

Thank you very much!

That was a very neat trick :-)

Now I have one up my sleeve too :-):

I made a template tiddler "TitleImageTemplate" tagged it with $:/tags/Image and wrote this text: "<$image source={{!!image}} tooltip={{!!title}}/>".

This seems to work just how I wanted it to work! (in Chrome - haven't tested other browsers yet..) - except I still have to choose the icon manually for all tiddlers which should use the template.

Next thing I'd like to do is to make it work on all tiddlers tagged with e.g. "teacher"...

Cheers Måns Mårtensson  



Den torsdag den 24. april 2014 11.30.03 UTC+2 skrev Jeremy Ruston:
Reply all
Reply to author
Forward
0 new messages