Soren,
Given this thread, I am not sure if I am on track here, but reading your Original post it seems so.
As I understand it you want to use a filter in a tab tiddler to determine if it should have the tab displayed.
The thing is the tabs macro is not designed for conditional tab display, it simply wants a list of tiddlers. If this could all be rammed into a single filter then all would be fine. However you not only want to make use of another variable or in this case a field but that field contains a filter. This is asking too much of the filter syntax.
What I have done in my solution was to generate the list of tiddlers that would be tabs according to you conditions and feed only the result to the tabs macro.
- In my small test not performance issues, and I do not expect their to be
- I think what is happening in your case if the reduce etc... is adding unnecessary complexity to the performance of the tabs macro.
Here is the core logic tested on
tiddlywiki.com and pre-release incidentally.
\define tabs-with-content()
<$list filter="[tag[Tag]]" >
<$list filter="[all[current]get[filter]]" variable=found-filter>
<$list filter="[subfilter<found-filter>count[]!match[0]then<currentTiddler>]">
</$list>
</$list>
</$list>
\end
<$wikify name=tabs-with-content text="<<tabs-with-content>>">
<$macrocall $name=tabs tabsList=<<tabs-with-content>> template="tabtemplate"/>
</$wikify>
If this does not make sense I will package the tiddlers in this test for you.
The above example may be a good test case if we wanted to invent a method to make filters more sophisticated basically permit ones that allow you to avoid the nested lists I used, however as stated previously dont be shy using nested lists, because each level of nesting allows to generate a new variable and keep the old ones in this case found-filter while keeping currentTiddler from the first filter.
My preference would be a shorthand method when presenting variables as a parameter, in this case <<tabs-with-content>> such that it is first wikified rather than using the ungainly wikify widget and its need to wrap the macro call. Eg a a parameter ((tabs-with-content)) or in filters (tabs-with-content)
Alternatively TiddlyWiki would detect the need for wikification of that variable/macro and do it itself.
Regards
tones