There are at least 3 ways to make new tiddlers in TW. Of these, only the
ActionCreateWidget will automatically prevent overwriting titles. ACW
also has the advantage that it doesn't open your tiddler in edit mode.
In your original you had text="{{transclusion}}" . You can not do that. You
must use text={{transclusion}} . Otherwise, the actual text will be
"{{transclusion}}" and not the transcluded content.
In your example, <$action-sendmessage was not closed on the end with "/>".
Always do a double-check to make sure that all tags are matched by their
anti-tag
(e.g. <mytag> .... </mytag> or that a single tag is closed on the end with
"/>" .
In your original example, I did not know what $:/tags/Template did or what
it's contents were. So I removed it for my test.
This version works, though I don't know if it does exactly what you
intended:
\define testknopf(Kennzeichen Sache)
<$button>Mein Knopf
<$action-createtiddler $basetitle="$Sache$ - Jahr" tags="$Kennzeichen$
$Sache$" text={{Benzin - Jahr}} />
</$button>
\end
<<testknopf ImportantTag Thing>>
If you press the button twice, it will make a new tiddler based on the
name, but will not over write the first one.
HTH
On Thursday, February 20, 2020 at 5:57:13 AM UTC-8, Gerald Weis wrote:
>
> Hi folks,
>
> i need help.
>
> i want to create a new tiddler from templates.
> The cocept ist, the macro shoud be global.
>
> \define testknopf(Kennzeichen Sache)
>
> <$button>
> <$action-sendmessage $message="tm-new-tiddler" title="$Sache$ - Jahr"
> tags=$Kennzeichen$ $Sache$ text="{{Benzin - Jahr||$:/tags/Template}}"
> </$button>
> \end
>
> This macro shoud do the follow things:
> 1. create a new tiddler
> 2. load the templatetiddler with Name where is compsite form "$Sache$ -
> Jahr"
> 3. transclude the content of templatetiddler in the new tiddler
> 4. disable the templatetag in the new tiddler
> 4. close the templatetiddler
>
> my Templatetiddler is tagged with $:/tags/Template
>
> what ist wrong?
>
>
--
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/5f0c2b22-622c-4549-b64a-cdd9968d2c34%40googlegroups.com.