Hi,

I've not written the code so it's not tested.

Perhaps the list of actions when you click the button could be :

- Remove the field from the template tiddler,
- clone the template tiddler
- add back the field to the template tiddler.

Regards

FrD

Le vendredi 3 août 2018 04:46:30 UTC+2, TonyM a écrit :
>
> Folks/Team,
>
> I am creating a tool to create tiddlers from template tiddlers and will 
> share today (if I resolve this).
>
> However to do so I am using the following to clone the tiddler to a new 
> tiddler name eg "task 1" and open for edit (which the user then modifies)
>
> \whitespace trim
> <$button message="tm-new-tiddler" param=<<currentTiddler>> tooltip="Clone 
> this 'template'" aria-label="Clone this 'template'" class=<<tv-config-
> toolbar-class>> >
> <$action-setfield $field=template-source $value=<<currentTiddler>>/>
> *<$action-deletefield $field=tiddler-template-caption/**>*
> {{$:/core/images/clone-button}}
> </$button>
>
>
>    - I identify which tiddlers are templates by the existence of the 
>    field *tiddler-template-caption*
>    - During the clone which works perfectly the tiddler-template-caption also 
>    gets cloned
>    - Unfortunately this means the new tiddlers now appear in the list of 
>    tiddler templates
>    - In the above code *<$action-deletefield 
>    $field=tiddler-template-caption/*> deletes the field from the template 
>    tiddler not the new one.
>    - How can I delete this field from the new tiddler with the yet to be 
>    determined name?
>    
> I believe I need to use message="tm-new-tiddler" param=<<currentTiddler>> 
> rather than ActionCreateTiddlerWidget to clone the tiddler, where I would 
> use the $savetitle.
> I want the clone to work regardless of the fields and their content so I 
> do not want to explicitly create the fields, I just want them to come from 
> the template tiddler except for *tiddler-template-caption.*
>
> Note: <$action-setfield $field=template-source 
> $value=<<currentTiddler>>/> updates the template tiddler before the clone, 
> this saves the user doing it.
>
> How can I trigger *<$action-deletefield $field=tiddler-template-caption/**> 
> on the new tiddler after it is named/created without an additional 
> "trigger"*
>
> Thanks
> Tony
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/97046571-f787-4423-bf17-c1e7fd6bb565%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to