<<toc-selective-expandable tag:"lecture" sort:"sort[caption]">>
\define toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path)<$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path="""$path$/$tag$"""> <ol class="tc-toc toc-selective-expandable"> <$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$"""> <$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> > <$macrocall $name=toc-unlinked-selective-expandable-body tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude=<<excluded>> path=<<path>> > </$list> </$list> </ol></$vars>\end<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$""">
\define toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path)<$vars tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> excluded="""[enlist<__exclude__>] -[<__tag__>]""" path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}> <ol class="tc-toc toc-selective-expandable"> <$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]"""> <$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> > <$macrocall $name=toc-unlinked-selective-expandable-body tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>> > </$list> </$list> </ol></$vars>\endAs you can see if you look on top of it, it accepts an "exclude" attribute
this is the filter where your exclude filter would be used:<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$""">
If you want to exclude - say - all tiddlers tagged "bla" you pass exclude:"-[tag[bla]]" or all tiddlers with the field "blu" exclude:"-[has:field[blu]]"