On Saturday, July 25, 2020 at 7:53:28 AM UTC-7, Ste wrote:
>
> Creating an empty tiddler if [[thing inside]] doesn't exist when you click
> on the link is the default behaviour in tiddlywiki.
While this is true, it's not what the OP was asking. Specifically, he
wrote:
"When I *save* the tiddler, a new empty tiddler is created.."
In other words, a new tiddler is created as soon as you save
the tiddler in which the missing link occurs, not when you
subsequently click on the link to the missing tiddler.
In Stroll, its done via $:/.giffmex/ui/EditTemplate, which redefines the
save-tiddler-actions() macro like this:
\define save-tiddler-actions()
<$action-sendmessage $message="tm-add-tag" $param={{{ [<newTagNameTiddler>
get[text]] }}}/>
<$action-deletetiddler $tiddler=<<newTagNameTiddler>>/>
<$action-sendmessage $message="tm-add-field" $name={{{
[<newFieldNameTiddler>get[text]] }}} $value={{{
[<newFieldValueTiddler>get[text]] }}}/>
<$action-deletetiddler $tiddler=<<newFieldNameTiddler>>/>
<$action-deletetiddler $tiddler=<<newFieldValueTiddler>>/>
<$action-sendmessage $message="tm-save-tiddler"/>
<$list filter="[all[current]links[]is[missing]]"><$action-createtiddler
$basetitle=<<currentTiddler>>/></$list>
\end
Note the last line of the macro:
<$list filter="[all[current]links[]is[missing]]"><$action-createtiddler
$basetitle=<<currentTiddler>>/></$list>
When this is invoked, it uses a $list widget to scan the tiddler's links
for any that are missing,
and then triggers $action-createtiddler for each missing tiddler title.
To add this handling to your own tiddler, copy these two tiddler
from https://giffmex.org/stroll/stroll.html:
$:/.giffmex/ui/EditTemplate
$:/config/ui/EditTemplate
enjoy,
-e
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/93db153e-2856-4565-838c-dd072f7a3903o%40googlegroups.com.