Thank you — I’m also going to test this out. There’s so much in this code that I don’t understand (yet).
It now occurs to me that I need to make a separate wiki for testing so I don’t break the one I’ve spent weeks perfecting.
Thank you — I’m also going to test this out. There’s so much in this code that I don’t understand (yet).
It now occurs to me that I need to make a separate wiki for testing so I don’t break the one I’ve spent weeks perfecting.
Just create the tiddler and dont tag it $:/tags/Macro and test the macro in the same tiddler.
The solution should be this:
<$checkbox field="tags" checked="done" unchecked="todo">This is a task</$checkbox>
…but there’s a bug in the current TW version (5.2.3) that prevents <$checkbox>
widget to work as expected with the tags
field. This might be related to this bug report but I’m not sure.
Anyway, if you replace the tags
field with another non-system field, say result
, the checkbox works as expected:
<$checkbox field="result" checked="done" unchecked="todo">This is a task</$checkbox>
{{!!result}}
In order to bind 2 tags to the [un]checked state of a <$checkbox>
widget, this is a working solution, at least in a single new tiddler on tiddlywiki.com:
<$checkbox
tag="done"
checkactions="""<$action-listops $tags="-todo"/>"""
uncheckactions="""<$action-listops $tags="todo"/>"""
>This is a task</$checkbox>
Fred
eek! … that one.
I’ll use this, many thanks @tw-FRed — and also to everyone who’s offered suggestions. You’ve all given me some angles to help me learn the syntax.
Having chased-my-tail inside the “contents” list on tw.com, I believe I’ve found a logical starting point … Concepts > Railroad diagrams, and then I’ll work my way through the alphabetical listing inside Concepts. I wish the learning pathway was better defined for a non-coder.
Please note, My Macro solution above is doing much of what everyone else suggested later in the thread but with easy to use parametrisations and a pseudo checkbox using a single button, as a result it is highly extensible.
To all;
There is also a new feature Release 5.2.3 in the checkbox widget the listField which could be used to manipulate the tags field and is a way to avoid the listops action, or have a checkbox toggle the existence of items within a list field like the tags field.
Looked that one up… my brain froze. I don’t doubt that the macro method is good if one understands it.
Currently reading $action-listops — too much, too soon to even begin to understand. My conclusion (for now) is I don’t care what it does, FRed’s code is short, simple and is working. I can keep going with TW rather than give up.
Just to be clear you don’t have to understand it, to just use it;
<<check-tag done toDo>>
However if you can only use it if you understand it, do what you will.
Also if the behaviour is not what you expected describe it in english not partial code and we can give you exactly what you want. For example No where I could see did you mention what to do if there was no ToDO tag to start with.
If you are interested in the wisdom of someone experienced here I would use the following logic;
<<now YYYY0MM0DD0hh0mm0ss0XXX>>
In your lists items that need doing are found with the filters;
[all[tiddlers]has[done-date]]
will return only done tiddlers title, but also the exact date/time it was done is available with {{!!done-date}} suitable formatted[all[current]get[done-date]]
will return only done tiddlers but also the exact date/time it was done[all[tiddlers]has:field[done-date]!has[done-date]]
will only list tiddlers that have the done date field but with no value - it is not done, but should be.You could have a button called “redo” that only appears on tiddlers with a done-date with a value, which would set the done-date to empty ""
and could first save done-date to last-done-date or update a data tiddler with date/time tiddler/done/undone and have a infinite history available.
I may write a macro to support this!
Fair enough, but I’m still unable to implement BECAUSE I’m still a bit lost with where and how to actually do so. BUT you do describe exactly what I want to have happen. Thanks.
If a tiddler has no ToDO or DONE tags, then the tiddler needs no further editing/review. I suppose the concept suits tiddlers/wiki still under development.
Thanks, it makes sense to not use TAGS when there are other methods, but I’m still weeks/months/years away from appreciating how I might use existing field-data. TW is a hobby and I’m struggling.
Sorry, it must be frustrating to help someone like me.
Not at all and I will give you a better description soon. Hopefully I will have an easy way for you to implement the preferred method.
Have you a working system now?
So how are you setting the ToDo tag in the first place, or how would you like to?
Apart from my offline wiki (my preferred way) I’ve now got 2 tiddlyhost wikis — but sadly I have neither your example, or FRed’s working properly, yet.
I’m adding the ToDO tag as needed, to mark tiddlers that I want to complete.
I’ll let you know when I’ve posted up the mess I’ve made on TiddlyHost (in about 4 hours time) — right now there’s a snake in the house and dogs going ballistic. I did post my “draft” TW beginner’s tutorial I’ve been writing, not finished yet. The blind leading… etc. ludicrous I know, but it helps me learn.
It can be important to hear “Words out of the mouths of (TiddlyWiki) babes”, it is so hard for us crusty decade plus users, to have your experience, even guess, ever again.
My test tiddlers are up - and looking very messy.
https://playground-testing.tiddlyhost.com/
@TW_Tones — the wiki name is quite coincidental. I’ve since discovered you have something similar.
@Anakowi , I haven’t gotten a chance to read through everything yet, but wanted to mention one thing I noticed on your playground wiki - you are using
$:/tags/Macro;
as the tag in your macro, but it should be…
$:/tags/Macro
(Without a semicolon)
@Tiddlybob — Thanks — that should make a big difference. I’ll have another crack at it later this evening (Australian time).
I couldn’t find the macro tag that I made, but eventually clicked on the tag to edit the “missing” tiddler $:tags/Macro
— removing the semi-colon.
Thing’s are still not working.
Thank you all for your time. I’m very close to ready to give up. I’ll give obsidian a test run, but I’m happy enough to keep using TW5 at my level of understanding, in the way I have it configured, it’ll be ok for what I need (for now).
Remove that tag and add $:/tags/Macro
If you install this system-tags-more.json (6.8 KB) the go to the SideBar > more > SysTags you can see all System tags even if not in use and copy them to the clipboard.
Not all system tags may be listed if anyone sees any missing please let me know.
I’m not sure where you’re getting stuck specifically, but @tw-FRed’s solution seems to address your stated tag-toggling needs.
Looking at your test tiddler here, the problem you were having with the “Repairs Complete” list just comes down to a missing angle-bracket to close your $checkbox widget. I’ve posted the working code below:
<$list filter="[!has[draft.of]tag[repaired]sort[created]]">
<$checkbox
tag="repaired"
checkactions="""<$action-listops $tags="-REPAIR"/>"""
uncheckactions="""<$action-listops $tags="REPAIR"/>"""
>
<$link to={{!!title}}>
<$view field='title'/>
</$link>
</$checkbox>
</$list>
That angle bracket before <$link to={{!!title}}>
was the one you were missing. Since the parser didn’t find a closing bracket where it expected it, it seems to have treated the />
of <$view field='title'/>
as the end of a self-closing <$checkbox/>
, which was what resulted in the stray tag displaying.
Triple quotes are just an alternate way to demarcate a value, similar to single quotes or double quotes. The main advantage of """
over '
or "
is that it can enclose a value that already includes single and/or double quotes - so in this case, Fred used standard double quotes for the values of the $action-listops widget parameters, and triple quotes to indicate that the entire action widget should be treated as the value of checkactions.
If you’re still having issues, please post them here and we can continue to troubleshoot.
ETA: I notice you’re using <$link/>
in one place and <$link to={{!!title}}><$view field='title'/></$link>
in the other. These are functionally identical, so you’re safe to use the shorter form in all cases, unless you want to specify a different field’s content for the link text - <$link to={{!!title}}><$view field='caption'/></$link>
, for instance.
@etardiff - Thanks for finding my missing bracket.
Yep, I was testing to see if that was causing the display of spillover “text” from the macro example (shows up on any tiddler with a checkbox).
Initially I used TW-FRed’s solution, both check/uncheck actions, only in the 2nd list. It didn’t work properly. Then I put “checkactions” in the first list, and this removes the REPAIR tag. Perfect. Then realised I only need the “uncheck” action in the 2nd list. I’m learning!