I`found tiddly wiki a few weeks ago and trying it out since.
Now I'm stuck
This probably so basic that no one mentioned it and my searching failed.
I want to create a tiddler from a template tiddler
I made a macro for the button (deleted the clutter for this example set fields/tags)
Used the macro because it works for some reason (don't know why) better with multiple buttons in a table.
And here I'm stuck:
I want to create a text box to input the title for my new tiddler
Giving my new tiddler that title
and jump to the text section when the new draft with my title is created.
As I understand (please correct me if wrong)
A tiddler title is also a field, so what do I use:
FieldManglerWidget or the ActionSetFieldWidget or the ActionCreateTiddlerWidget
\define CreateMyTiddler()
<$button message="tm-new-tiddler" param="$:/NewTiddler" >
Create Tiddler</$button>
\end
|<< CreateMyTiddler1 >>|<< CreateMyTiddler2 >>|<< CreateMyTiddler3 >>|
The simplest way appears to be:-- enter the 'newtitle' to a temp tiddler or field, via an edit-text widget (starting out with the current title)-- create a "Rename Tiddler" button:-- creates a clone (using 'currentTiddler' as the template) with the title set to value of 'newtitle' ('tm-new-tiddler')-- deletes the original tiddler ($action-deletetiddler widget)To create the clone, you may find the $x-maketid widget from here more convenient to use than an $action-sendmessage widget.
On a side note I would like a clone here button in addition to new here which lets you edit the title and nominate the tiddler to clone.
To be honest I create most of my tiddlers with new, new here and clone except for custom tiddlers. I am keen to develop ways to copy tags and fields and or there values from one tiddler to the next.
Regards
Tony
Maybe this information will be helpful for you:
Cheers,
Thomas
Project Step: <$edit-text tiddler="$:/MyNewTiddler" tag="input" default="" class='tc-edit-texteditor' placeholder=Project step' name'/>
<$button>
<$action-createtiddler param="$:/MyNewTiddler" $basetitle={{$:/MyNewTiddler} tags="projectA" text="Description of materials"/>
Add
</$button>
On a side note I would like a clone here button in addition to new here which lets you edit the title and nominate the tiddler to clone.
<$button>
<$action-sendmessage $message="tm-new-tiddler"
param="MyTemplate" title="NewTitle" />
Create Tiddler
</$button>
Tiddler Name: <$edit-text tiddler="MyTitle" tag="input" default="" class='tc-edit-texteditor' placeholder='Tiddler Title'/>
<$button>Make Tiddler
<$action-navigate $to={{MyTitle}}/>
<$action-setfield $tiddler='MyTemplate' $field='title' $value={{MyTitle}}/>
<$action-sendmessage $message="tm-edit-tiddler" $param={{MyTitle}}/><$action-deletefield $tiddler=MyTitle text/>
</$button>
<br>
I get that this can make a new tiddler with a title entered into the presented field box...
Can this be extended to ask for some more fields which get filled in in the new tiddler too?
Stephen
Yes I belive it can be extended and there are other alternatives but also consider creating a tiddler automaticaly open in edit mode, changing the title and adding and editing fields. I often use clone tiddler to this end, and are building and finding tools to help manage fields.
Regards
Tony
<$action-sendmessage $message="tm-new-tiddler"
param="MyTemplate" title="NewTitle" myField="my field value" />
$edit-text tiddler="MyTemplate" field="city_name" default="" placeholder='City name'/>
<$action-setfield $tiddler="MyTemplate" $field="city_name" $value=""/>
<$button>Make Tiddler
<$action-navigate $to={{MyTitle}}/>
<$action-setfield $tiddler='MyTemplate' $field='title' $value={{MyTitle}}/>
<$action-sendmessage $message="tm-edit-tiddler" $param={{MyTitle}}/>
<$action-setfield $tiddler="MyTemplate" $field="city_name" $value=""/>
<$action-deletefield $tiddler=MyTitle text/>
</$button>
<br>
Note to self.. Check socks first.