Exclude child node tags from Table of Contents

107 views
Skip to first unread message

張淑慧

unread,
Feb 19, 2018, 9:02:42 AM2/19/18
to TiddlyWiki
Hi everyone,

I'm new to TW5 and it's been great so far! I'd like to know if there's a way to exclude certain tags from my table of contents. For example, I have a toc set up like the list of categories you may find on a blog, but I'd like to exclude the journal tiddlers themselves from appearing in the toc. Something like:

Root tag
- Category
-- Subcategory
--- Journal Tiddlers <<< Could I exclude this?
-- Subcategory
- Category
- Category

I thought I'd be able to filter all tiddlers tagged with Journal from this post but that value's for the top level of the tree. I've checked out the toc macro, but right now I could only understand perhaps half of it. Would be grateful for any help.

Thank you!

PMario

unread,
Feb 19, 2018, 10:13:16 AM2/19/18
to TiddlyWiki
On Monday, February 19, 2018 at 3:02:42 PM UTC+1, 張淑慧 wrote:
Hi everyone,

I'm new to TW5 and it's been great so far! I'd like to know if there's a way to exclude certain tags from my table of contents. For example, I have a toc set up like the list of categories you may find on a blog, but I'd like to exclude the journal tiddlers themselves from appearing in the toc. Something like:

Root tag
- Category
-- Subcategory
--- Journal Tiddlers <<< Could I exclude this?

Yes, if you don't tag it with "Subcategory"

-m

PMario

unread,
Feb 19, 2018, 10:19:20 AM2/19/18
to TiddlyWiki
Hi,

If you need your tags, I did create a different type of TOC it's called tocP .. Parent based TOC.

https://wikilabs.github.io/editions/tocP/

It uses a field name "parent" to create a TOC like structure. .. The "parent" field is just a convention. So you can use different field names, to create different TOCs. ... As many as you need.

have fun!
mario

Mark S.

unread,
Feb 20, 2018, 12:04:04 AM2/20/18
to TiddlyWiki
I notice that several (all?) of the TOC macros have an undocumented parameter, exclude.

So you might be able to use:

<<toc-expandable tag:"MyRoot" exclude:"-[tag[Journal]]">>

Good luck!
Mark

張淑慧

unread,
Feb 20, 2018, 4:58:05 AM2/20/18
to tiddl...@googlegroups.com
Thank you Mario and Mark! I ended up modifying the toc macro and added !tag[Journal] to the lists. Mark's solution worked but the selective arrow appears even though the tagged tiddlers are hidden.
Reply all
Reply to author
Forward
0 new messages