Hi,
i am trying to put a clone button inside a tiddler , all i really want is to have a clone tiddler button similar to the one in the menu
i can put a button widget along with a tm-new-tiddler command, but then would have to state every single field i want copied , but i have many fields ,and some fields might be added later .
so is there like some parameter or command that encompasses the entire tiddler including all fields so ,that if combined with tm-new-tiddler , tiddly wiki would understand i want the entire tiddler copied to the new tiddler being created?
thanks
<$button message="tm-new-tiddler" param=<<currentTiddler>> >
clone
<$button>
Will copy all fields of the tiddler passed as the param.
sorry one more question , suppose i want in the same button action to set a value of a field in the new tiddler
i tried action set field , but it set the value in both the existing tiddler and the newly cloned one
Is it possible to have the action setfield affect only affect the newly cloned tiddler
<$button message="tm-new-tiddler" param=<<currentTiddler>>>
clone
<$action-setfield $tiddler=<<currentTiddler>>status="lost"/>
</$button>
Thanks again
Paul, do I understand in this case @saqimtiaz solution is an effective clone, but you are asking now to add additional content to the new tiddler, so it becomes more than a clone?
Before we look at this new requirement be aware you can reuse any viewToolbar button in a tiddler of the view templates as follows; {{||$:/core/ui/Buttons/clone}} but here you want additional content.
- In @saqimtiaz example the param/template is
param=<<currentTiddler>>
You could use the ActionCreateTiddler or see WidgetMessage: tm-new-tiddler which documents this message; and adds;
- How to; To create a new tiddler with given attributes rather than from a template:
Although undocumented if you use a separate <$action-sendmessage $message="tm-new-tiddler" as follows, you can use both the $param for the template and add additional fields’
<$button>
<$action-sendmessage $message="tm-new-tiddler" $param=<<currentTiddler>> status="lost" />
New Tiddler
</$button>
Regards
I submitted a documentation update to WidgetMessage tm-new-tiddler to include the above form, in the examples.