Creating Tiddler from Template but just the body

44 views
Skip to first unread message

Jacob Krause

unread,
Feb 16, 2023, 12:24:13 PM2/16/23
to TiddlyWiki
Hey,

I have a button in my sidebar to create a new Tiddler witch works well for the most part. I now use a template for the new tiddler to already have some text in the body, which also works well. My only problem is, that the tag is also taken from the template and I cant find a way to get rid of it. Can i specify, which fields to take from the template? or is there a way to remove a tag or change tags to just the one I want?

Cheers. My code so far:

<$button class="tc-btn-invisible" title="Add Today Tiddler">
   <$list filter="[<tv-config-toolbar-icons>match[yes]]">
      {{$:/core/images/new-journal-button}}
   </$list>
   <$list filter="[<tv-config-toolbar-text>match[yes]]">
      <span class="tc-btn-text"><$text text="Add Today"/></span>
   </$list>
   <$action-sendmessage $message="tm-new-tiddler" $param="000template"  title=<<now YY/0MM/0DD>>  tags=<<now YY/0MM>>/>
</$button>

PS: Sorry, don't know how to use labels.

Eric Shulman

unread,
Feb 16, 2023, 2:15:33 PM2/16/23
to TiddlyWiki
Instead of use the `$param` parameter, you can set the `text` field content in the same way you are setting the content of the `title` and `tags` fields.  Something like this should do:
```
<$action-sendmessage $message="tm-new-tiddler" title=<<now YY/0MM/0DD>> text={{000template}} tags=<<now YY/0MM>>/>
```
Note how the `text=...` param is using transclusion to get its value from the "000template" tiddler.

enjoy,
-e
Reply all
Reply to author
Forward
0 new messages