<$button>
<$fieldmangler tiddler=<<currentTiddler>>>
<$set name="digit-pattern4" value="(^[0-9]{5}\s)">
<$list filter="[is[tag]!tag[#]has[toc_inactive]regexp:title<digit-pattern4>]">
<$action-setfield $field='tags' $value={{!!toc_inactive}}/>
<$action-deletefield toc_inactive/>
</$list>
<$set name="digit-pattern3" value="(^[0-9]{4}\s)">
<$list filter="[is[tag]!tag[#]has[toc_inactive]regexp:title<digit-pattern3>]">
<$action-setfield $field='tags' $value={{!!toc_inactive}}/>
<$action-deletefield toc_inactive/>
</$list>
<$set name="digit-pattern2" value="(^[0-9]{3}\s)">
<$list filter="[is[tag]!tag[#]has[toc_inactive]regexp:title<digit-pattern2>]">
<$action-setfield $field='tags' $value={{!!toc_inactive}}/>
<$action-deletefield toc_inactive/>
</$list>
<$set name="digit-pattern1" value="(^[0-9]{2}\s)">
<$list filter="[is[tag]!tag[#]has[toc_inactive]regexp:title<digit-pattern1>]">
<$action-setfield $field='tags' $value={{!!toc_inactive}}/>
<$action-deletefield toc_inactive/>
</$list>
</$set>
</$set>
</$set>
</$set>
</$fieldmangler>
</$button>I try to build some sort of "TOC-toggle" where I want to remove not used TOC-Tiddlers temporarily so that they won't be displayed in the TOC.
The TOC is structured like this:
01
010
011
0110
01100
01111
0111
02
...
Hi,
On Wednesday, February 15, 2017 at 5:20:08 PM UTC+1, The Bo wrote:I try to build some sort of "TOC-toggle" where I want to remove not used TOC-Tiddlers temporarily so that they won't be displayed in the TOC.
The TOC is structured like this:
01
010
011
0110
01100
01111
0111
02
...
Interesting. .. So you don't want the "selective-expandable" but the full TOC. ... But clicking a button you'll want to disable different levels. ... eg:
tree -L 2 will show
01
010
011
02
tree -L 3 will show
01
010
011
0110
0111
02
right. .. but you want to have only one command eg: going from -L 1 directly to -L 4. right?
-mario
Now hypothetically I want to tag Tiddler D with the tag "01110" which is currently inactive. This is the point where I'm searching for a solution to toggle the tiddlers "0111" and "01110" with one click.
01 Topictiddler
010 Subtopic <- imo should not be shown, right?
011 Subtopic
0110 Subsubtopic
01100 Subsubsubtopic
Tiddler A
0111 Subsubtopic
01110 -> There is no Tiddler connected, so I want to toggle this tiddler
0111 has the "expand icon" because 01110 exists. ... _but_ .... 01110 has no "content tiddler" so it is basically empty. ... that's why you don't want to show the branch, if there is no leaves. .. where a leave is eg: Tiddler A. right?
I'm thinking about a possibility to have a similar mechanism than "toc-link:no" feature. It may be a "toc-expand:no", which would affect the "expandable >" icon. It would be suppressed. The problem now is: If you already suppressed lower branches you'd still have to enable them too :/
Yes, exactly!
Right now every empty branch is already not visible because I put the tags into the field "toc_inactive" and deleted the tags afterwards with an action widget.
So the target is to bring back the complete branch by just one click if there is a new tiddler tagged with an inactive tiddler.