I guess I should be clearer about the structure I'm looking at here:
- Root
- Parent
- Child1
- Child2
- Child21
- Child22
- Child23
Suppose that each of (Child21, Child22, Child23) are all tagged with
"Parent", in addition to being tagged with "Child2" (so they fit there
under the hierarchy). I don't want those three grandchildren to *also* show
up directly under "Parent". Does that make sense?
On Monday, November 2, 2020 at 10:06:25 PM UTC-7 Jon Dyer wrote:
> At this link there are basic instructions for changing the sort order of
> the table of contents using the toc macro:
> https://tiddlywiki.com/#How%20to%20change%20the%20sort%20order%20of%20sub-branches%20in%20a%20TOC%20macro
> (also
> see https://tiddlywiki.com/#Table-of-Contents%20Macros). I would like to
> have more control over how the actual tagging/filtering is done.
> Specifically, I would like to recursively apply a filter so that any list
> items that are tagged with a sub-category are excluded from the parent
> category, even if they are also tagged with the parent category.
>
> Let me illustrate. I got it to work using the *list* field in the parent
> category with the *list-links* macro like so:
>
> <<list-links "[tag<currentTiddler>] -[{!!list}split[ ]tagging[]]">>
>
> with a *list* field like this:
> Subcategory1 Subcategory2
>
>
> But try as I might I can't get a similar thing to work in the Table of
> Contents. Things like the following don't work:
> <div class="tc-table-of-contents">
> <<toc-selective-expandable tag:"Contents" exclude:"[{!!list}split[
> ]tagging[]]" >>
> </div>
>
>
> Or hacks like this:
> <div class="tc-table-of-contents">
> <<toc-selective-expandable tag:"Contents" sort:"[{!!list}split[
> ]tagging[]" >>
> </div>
>
>
> I've spent too many hours on this now (not wasted though! I've learned
> much about filters in TW). Any tips on how to achieve what I want? I'm sure
> there's a clever set of filters that I just can't quite get right. I'm also
> not afraid to edit the core toc macro if needs be. Thanks!
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/49da448a-c2e0-471c-a489-21460882d0aen%40googlegroups.com.