trying to set tags to {{!!title}}

65 views
Skip to first unread message

Geert Geurts

unread,
Apr 8, 2021, 3:26:09 AM4/8/21
to TiddlyWiki

Hi All

I'm trying to create a button which pressing it creates a tiddler tagged with the title of the tiddler where the button resides. So I have a tiddler named "New Tiddler" with a button. Once I click this button I want to get a new tiddler tagged "New Tiddler".

I cam this far:

<$button> <$action-sendmessage $message="tm-new-tiddler" title=<<now "YYYY-0MM-0DD hh:0mm">> text="" tags={{!!title}} /> New Tiddler </$button>

But that gives two tags "New" and "Tiddler", and using the following:

<$button> <$action-sendmessage $message="tm-new-tiddler" title=<<now "YYYY-0MM-0DD hh:0mm">> text="" tags=[[{{!!title}}]] /> New Tiddler </$button>

Tags it with "{{!!title}}"...


Regards,

Geert

TW Tones

unread,
Apr 8, 2021, 4:09:23 AM4/8/21
to TiddlyWiki
Geert,

The are a number of ways to achieve this here is one, inside a macro we can use substitution variables.
\define newhere()
<$button> <$action-sendmessage $message="tm-new-tiddler" title=<<now "YYYY-0MM-0DD hh:0mm">> text="" tags="[[$(currentTiddler)$]]" /> New Tiddler </$button>
\end
<<newhere>>

But this button already exists in the view toolbar. See new here button.

If we want to we can transclude it where we want and use "||" to apply it to the current tiddler

{{||$:/core/ui/Buttons/new-here}}

Tones

Geert Geurts

unread,
Apr 8, 2021, 4:14:29 PM4/8/21
to TiddlyWiki
Sweet! 
Tones you've made my day!
Thanks allot!

Geert

Reply all
Reply to author
Forward
0 new messages