how to use checkboxWidget to give a tag with "text todays date"?

108 views
Skip to first unread message

HC Haase

unread,
May 2, 2018, 3:14:25 AM5/2/18
to TiddlyWiki
I use the CheckboxWidget in a to-do list for tracking my work. a lot of the time I want to move a task to the next day - a tiddler with the name "worklog date". Day tiddlers and lists is all set up with my NewTaskHere plugin.

Using the CheckboxWidget I can set a tag with some text or today's date, but not both ( like worklog 02/05/2018).

any idea how to set a tag to text_space_date with the CheckboxWidget?

thanks

checkbox with date(working):
 <$checkbox tag=<<now "YYYY/0MM/0DD">> >
</$checkbox>


TonyM

unread,
May 2, 2018, 4:22:38 AM5/2/18
to TiddlyWiki
HC,

This should work for you. 

Using a checkbox is not the only way of course. If we use a checkbox the tiddler title will change with the time so you will not be able to uncheck it.


I do not fully understand when we need to use <$fieldmangler> but we do in this case. Perhaps because we are using message="tm-add-tag"

<$wikify name=tagvalue text="Yourtext <<now>>" >
<$fieldmangler>
<$button message="tm-add-tag" param=<
<tagvalue>> >
Go {{$:/core/images/timestamp-on}}
</$button>
</$fieldmangler>
</$wikify>

This formats the button less intensly


<$wikify name=tagvalue text="Yourtext <<now>>" >
<$fieldmangler>
<$button class="tc-btn-invisible tc-tiddlylink" message="tm-add-tag" param=<
<tagvalue>> >
Go {{$:/core/images/timestamp-on}}
</$button>
</$fieldmangler>
</$wikify>

Regards
Tony

Jed Carty

unread,
May 2, 2018, 4:59:58 AM5/2/18
to TiddlyWiki
A helper macro is probably the way to go if you want to use a checkbox.

here is a minimal example:

\define dateString() worklog <<now "YYYY/0MM/0DD">>

<$wikify name=date text=<<dateString>>>
<$checkbox tag=<<date>>/>
</$wikify>

HC Haase

unread,
May 3, 2018, 2:56:56 AM5/3/18
to tiddl...@googlegroups.com
I got it to work without the </$fieldmangler> or the \define.


I think the minimal line of code is just to put the tag values in the $wikify.

thanks guys

<$wikify name=tagvalue text="arblog <<now YYYY/0MM/0DD>>" >
<$checkbox tag=<
<tagvalue>> >
</$checkbox>
</$wikify>

This wikify thing is a new function for me

TonyM

unread,
May 3, 2018, 5:07:07 AM5/3/18
to TiddlyWiki
HC

Check boxes may have some value after all, inspired by your request. I made this.

<$wikify name=tagvalue text="<<now YYYY/0MM/0DD>>" >
<$checkbox field=item-review checked=<<tagvalue>> unchecked="" >
Reviewed today
</$checkbox>
</$wikify>

In your tag example when tomorrow comes the checkbox should be empty with yesterdays tag still on the tiddler. Using the Check Box will add another tag on the tiddler.

In my example tomorrow the check box will be unchecked, but checking it will replace the value in field=item-review

<$wikify name=tagvalue text="<<now YYYY0MM0DD>>" >
<$checkbox field=reviewed-day checked=<<tagvalue>> unchecked="" >
Reviewed today
</$checkbox>
</$wikify>

This has led me to make Day/Month Year reviews


<$wikify name=tagvalue text="<<now YYYY0MM>>" >
<$checkbox field=reviewed-month checked=<<tagvalue>> unchecked="" >
Reviewed this month
</$checkbox>
</$wikify>

Of course a lot more is possible.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages