Hello,
I have a macrocall
<$macrocall $name=toc-selective-expandable tag={{!!title}}
How could I add a “not a specific tag” AND another tag filter to it please ?
Thanks
Hello,
I have a macrocall
<$macrocall $name=toc-selective-expandable tag={{!!title}}
How could I add a “not a specific tag” AND another tag filter to it please ?
Thanks
Hi,
There is no official way at the moment, but there is a “hacky” way. … The macro has an “exclude” parameter, that is internally used, to avoid recursions. So eg: A tags B and B tags A … Which would create an endless loop.
This parameter can be used. Internally the macro uses -[enlist<__exclude__>]
to filter out tiddlers, that have already been used.
So if you call it:
<$macrocall $name=toc-selective-expandable tag={{!!title}} exclude={{{ [enlist[A B]] }}}/>
It will not use tiddler: A and tiddler: B in your toc.
A more flexible approach should be to use a “list variable”
<$set name="myList" filter="[tag[hide]]">
<$macrocall $name=toc-selective-expandable tag={{!!title}} exclude=<<myList>> />
</$set>
This will exclude every tiddler tagged: “hide”
The important thing is: myList needs to contain a list. So if you test it and [enlist<myList>]
shows you a list the parameter should work for the toc-xxx macros.
I was delighted to find this, but…
This trick fails for toc-tabbed-external-nav and toc-tabbed-internal-nav (which is, of course, what I want it for).
Try it at tiddlywiki.com:
<$set name="myList" filter="[tag[Mathematics Operators]]">
<$macrocall $name=toc-tabbed-internal-nav tag="Filter Operators" exclude=<<myList>> />
</$set>
(In the resulting tabbed toc, Mathematics Operators are not excluded.)
Any ideas, or workarounds?
If you look inside $:/core/macros/toc you will notice the two you mention do not define the exclude parameter.
Fix
[Post Script] Table-of-Contents Macros documentation needs be updated as exclude is not even mentioned.
Thanks for chiming in!
Alas, I would not call that a workaround. The difference between the tabbed toc macros and the others is a total difference of function, for some purposes.
If I get desperate, I may try to clone the macro and make a version that works with any title list from a filter, rather than accepting only a tag… and this would solve other challenges as well. Alas, it’s not something I should devote time to at the moment…