Hello!

I've been using TW5 on and off for quite a while and I've recently decided 
to use it for taking notes/tasks while working. As part of this I'd like to 
have a quick and easy way to create tiddlers with a given prefix (based on 
tags) and a name. I haven't done much in the way of customizing TW5 before 
so most of this is quite new, any help/suggestions would be appreciated.

For example:
If I have a tiddler titled "PR123456 Tasks" tagged with "PR123456 [[PR 
Tasks]]" I would like to have a text edit field that will take the task 
name and produce a tiddler titled "PR123456 Task: task-name-here".

Here's some sample code:


\define concat(word1 word2)
$word1$ $word2$
\end


\define createTaskTiddler(prefix tags)
<$edit-text tiddler="$:/state/new-task-title" tag="input" default="" 
placeholder="Task Title"/>
<$button>
<$vars name={{$:/state/new-task-title!!text}}>
<$action-createtiddler $basetitle="$prefix$$(name)$" tags="$tags$" completed
="false"/>
</$vars>
<$action-deletetiddler $tiddler="$:/state/new-task-title"/>
<$action-sendmessage $message="tm-auto-save-wiki"/>
Add Task
</$button>
\end


<$list filter="[is[current]tags[]]+[!tag[PR Tasks]]">
<$set name="prNum" value=<<currentTiddler>>>
<$set name="prefix" value=<<concat $(prNum)$ "Task: ">>>


<<createTaskTiddler $(prefix)$ "$(prNum)$ Task">>


</$set>
</$set>
</$list>


You can view a semi working demo here: 
https://tw.mdeabreu.com/work.html#PR123456%20Tasks
When you try it you should be able to see that when you attempt to add a 
new task the tiddler created has the title "PR123456 Tasks: " but it is 
failing to transclude the title.

Any tips, help, and suggestions would be greatly appreciated.

Thanks!

-- 
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/86fc7dce-e95b-48fe-9389-130ede3a2e16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to