Nested Tags on TOC SideBar

110 views
Skip to first unread message

justinehe...@gmail.com

unread,
Aug 23, 2020, 3:06:52 AM8/23/20
to TiddlyWiki

So I have a Journal tag and the Tiddlers are tagged between 2017-2020. What I wanted is to have my 2017-2020 tags to be under the Journal tags on my Sidebar so I can be able to browse my tiddlers easily and also have a number of tiddlers that are in the tags.

TW Tones

unread,
Aug 23, 2020, 11:23:10 PM8/23/20
to TiddlyWiki
Justine?

You may need to spell this out in a few more sentences. An example would be great, the more you help us understand, the easier it is for us to help you.

Tones.

justinehe...@gmail.com

unread,
Aug 24, 2020, 12:36:00 AM8/24/20
to TiddlyWiki
Here is a screenshot of what I meant haha. The Dates are under Journal with the number of tiddlers in the tags. Hope you understand!
Screenshot_1.png

TW Tones

unread,
Aug 24, 2020, 3:28:49 AM8/24/20
to TiddlyWiki
Hi,

So there is a tiddler called 2020 that tags 50 days or it it just a section for all Journals with the year 2020?

Perhaps show us what one of the 200 tiddlers looks like, its tags or title?

If what you want is as we see, in your image there is no reason not to make you own tab, rather than try and play with the tags functions.

We could also add a batch to add a "year" tag to all Journals, then you could use the year tags?


Regards
Tony

jin

unread,
Aug 24, 2020, 4:01:16 AM8/24/20
to TiddlyWiki
I guess I'll just try and play with the tags functions first, thank you. :)

TW Tones

unread,
Aug 24, 2020, 4:05:35 AM8/24/20
to tiddl...@googlegroups.com
The following will list all tiddlers with a Journal tag and extract the year number from the title,
  • If you are using the default journal title format DDth MMM YYYY
  • If you were using the created date or a journal date you could use first[4] rather than last[4]
<$list filter="[all[]tag[Journal]]">
   <$set name=year filter="[{!!title}split[]last[4]join[]]">
        <
<year>>  
   </$set>
</$list>

Now wrap this in a button to trigger it, and add an action widget to add a tag to each tiddler for the year
For such messages we need to use the fieldmangler widget.
<$button>
<$list filter="[all[]tag[Journal]]">
<$fieldmangler>
   <$set name=year filter="[{!!title}split[]last[4]join[]]">
       <$action-sendmessage $message="tm-add-tag" $param=<
<year>>/>
   </$set>
</$fieldmangler>
</$list>
Add tag for year
</$button>

I will give you more soon.
Tones

jin

unread,
Aug 24, 2020, 4:20:32 AM8/24/20
to TiddlyWiki
Thank you so much! :DD
On Monday, 24 August 2020 at 16:05:35 UTC+8 TW Tones wrote:
The following will list all tiddlers with a Journal tag and extract the year number from the title,
  • If you are using the default journal title format DDth MMM YYYY
  • If you were using the created date or a journal date you could use firet[4] rather than last[4]

TW Tones

unread,
Aug 24, 2020, 4:29:31 AM8/24/20
to TiddlyWiki
This variation also adds the year to the year field to make life easier.

<$button>
<$list filter="[all[]tag[Journal]]">
<$set name=journal-tiddler value=<<currentTiddler>> >

<$fieldmangler>
   <$set name=year filter="[{!!title}split[]last[4]join[]]">
       <$action-sendmessage $message="tm-add-tag" $param=<
<year>>/>
       <$action-setfield $field=year $value=<
<year>> />
   </$set>
</$fieldmangler>
</$set>

</$list>
Add tag for year
</$button>

I have attached my New Journal and New Journal here overwite of core tiddlers here. This results in a Journal-date being set, so titles can change and all journal dates will be valid. 

You could add the above actions ito it so the year field is populated at creation time.

Just ask if you want me to update the macros and show you how to list using year fields.

Regards
Tony

journal-date.json

jin

unread,
Aug 24, 2020, 4:38:30 AM8/24/20
to TiddlyWiki
I'll check this out, thank you again!
Reply all
Reply to author
Forward
0 new messages