A List of Checkboxes that will delete and add tags to Tiddlers

267 views
Skip to first unread message

Drake Shadwell

unread,
Sep 3, 2016, 12:30:38 PM9/3/16
to TiddlyWiki
I use Tiddly Wiki for a lot different journals, projects, etc... I like to write, revise, complete. I would like to have that in a list on my home screen. Right now I have it so that it will compile a list of Tiddlers that do NOT have a tag and then when the check box is checked it will add that tag to the Tiddler. However, what I want is for it to have a list of Tiddlers with a tag (let's say "Journal") and a tag of something like "In Progress". Once I check the box, I want "In Progress" tag to be deleted and "Revisions Needed" tag to be added. That will then move it to a completely new, different list where the same thing will happen, but "Needs Revision" will become "Completed".

The code that I'm using so far is:

<$list filter="[!has[draft.of]tag[In Progress]sort[created]]">

<$checkbox tag="In Progress"><$link to={{!!title}}><$view field="title"/></$link></$checkbox>
</$list>


This does almost what I want, but it's really annoying because the checkbox is CHECKED and I have to UNCHECK it in order to delete the "In Progress" tag. I would much have it the normal way a checkbox works. It also doesn't add the "Needs Revision" tag that I want.

Mark S.

unread,
Sep 3, 2016, 7:14:52 PM9/3/16
to TiddlyWiki
I'm not sure I understand your point about having to uncheck the "In Progress" checkbox. Since it's tagged as "In Progress", naturally it will show up as checked. The alternative would be for it to show "unchecked" even when the tag is present.

If for some reason you do want the checkbox to show just the opposite of the actual status, there is now an attribute that you can add to the checkbox widget:

invertTag=yes

If you want a single object that both removes tag "In Progress" and also adds tag "Needs Revision", you can do it with a button instead of a checkbox inside of a field mangler widget. The stand-alone code would look like:

<$fieldmangler>
<$button>In Progress
<$action-sendmessage $message="tm-remove-tag" $param="In Progress"/>
<$action-sendmessage $message="tm-add-tag" $param="Needs Revision"/>
</$button>
</$fieldmangler>

 You would need to put that inside of your <$list> of course.

Good luck,
Mark

Matabele

unread,
Sep 4, 2016, 12:52:18 AM9/4/16
to TiddlyWiki
Hi Drake

Option 1: If you wish to cycle through a list of alternative tags, say 'In Progress --> Revisions Needed --> Completed' -- there is a possible solution over on the ActionListops wiki

Scroll through the slides to 'keep Operator (Examples), then scroll down to the bottom example. Each click of one of a tag will select the next option in the list.

This functionality requires a couple of filters which aren't yet in the core -- you will need to copy over the extended listops filters from the wiki.

Option 2: (if you prefer checkboxes) you might make use of the CheckList widget -- there are a few examples on the wiki -- unfortunately, none match your exact requirements. 

I think the functionality of the cycle[] and keep[] operators would be required (from Option 1) to clear the last tag selected -- fake checkboxes could always be used instead of the tag buttons.

regards

c pa

unread,
Sep 7, 2016, 8:02:17 PM9/7/16
to TiddlyWiki
So if I read you right. You want something like this:
1. Starts with a tag that identifies an item "item"
    a. If you want all tiddlers to be an item, Add this code

Add a tiddler as an item
<ul>
<$list filter="[all[tiddlers]] -[is[system]!has[tags]] -[tag[item]]" variable="none">
    <li><$checkbox tiddler=<<none>> tag="item"> <<none>></$checkbox></li>
</$list>
</ul>

2. Tags The item as "started" to put it on the started list
3. Tags The item as "inProgress" to put it on the In Progress list
4. Tags The item as "done" to put it on the Done list
5. If you uncheck a "done" item, it sends it back to InProgress

<ul>
   <li>Ready <ul>
      <$list filter="[tag[item]] -[tag[started]] -[tag[InProgress]] -[tag[done]]" variable="none">
         <li><$checkbox tiddler=<<none>> tag="started" >
               <<none>></$checkbox></li>
       </$list>
    </ul></li>
    <li>Started <ul>
      <$list filter="[tag[item]tag[started]] -[tag[InProgress]] -[tag[done]]" variable="none">
         <li><$checkbox tiddler=<<none>> tag="InProgress" >
               <<none>></$checkbox></li>
       </$list>
    </ul></li>
    <li>In Progress<ul>
      <$list filter="[tag[item]tag[InProgress]] -[tag[done]]" variable="none">
         <li><$checkbox tiddler=<<none>> tag="done" >
               <<none>></$checkbox></li>
       </$list>
    </ul></li>
    <li>Done <ul>
      <$list filter="[tag[item]tag[done]]" variable="none">
         <li><$checkbox tiddler=<<none>> tag="done" >
               <<none>></$checkbox></li>
       </$list>
    </ul></li>
</ul>

Reply all
Reply to author
Forward
0 new messages