[TW5] newtiddler tagging help

94 views
Skip to first unread message

Devin Baillie

unread,
Oct 31, 2015, 1:13:41 PM10/31/15
to TiddlyWiki
I've got multiple projects, and I want to be able to create tasks tagged with each project name.

I've created a text box and a button to do this using

<$edit-text tiddler="$:/temp/NewTaskButtonTemplate/input" tag="input" type="text" placeholder="New Task"/>

<$set name="tag1" value="task">
<$set name="tag2" value={{!!title}}>
<$newtiddler title={{$:/temp/NewTaskButtonTemplate/input}} skeleton="task_skeleton" edit="no">Create New Task</$newtiddler>
</$set>
</$set>

Where task_skeleton is a tiddler that is tagged with $(tag1)$ and $(tag2)$.

This works how I expected for titles without spaces, but if the project title has multiple words, for example "Test Project", when the new task gets tagged with "Test" and "Project", which is not helpful.  How can I make this so that it will tag it with a single tag "Test Project" instead?

Devin Baillie

unread,
Oct 31, 2015, 1:36:13 PM10/31/15
to TiddlyWiki
Also, how would I go about clearing the text box after the button is clicked?

Thanks in advance!

Eric Shulman

unread,
Oct 31, 2015, 4:03:22 PM10/31/15
to TiddlyWiki
On Saturday, October 31, 2015 at 10:13:41 AM UTC-7, Devin Baillie wrote:
I've got multiple projects, and I want to be able to create tasks tagged with each project name.
Where task_skeleton is a tiddler that is tagged with $(tag1)$ and $(tag2)$.
This works how I expected for titles without spaces, but if the project title has multiple words, for example "Test Project", when the new task gets tagged with "Test" and "Project", which is not helpful.  How can I make this so that it will tag it with a single tag "Test Project" instead?

Have you tried putting [[ and ]] around the $(tag1)$ and $(tag2)$ in the task_skeleton? i.e.,
   [[$(tag1)$]] [[$(tag2)$]]

enjoy,
-e

Eric Shulman

unread,
Oct 31, 2015, 4:05:10 PM10/31/15
to TiddlyWiki
On Saturday, October 31, 2015 at 10:36:13 AM UTC-7, Devin Baillie wrote:
Also, how would I go about clearing the text box after the button is clicked?
Thanks in advance!

Inside your $button widget, add an $action-setfield widget, like this:

<$action-setfield tiddler="$:/temp/NewTaskButtonTemplate/input" field="text" value="" />

enjoy,
-e
 

Devin Baillie

unread,
Nov 1, 2015, 1:15:45 AM11/1/15
to TiddlyWiki
That worked perfectly.  Thanks.

Devin Baillie

unread,
Nov 1, 2015, 1:27:01 AM11/1/15
to TiddlyWiki
I'm not sure where exactly to put this.  This is what I tried, but it doesn't seem to do anything:

<$edit-text tiddler="$:/temp/NewTaskButtonTemplate/input" tag="input" type="text" placeholder="New Task"/>

<$set name="tag1" value="task">
<$set name="tag2" value={{!!title}}>
<$newtiddler title={{$:/temp/NewTaskButtonTemplate/input}} skeleton="task_skeleton" edit="no" >
<$action-setfield tiddler="$:/temp/NewTaskButtonTemplate/input" field="text" value="" />
Create New Task
</$newtiddler>
</$set>
</$set>

I'm not using a $button widget, I'm using the $newtiddler widget from here.  I'm guessing that's why it's not working, but have no idea how to fix it.

Matabele

unread,
Nov 1, 2015, 1:48:19 AM11/1/15
to TiddlyWiki
Hi

Have you tried to use an $action-sendmessage widget with 'tm-new-tiddler'?

Else, if you are looking to create a tiddler in the background, try the $x-maketid widget from here.

regards

Devin Baillie

unread,
Nov 1, 2015, 12:07:38 PM11/1/15
to TiddlyWiki
After a bit of tinkering, I got the following code to behave how I want it.

<$edit-text tiddler="$:/temp/NewTaskButtonTemplate/input" tag="input" type="text" placeholder="New Task"/>

<$button>
<$x-maketid $title={{$:/temp/NewTaskButtonTemplate/input}} $tags="[[task]] [{!!title}]" $navigate="hide" />
<$action-setfield $tiddler="$:/temp/NewTaskButtonTemplate/input" $field="text" $value="" />
Click Me
</$button>

It solves both issues, titles with spaces and clearing the text box after the button is clicked.

Thanks for the help guys!
Reply all
Reply to author
Forward
0 new messages