Expandable TOC using list instead of tag

233 views
Skip to first unread message

Mohammad

unread,
Jul 22, 2018, 12:10:42 PM7/22/18
to TiddlyWiki

Is there any way to have a toc macro to make an expandable table of content using list field instead of tag filed?


Mark S.

unread,
Jul 22, 2018, 12:26:42 PM7/22/18
to TiddlyWiki
How are you imagining that working? How would a list field act like tags?

-- Mark

Mohammad

unread,
Jul 22, 2018, 1:24:35 PM7/22/18
to tiddl...@googlegroups.com
Mark,
 I use the following code to add tiddlers to the list field of a root tiddler.

<<list-links-draggable tiddler:$(currentTiddler)$ type:"ol" class:"mycls" itemTemplate:"tmplDraggable">>

Then I would like to have an expandable toc at the sidebar to have the root as a toc item and then all tiddler in the list as its children!


The problem with current approach is, I have root items with long titles and it annoying to have such long title as tag for the child tiddler (the second level items in TOC)
What do you think?

-Mohammad

Mark S.

unread,
Jul 22, 2018, 2:54:13 PM7/22/18
to TiddlyWiki
If it's just the long title used as a tag that's a problem, why not use the caption field (or any other short designator field).

e.g.

\define mymacro2(caption) <<toc $caption$>>

<$macrocall $name="mymacro2" caption={{!!caption}}/>

-- Mark

Mohammad

unread,
Jul 22, 2018, 3:36:39 PM7/22/18
to TiddlyWiki
This teaches me I can use many ways to produce a TOC.

Thanks Mark.

PMario

unread,
Jul 22, 2018, 3:55:41 PM7/22/18
to TiddlyWiki
Hi,

Not 100% what you want, but a different way to create a parrent based TOC.


-m

TonyM

unread,
Jul 22, 2018, 8:41:59 PM7/22/18
to TiddlyWiki
Mario,

In support of tocp and heirachies, I also cloned the newhere button and added the parent field with the value of the tiddler not only the tag.

Regards
Tony

PMario

unread,
Jul 23, 2018, 3:34:52 AM7/23/18
to TiddlyWiki
On Monday, July 23, 2018 at 2:41:59 AM UTC+2, TonyM wrote:
In support of tocp and heirachies, I also cloned the newhere button and added the parent field with the value of the tiddler not only the tag.

There is no need to create a new-here button. The plugin contains a "new-child-here" button. You just need to activate it!

Open the the tiddler info-area: tools-tab  ... There are 2 elements with the same function, but a different icon.

-m

Mohammad

unread,
Jul 23, 2018, 7:59:14 AM7/23/18
to TiddlyWiki
Thank you Mario!

Cheers
Mohammad
Reply all
Reply to author
Forward
0 new messages