On Wednesday, July 1, 2020 at 8:46:19 AM UTC-7, Mat wrote:
>
> So, here's my current (flawed) solution. Imagine that it is an
> EditViewTemplate, i.e accessible in edit mode:
> <$edit-text tiddler="temp" />
> <$button>
> Insert as transclusion
> <$action-createtiddler $basetitle=<<currentTiddler>> text={{temp}} />
> <$wikify name=newest-tid
> text={{{ [prefix<currentTiddler>!sort[created]first[]] }}}
> >
> <$action-setfield
> $tiddler=<<currentTiddler>>
> text=<<some macro call to wrap Newest-tid in transclusion braces.
> This is not the problem.>> />
> </$wikify>
> <$action-deletetiddler $tiddler="temp"/>
> </$button>
> I suspect that the action-createtiddler is not finished by the time that
> wikify does its thing. So wikify doesn't get the new title, in spite of my
> hackey filter.
>
There's a little trick that might solve your problem...
Leave the first part (the $action-createtiddler) in the body of the button
widget as it is now, but...
move the rest of the actions into an actions="..." parameter. Like this:
<$edit-text tiddler="temp" /><br>
<$button actions="""
<$vars transclusion={{{
[prefix<currentTiddler>!sort[created]first[]addprefix[{{]addsuffix[}}]] }}}>
<$action-setfield $tiddler=<<currentTiddler>> text={{{
[<currentTiddler>get[text]addsuffix<transclusion>] }}}/>
<$action-deletetiddler $tiddler="temp"/>
""">
Insert as transclusion
<$action-createtiddler $basetitle=<<currentTiddler>> text={{temp}} />
</$button><br>
When the button is pressed, the $action-createtiddler is invoked first and
then the actions="..." is fired off separately, after the createtiddler is
done.
Put the above code into a tiddler named "MakeTransclusion", then create
another tiddler called "MyTiddler" containing:
{{||MakeTransclusion}}
Then, while viewing MyTiddler, enter something into the $edit-text input
field and press the button.
This will create "MyTiddler 1" containing the entered text, and append the
contents of MyTiddler
with the transclusion {{MyTiddler 1}}.
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/33fbcf54-da53-45d8-8588-335bc560b103o%40googlegroups.com.