[tw5] Re: How do I remove a suffix from a variable?

2020-09-07 Thread leeand00
Yes, that's much less verbose thank you! On Sunday, 6 September 2020 at 19:47:47 UTC-4 Eric Shulman wrote: > On Saturday, September 5, 2020 at 12:05:24 PM UTC-7, leeand00 wrote: > >> So I'm using a filter, and it's working great to remove the suffix and >> add another one...see below: >>

[tw5] Re: How do I remove a suffix from a variable?

2020-09-07 Thread leeand00
Okay I just used the Javascipt because I'm more familiar with it than the macros (which I don't know how to comment either), but I also because didn't know how to create the new tiddlers in Javascript from the template tiddlers. On Sunday, 6 September 2020 at 18:22:20 UTC-4 saq.i...@gmail.com

[tw5] Re: How do I remove a suffix from a variable?

2020-09-06 Thread Eric Shulman
On Saturday, September 5, 2020 at 12:05:24 PM UTC-7, leeand00 wrote: > > So I'm using a filter, and it's working great to remove the suffix and add > another one...see below: > [tag[templates]tag[EditingTemplate]] +[removesuffix[Template]] +[addsuffix > [ - Underground]] > But...what I really

[tw5] Re: How do I remove a suffix from a variable?

2020-09-06 Thread Saq Imtiaz
Not sure you need the JavaScript. Assuming input: Spelling Template Desired output: Spelling - Underground Try: <$set name="tiddlerToCreateFromTemplate" value={{{[removeSuffix[Template]addSuffix[- Underground]]}}} > OR <$set name="tiddlerToCreateFromTemplate"

[tw5] Re: How do I remove a suffix from a variable?

2020-09-06 Thread leeand00
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 */

[tw5] Re: How do I remove a suffix from a variable?

2020-09-05 Thread Saq Imtiaz
PS: I realize now you may want addSuffix and not removeSuffix. Apologies. On Saturday, September 5, 2020 at 9:57:05 PM UTC+2, Saq Imtiaz wrote: > > Something along these lines will get you there: > > <$set name="tiddlerToCreateFromTemplate" > value={{{[removeSuffix[Underground]]}}} > > > OR

[tw5] Re: How do I remove a suffix from a variable?

2020-09-05 Thread Saq Imtiaz
Something along these lines will get you there: <$set name="tiddlerToCreateFromTemplate" value={{{[removeSuffix[Underground]]}}} > OR simplify <$list filter="[tag[templates]tag[EditingTemplate]]"> <$set name="tiddlerToCreateFromTemplate" value={{{[removeSuffix[Underground]]}}} > Use