Hi Stefan,
It looks like you'd like to modify the behaviour of the
toc-selective-expandable macro. The necessary changes for this particular
case would be contained within the toc-linked-selective-expandable-body
macro. Both are defined in $:/core/macros/toc.
You'd need to redefine (override) toc-linked-selective-expandable-body to:
1) remove the tiddler link
2) display the tiddler's caption/title within the fold/unfold button, for
tiddlers that have more tiddlers downstream in the ToC, and
3) display the tiddler's caption/title by itself for tiddlers that have
nothing below them in the ToC hierarchy. (If you wanted, you could make
just these captions tiddler links)
I suggest making a new macro tiddler (tag it with $:/tags/Macro) with
something like the following in it. I've highlighted (I think) all the
changes I made. Obviously anything that's commented out could just be
removed.
\define
toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
<$qualify name="toc-state" title={{{
[[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>]
}}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>>
emptyValue="toc-item-selected" value="toc-item" >
<li class=<<toc-item-class>>>
<!--<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>]
}}}> -->
<$list filter="[all[current]tagging[]$sort$limit[1]]"
variable="ignore" emptyMessage="<$button
class='tc-btn-invisible'>{{$:/core/images/blank}} <<toc-caption>>
</$button>">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open"
class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close"
class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}<<toc-caption>>
</$button>
</$reveal>
</$list>
<!-- <<toc-caption>> -->
<!--</$link> -->
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>>
sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>>
exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$qualify>
\end
The definition of toc-caption can be found at the top of $:/core/macros/toc.
Hope that helps,
Chris
On Tuesday, January 12, 2021 at 2:49:24 AM UTC-5 [email protected]
wrote:
> Hello,
>
> I would like to expand the next level of entries by clicking on title in
> TOC ( as it is by clicking on '>') instead of opening the tiddler.
>
> [image: TOC behavior.jpg]
>
> How can I archieve that?
>
> Thanks
> Stefan
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/d44023fa-3491-4d82-b448-47086900443en%40googlegroups.com.