Exclude child node tags from Table of Contents

已查看 107 次
跳至第一个未读帖子

張淑慧

未读,
2018年2月19日 09:02:422018/2/19
收件人 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

未读,
2018年2月19日 10:13:162018/2/19
收件人 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

未读,
2018年2月19日 10:19:202018/2/19
收件人 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.

未读,
2018年2月20日 00:04:042018/2/20
收件人 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

張淑慧

未读,
2018年2月20日 04:58:052018/2/20
收件人 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.
回复全部
回复作者
转发
0 个新帖子