[TW5] Picture as external link in wiki text, how?

273 views
Skip to first unread message

Siniy-Kit

unread,
Oct 14, 2015, 9:44:23 AM10/14/15
to tiddl...@googlegroups.com
Hi!
We can make external link [ext[tw|tiddlywiki.com]] and image [img[tooltip|example.jpg]] . How can we combine them to make clickable picture as external (or internal) link? Now I use html for it. 

Mat

unread,
Oct 14, 2015, 5:10:18 PM10/14/15
to TiddlyWiki
Maybe Tobias' linkimg macro is sufficient for you?

<:-)

Tobias Beer

unread,
Oct 15, 2015, 6:02:47 AM10/15/15
to tiddl...@googlegroups.com
Hi Mat

Thanks for remembering...


Maybe Tobias' linkimg macro is sufficient for you?
 
When I read this post I didn't think of it, mhhh.
Guess I need to reed my own stuff more. :D

Best wishes,

— tb

Scott Simmons

unread,
Oct 16, 2015, 9:15:48 PM10/16/15
to TiddlyWiki
On Wednesday, October 14, 2015 at 9:44:23 AM UTC-4, Siniy-Kit wrote:
Hi!
We can make external link [ext[tw|tiddlywiki.com]] and image [img[tooltip|example.jpg]] . How can we combine them to make clickable picture as external (or internal) link? Now I use html for it. 

I've just begun diving into TW5 in earnest, and this does seem to be an odd blind spot.  Is there a reason it's not native to the TW5 markup?  (Some conflict or a plan to do more with it in the future on Jeremy's roadmap?)

Tobias Beer

unread,
Oct 16, 2015, 9:30:53 PM10/16/15
to tiddl...@googlegroups.com
Hi Scott,
 
I've just begun diving into TW5 in earnest, and this does seem to be an odd blind spot.  Is there a reason it's not native to the TW5 markup?  (Some conflict or a plan to do more with it in the future on Jeremy's roadmap?)

I imagine it's less of a blind spot than it is perhaps a desire to promote using macros.
Otherwise, a pull request with the desired behavior might just have images back up linking.

Personally, I find this to be more of a very welcome feature than a burden:

<a href="#Jack.jpg">[img[Jack.jpg]]<a>

or then...

<a href="#Jack.jpg"><img src="Jack.jpg"/><a>

...if it was an actual image on the filesystem.

Best wishes,

— tb 

Scott Simmons

unread,
Oct 16, 2015, 10:16:20 PM10/16/15
to TiddlyWiki
I find myself typing:

<$link to="Jack.jpg">[img[Jack.jpg]]</$link>

... to link a tiddler.

Or:

<a href="../Jack.jpg">[img|Jack.jpg]]</a>

... to link to a file.

But the lack of consistency does have me tripping over my feet a bit as I try to acclimate to TW5.

I can see where the markup doesn't have an elegant solution, but I'd think that particular case (an image wrapped in a link) would come up often enough that it fairly demanded either a shorthand or the elimination of the two usual shorthands Siniy-Kit detailed above.

I wouldn't mind retiring the shorthand altogether if using the full macro call means better tiddler content that's were more futureproof — but since many of my tiddlers contained (and will contain) linked images, I find myself tripping over the two different styles of syntax.

Tobias Beer

unread,
Oct 17, 2015, 3:51:10 AM10/17/15
to TiddlyWiki
Hi Scott,

 
I can see where the markup doesn't have an elegant solution, but I'd think that particular case (an image wrapped in a link) would come up often enough that it fairly demanded either a shorthand or the elimination of the two usual shorthands Siniy-Kit detailed above.

I fully understand. To me, it's a win that we can just define exactly what we need as a macro.
But I can also see, how we're loosing plenty people with that approach.

Just listen to the sound of it...

Missing feature? Write a macro.

Go tell that to someone using MS Office and then
observe the look on their face from the mere suggestion. :D

Simple image tiddler link:
  
title: $:/_my/macros/imglink
tags
: $:/tags/Macro

\define imglink(tiddler) <$link to="""$tiddler$""">[img[$tiddler$]]</$link>

Or use linkimg @ tb5 for a more sophisticated deal.

Simple external image link:

title: $:/_my/macros/linkimgx
tags
: $:/tags/Macro

\define linkimgx(tiddler,ref) <a href="$ref$">[img|$img$]]</a>

Or, again, use linkimg @ tb5 to also link external targets.

You can think of it as that:

But the lack of consistency does have me tripping over my feet a bit as I try to acclimate to TW5.

...or you can think that TW doesn't prescribe too much of a solution for you
when you might need something slightly different.

Possibly, it's perhaps just a matter of not having had a conversation
as to whether some of these things could be more core-prominent these days.

I believe, @Jeremy would ping authors to ask for a core contribution,
provided he saw it first and then gave it a thought along these lines.

Best wishes,

— tb

Jeremy Ruston

unread,
Oct 20, 2015, 2:04:54 PM10/20/15
to tiddl...@googlegroups.com
I think it’s an oversight that we don’t have a convenient syntax for image links. Figuring

TiddlyWiki Classic uses this syntax:


For TW5, we’ve got [img[title-or-url]] and [ext[url]]. We could perhaps generalise the syntax so that elements of this format can be concatenated:


A different approach would be to extend the existing use of attributes with the image syntax:


We could use:

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cec065d5-4416-40cb-9931-a2e7dded60ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Simmons

unread,
Oct 21, 2015, 6:46:17 AM10/21/15
to TiddlyWiki
On Saturday, October 17, 2015 at 3:51:10 AM UTC-4, Tobias Beer wrote:
 
To me, it's a win that we can just define exactly what we need as a macro.
But I can also see, how we're loosing plenty people with that approach.

Just listen to the sound of it...

Missing feature? Write a macro.

Go tell that to someone using MS Office and then
observe the look on their face from the mere suggestion. :D

HA!  I have SO missed keeping up with this group.  :D

Jeremy's made macros so much easier to create (on the fly, even!) in TW5 that I was tempted to do just that — but then I remembered how I'd "created" styles when I first discovered TiddlyWiki Classic that, unknown to me, already had TW markup in place.  I still find {{blockquote{some text}}} in tiddlers from before I knew about <<<.  :P

Looking back, I'm not sure my comment "I can see where the markup doesn't have an elegant solution" makes much sense.  What I was trying to convey was that the logic of TW5 markup doesn't have a blindingly obvious and easily agreed upon convention for wrapping an image in a link.  TWC sort of did — or, at least, it seems like it did because I spent a lot of time with its markup over the years.

The more I tinker with TW5, the more I think Jeremy nailed it with his note about concatenation (e.g., [img[path/to/image.jpg]ext[http://www.url.com/]] or [img[path/to/image.jpg]link[TiddlerTitle]]).  That's consistent with the syntax in filters (and likely other places I'm just discovering) and streamlines the TW5 markup conventions a new user would have to learn.  More complexity could be added by spelling out the full macro call and adding params, but it does seem the lack of a basic syntax for image-linking is akin to MS Office coming without an out-of-the-box CTRL+F function.  ;)

Siniy-Kit

unread,
Oct 21, 2015, 8:33:18 AM10/21/15
to tiddl...@googlegroups.com
Hi, Jeremy. We have a very good modal widget, but we don't have beautiful wiki-text for clickable pictures (simple enlarge them in modal, for example)   and I use construction

<$button class="tc-btn-invisible" style="float:right;">
<$action-sendmessage $message="tm-modal" $param="10016" />
<$image  source=" images/products/001_3.jpg" class="myimages" alt="Турник настенный"  tooltip="Турник!"/>
</$button>

it works (you can see here http://uvakin.neocities.org/heeg.html#picture_modal)  but it is not compact. And I add CLOSE by clicking on dark modal background.



вторник, 20 октября 2015 г., 21:04:54 UTC+3 пользователь Jeremy Ruston написал:

Tobias Beer

unread,
Oct 22, 2015, 6:14:15 AM10/22/15
to tiddl...@googlegroups.com
Hi Jeremy,
This feels like the preferable approach to me,
not introducing more complexity to the wikitext syntax,
as we already have image attributes (worth knowing).

So we just add:
  • ext
    • links to an external resource
  • link
    • links to a tiddler
Plus, I imagine the implementation to be quite straight forward.

To avoid any (mostly unwanted) default browser styling for image links,
we could not use <a/> element wrappers but rather custom on-click handlers.
Not sure what's best.

Best wishes,

— tb
Reply all
Reply to author
Forward
0 new messages