Here's an updated version that works as an EditTemplate:

<style>.edit100 { width:100%; }</style>
<$edit-text tiddler="temp" tag="textarea" minHeight="5em" class="edit100"
   default="" placeholder="Enter content to be transcluded" /><br>
<$button actions="""
   <$vars target={{{ [<currentTiddler>split[']butfirst[]butlast[]] }}}>
   <$vars transclusion={{{ 
[prefix<target>!sort[created]first[]addprefix[{{]addsuffix[}}]] 
}}}>
   <$action-setfield $tiddler=<<currentTiddler>> text={{{ [<currentTiddler>
{!!text}addsuffix<transclusion>] }}}/>
   <$action-deletetiddler $tiddler="temp"/>
   </$vars>
   </$vars>
   """>
   Insert as transclusion
   <$vars target={{{ [<currentTiddler>split[']butfirst[]butlast[]] }}}>
   <$action-createtiddler  $basetitle=<<target>>  text={{temp}} />
   </$vars>
</$button>

1) Put the above code into a tiddler (e.g., "MakeTransclusion")
2) Tag that tiddler with $:/tags/EditTemplate
3) Add a field named "list-after", with a value of 
"$:/core/ui/EditTemplate/body"

Notes:
* The "target" variable is the name of the tiddler to create, derived from 
the current *draft* title (e.g, "Draft of 'SomeTiddler'").
* The "transclusion" variable finds the newest target tiddler and adds the 
"{{" and "}}" to make the transclusion syntax.
* This is then appended to the current "Draft of 'SomeTiddler'" content.
* I added a little CSS classname to the $edit-text widget so it would use 
100% width (and have a minimum height of 5em)
* The "list-after" field puts the textarea input and button following the 
normal body textarea input.

I've tested this on http://TiddlyWiki.com, and it works.

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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5ade773e-11a7-415c-a002-54fc4da309f5o%40googlegroups.com.

Reply via email to