Re: self-editing table of contents snippet

142 views
Skip to first unread message
Message has been deleted

Mark S.

unread,
Jan 11, 2021, 4:12:16 PM1/11/21
to TiddlyWiki
I think you may want something like:

<div class="tc-table-of-contents">

<$macrocall $name=toc-selective-expandable tag=<<currentTiddler>>  />

</div>


On Monday, January 11, 2021 at 9:29:58 AM UTC-8 dlu...@emich.edu wrote:
Is there a way to replace 'TableOfContents' with the title of the containing tiddler when using the construct below that is inserted as a preconfigured snippet while editing? I've tried inserting things like {{!!title}}, but can't make it work the way I want. I want to be able to add a snippet to a tiddler so it builds its own table of contents without having to edit the snippet every time.

Thanks in advance. You guys are the best!

<div class="tc-table-of-contents">

<<toc-selective-expandable 'TableOfContents'>>

</div>
Message has been deleted

Captain Packers

unread,
Dec 23, 2021, 8:53:48 AM12/23/21
to TiddlyWiki
I can't figure out how to add sorting to this, so that if journal entries is tagged with this tiddler, they appear reverse sorted by title so the newest entry appears at the top of the list. I've tried adding !sort[title] to the end of the line, just before the '/>', but then it just appears in the tiddler body as text and defeats the entire action of the toc code.

Odin

unread,
Dec 23, 2021, 10:36:11 AM12/23/21
to TiddlyWiki
Documentation of the macro is here: https://tiddlywiki.com/#Table-of-Contents%20Macros

It has a sort parameter, so you'll have to add sort="!sort[title]", so it's knows what to do with the filter.

```
<div class="tc-table-of-contents">

<$macrocall $name=toc-selective-expandable tag=<<currentTiddler>> sort="!sort[title]"/>

</div>
```
Op donderdag 23 december 2021 om 14:53:48 UTC+1 schreef Captain Packers:
Message has been deleted

Captain Packers

unread,
Jan 4, 2022, 12:08:47 PM1/4/22
to TiddlyWiki
Works like a charm! Thanks!
Reply all
Reply to author
Forward
0 new messages