Passing variable to link widget?

91 views
Skip to first unread message

Ivan Aparicio

unread,
Oct 18, 2018, 3:04:55 AM10/18/18
to tiddl...@googlegroups.com
I'm trying to get a tiddler to link to a different tiddler that is based on its name:

<$set name="tiddler-title" value={!!title}}>

Tiddler content

!<$link><
<tiddler-title>> Observations</$link>

The tiddler shows a link, but it doesn't work. I was hoping I would have a link that I could then use to create the 'Observations' tiddler.

Does anyone know how to do this?

PMario

unread,
Oct 18, 2018, 4:30:04 AM10/18/18
to tiddl...@googlegroups.com
hi

imo you missed the quotes and a space. see: https://tiddlywiki.com/#SetWidget

<$set name="tiddler-title" value={!!title}}>

-m

PMario

unread,
Oct 18, 2018, 4:32:38 AM10/18/18
to TiddlyWiki
modified

Ivan Aparicio

unread,
Oct 18, 2018, 5:59:08 AM10/18/18
to TiddlyWiki
Hi Mario,

You're right, sorry it was a transcription typo. I've corrected it now. Thanks

TonyM

unread,
Oct 18, 2018, 7:40:00 AM10/18/18
to TiddlyWiki
Ivan,

It is nice we can create tiddlers from non existent tiddlers named in links.

You may however look to creating tiddlers in the future with custom new tiddler buttons so you can set fields, choose to create but not navigate, add fields and tags or use template tiddlers.

Just a little heads up

Tony

Ivan Aparicio

unread,
Oct 18, 2018, 8:53:21 AM10/18/18
to TiddlyWiki
Thanks Tony,

Is the heads up for backwards compatibility? The reason I would like to use the link method, is because if the tiddler already exists, I would like to link to it, and if it doesn't yet, I would like to be able to create it.

Is that an option with the new tiddler button?

TonyM

unread,
Oct 18, 2018, 4:53:10 PM10/18/18
to TiddlyWiki
Ivan.

When writing your own "button" you can make it do anything. You could have a macro you call with a tiddler name that would provide a link if it exists and a button to create it if it does not. If the at button is given a class of  class="tc-btn-invisible tc-tiddlylink" it will look like a link. If you use the $macrocall widget to call your macro you can provide the tiddler name from another macro or transclusion.

I don't have time to give you a finished solution right now.

Regards

Tony
Reply all
Reply to author
Forward
0 new messages