Using Tags as Categories - How to Show No Category Tag

158 views
Skip to first unread message

David

unread,
Apr 21, 2020, 3:26:02 PM4/21/20
to TiddlyWiki
I created a todo list tiddler system that was working well, except it was using categories (i.e. location contexts) based off of fields in the task item tiddlers.

I decided to switch to tag-based categories, and all my categories are named with a context prefix: "Context_Home", "Context_Out", "Context_Computer".
that way, I can check a task for it's context by using the prefix operator and group them that way.  That is working well.

But, in case I ever forget to put a context tag on a task tiddler, I want to put those at the bottom of the list in their own separate header/category: "No Context Supplied" or something like that.

What I have so far is this, and it's not working....

<$list filter="[!has:tags[]prefix[Context_]tag[Task]]" variable="item">

Here's what I'm trying to do:

Show tiddlers that do have the tag of "Task", but do NOT have a tag that starts with "Context_"

You guys have been so helpful!  Thanks for all the wisdom.  This todo list is really helping me get things done, because it's helping to group things by where I am when I need to do them!

TonyM

unread,
Apr 21, 2020, 3:43:38 PM4/21/20
to TiddlyWiki
David

I argued elsewhere recently to avoid compound keys in titles, but since that's what you have try;

'
<$list filter="[tag[Task]] +[!prefix[context_]]" variable="item">'

which list all items taged task and for each of these tests the prefix. Untested!

tony

David

unread,
Apr 21, 2020, 4:11:55 PM4/21/20
to TiddlyWiki
I don't have compound titles.

These are just tags.  And I feel like I have to use a prefix on the tag for contexts to differentiate that tag from other tags.  For instance, if I have a todo task that should be done at home, I will tag it "Task" and "Context_Home"... two tags.  If I tag it "Task" and "Home", then how do I know if that "Home" tag is a context, or some other thing related to "Home"?

--

Also, thank you for your attempt, butwith your filter, tiddlers are being returned that have a tag of "Context_Home" for instance.  (And yes, I did correct yours to be the right caps.)  Maybe it's looking at the "Task" tag and saying "yes, the Task tag doesn't have that prefix, so I'll fetch that one."

TonyM

unread,
Apr 21, 2020, 4:43:30 PM4/21/20
to TiddlyWiki
David

When at my desktop I will make it work.

I can also share the way I manage contexts.

Fyi I like the fact tags can be made into tiddlers and then sometimes use the tag tiddler to list the tiddlers so tagged. In that case they do become compound keys.

I am talking here of an ideal organising method so its not a criticism of what you are doing just an illustration.

Another way to "categorise tags" is to tag them. An example would be tag new done canceled closed tags with the "status" tag. Then when listing tags on the current tiddler you can test if a given tag is itself tagged status, then you can identify the status tag(s). On in fact there is no status tag on the current tiddler.

Enjoy
Tony

David

unread,
Apr 21, 2020, 4:53:52 PM4/21/20
to TiddlyWiki
That last bit about tagging the category tags with a status tag is interesting.  Do you have the filter for getting those tags via the listWidget?

And I'd have to also be able to list any tiddlers tagged "Task" that didn't have a tag with a category that was status tagged, as well.  Which is our current predicament here, too.

Mat

unread,
Apr 21, 2020, 5:48:46 PM4/21/20
to TiddlyWiki

<$list filter="[tag[Task]] +[!prefix[context_]]" variable="item">'


I think the problem here is that you  get all tiddlers tagged Task but then remove all tiddlers titled with prefix context. Try this:

<$set name=badones filter="[tag[Task]tags[]prefix[Context_]tagging[]]">
<$list filter="[tag[Task]] -[enlist<badones>]"/>
</$set>

<:-)

David

unread,
Apr 21, 2020, 11:40:59 PM4/21/20
to TiddlyWiki
Yes, that worked!  Excellent!  Thanks!

What does the "tagging[]" thing do?

Mat

unread,
Apr 22, 2020, 1:08:13 AM4/22/20
to TiddlyWiki
What does the "tagging[]" thing do?


si

unread,
Apr 22, 2020, 3:53:35 PM4/22/20
to TiddlyWiki
@Tony

Where did you post your thoughts on using compound keys in titles? I am interested in what you had to say.

David

unread,
Apr 23, 2020, 7:33:40 AM4/23/20
to TiddlyWiki
He may have been talking about this thread:

si

unread,
Apr 23, 2020, 11:47:11 AM4/23/20
to TiddlyWiki
@David Great, thank you!
Reply all
Reply to author
Forward
0 new messages