On Sunday, November 12, 2017 at 12:58:33 AM UTC-8, Daniel S. wrote:
>
> i would like to auto collapse all first layer branches of my 
> toc-selective-expandable on startup. That means, instead of
>
> > Layer 1 LinkA
> > Layer 1 LinkB
> > Layer 1 LinkC
>
> i would like to have something like this when opening the tiddlywiki:
>
> > Layer 1 LinkA
>    > Layer 2 Link F
>       Layer 2 Link G
> > Layer 1 LinkB
>    > Layer 2 ...
>    > Layer 2 ...
>    > Layer 2 ...
> > Layer 1 Link C
>       Layer 2 ...
>       Layer 2 ...
>
> Is that possible without hacking the toc-selective-expandable to much? 
> Maybe even within the Layer 1 Tiddlers by setting a state to expanded or 
> something like that?
>

You could use a <$list> widget to manually display the top level *outside* 
the toc-selective-expandable, and then use toc-selective-expandable for the 
inner levels.  Something like this:

<div class="tc-table-of-contents">
<$list filter="[tag[Layer1]]">
<$button class="tc-btn-invisible">{{$:/core/images/right-arrow}}</$button>
<$link><b><$text text=<<currentTiddler>>/></b></$link>
@@display:block;margin-left:1em; <$macrocall 
$name="toc-selective-expandable" tag=<<currentTiddler>>/>@@
</$list>
</div>

The result is that you *always* display the top level ("Layer1") items 
opened, while the inner levels behave as usual for the TOC macro (i.e., 
default to 'closed', click to expand).

Note: I did *some* layout formatting and styling to make it look mostly 
like the TOC at the top level, but you will want to adjust the 
formatting/styles to suit your needs.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas" (tm)
InsideTiddlyWiki: The Missing Manuals

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8d83f277-3422-4eeb-a78d-e14a1ea9fa89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to