Table of content showing only tags with a tag count greater than zero

58 views
Skip to first unread message

Stuart Amor

unread,
Jan 4, 2019, 5:47:01 PM1/4/19
to TiddlyWiki
I am trying to create an itinerary catalogue. l have spent a great deal of time devising a tag directory structure that will allows me to add individual item tiddlers into an organised tree. The problem l have is that I now have a Table of Contents containing a great deal of "empty directories". l don't want to delete these tags as l will hopefully get around to adding content to them, but l would like to find away of hiding these tags from my Table of Contents where the tag count is zero?

I will try to give you an example:

Workshop Tools
- Hammers
-- Sledge Hammer
-- Claw Hammer
- Spanner <- Hide this tag from the toc until I have added some tagged entries 

TonyM

unread,
Jan 4, 2019, 6:12:57 PM1/4/19
to TiddlyWiki
Stuart,

The Tiddler $:/core/macros/toc is where the toc macros are defined. However they can be quite complex. However we can see there is an exclude parameter used. Also See https://tiddlywiki.com/#Table-of-Contents%20Macros for the documentation.

Try invoking the TOC macro of your choice with the following format

<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> exclude="exclusionfilter" />

Where exclusionfilter is where "where the tag count is zero"

Personally I would build my own, toc macro for such an example. 

Regards
Tony

Stuart Amor

unread,
Jan 6, 2019, 5:17:55 PM1/6/19
to TiddlyWiki
Thank you Tony, I agree that it should perhaps be done as a separate function rather than an adaptation, but I could do with more of a steer on how to exclude tags with a zero count from a tag list 
Reply all
Reply to author
Forward
0 new messages