Okay I got it...had to make a small plugin, but it appears to work...
/*\
title: $:/core/modules/macros/tw5filterTemplatePrefix.js type: application/javascript
module-type: macro
Macro to return something less the prefix.
\*/
(
function(){
/*jslint node: true, browser: true */ /*global $tw: false */
"use strict";
/*
Information about this macro
*/
exports.name = "tw5filterTemplatePrefix";
exports.params = [
{name: "m"} ];
/*
Run the macro
m: is the Tiddler Template Title
returns: The name of the Tiddler less the template.
*/
exports.run =
function(m, v) {
return m.replace(/Template/i, "");
};
})();
$:/core/modules/macros/tw5filterTemplatePrefix.js <!--
Name: testCreate()
Purpose: Macro that uses the specified tiddler as a template for
copying / cloning / duplicating it into a new one with a
specified suffix.
Macro required variables:
- $(whichTiddlerTemplate)$ - The name of the src tiddler to be copied
- $(tiddlerToCreate)$ - The name of the new tiddler to create minus the suffix.
- $(dasSuffix)$ - The suffix of the new tiddler to create.
Macro required shadow tiddlers:
- $:/state/tab-1749438307 - stores the name of the copied, cloned, duplicated tiddler.
Dependency macros:
- createDasTid()
-->
\define testCreate()
<!-- Set this field for use later when we generate the title of the new copied/duplicated/cloned tiddler -->
<$action-setfield $tiddler="$:/state/tab-1749438307" text="$(tiddlerToCreate)$ - $(dasSuffix)$" />
<!-- Create a copy of a tiddler based on another. -->
<<createDasTid>>
\end
<!--
Name: createDasTid()
Purpose: Macro that makes a copy of the tiddler.
Macro required variables:
- $(whichTiddlerTemplate)$ - The name of the src tiddler to be copied
Macro required shadow tiddlers:
- $:/state/tab-1749438307 - stores the name of the tiddler to be copied / cloned / duplicated.
-->
\define createDasTid()
<$action-createtiddler $template="$(whichTiddlerTemplate)$" $basetitle={{$:/state/tab-1749438307}} tags="deltag" />
\end
\define removeTemplatePrefix()
<!-- Calls the Plugin above -->
<<tw5filterTemplatePrefix m:"$(whichTiddlerTemplate)$">>
\end
<!-- Whatever is typed into this textbox is stored in the $:/state/new-tiddler-suffix system/shadow tiddler -->
''Suffix:'' <$edit-text tiddler="$:/state/new-tiddler-suffix" tag="input" default=""/>
<!-- Begin button to duplicate all from template tiddlers -->
<$button>
<!-- Once this script obtains a list of template tiddlers based on their tags and
titles, it needs to know two things about each tiddler that it replicates
1. The name of the existing Template tiddler.
2. The name of the new cloned Tiddler created from the tiddler template.
2.1 (The new suffix for each cloned/duplicated/copied tiddler)
-->
<!-- Each Tiddler to be used as a template and duplicated
is tagged with both of the following tags: "templates", and "EditingTemplate"
and here we obtain them to be gone through using the currentTiddler variable,
one at a time after the button is clicked.
Each of these tiddlers also ends with the suffix "Template" which needs to be removed
later on by the removeTemplatePrefix macro when generating the name of the newly created
tiddler.
-->
<$list filter="[tag[templates]tag[EditingTemplate]]">
<!-- Start setting variables for this iteration of the loop, each variable set for this iteration will be
used within the macro definitions above when they are called. (removeTemplatePrefix and testCreate for instance) -->
<!-- Set a variable within this iteration of the loop which contains the suffix specified in the Suffix: textbox above. -->
<$set name="dasSuffix" value={{$:/state/new-tiddler-suffix}}>
<!-- Set a variable that specifies which tiddler template to clone/duplicate/copy from
the current tiddler we are iterating over. -->
<$set name="whichTiddlerTemplate" value=<<currentTiddler>> >
<!-- Create a variable named "tiddlerToCreate" from the result of calling the removeTemplatePrefix macro and
then wifiy it so it is parsed and rendered. -->
<$wikify name="tiddlerToCreate" text=<<removeTemplatePrefix>> >
<!-- Call the testCreate macro to create the clone/copy/duplicate of the tiddler being itterated over. -->
<<testCreate>>
</$wikify>
</$set>
</$set>
</$list>
Create From Editing Template
</$button>
Tiddler: CreateTiddlersFromTemplates
This appears to work if you leave all the <!-- --> comments out, I should probably add something for the tags as well.