Two simple TOC questions: Omit when toc-link: no? Get TOC content pane to show title (as link)?

51 views
Skip to first unread message

springer

unread,
Jan 7, 2020, 2:10:11 PM1/7/20
to TiddlyWiki
I'm loving the TOC macro! Having just happily discovered the toc-link field description, I set that field to "no" for each of two utility tiddlers that play template-related roles for Unit A, eager to have students see only the more legit "children" of Unit A tag in my main TOC...

But now I see that my 2 utility tiddlers still appear in my main toc, just as unlinked titles. I had imagined  something more like a toc-include field, I guess. 

Can I easily tweak the toc's display code so that it omits tiddler names iff toc-link is "no"? This may be simple for one of you, but not for me! :| And perhaps such code would be useful for others whose sites have an editor vs audience distinction...

While I'm at it, I'll ask a simple related TOC question/request: At the top of the TOC content pane, I'd love to have not the "caption," but the actual title. (The "caption" is great for compactness when it appears in places like TOC left pane, or tabsets, since context allows abbreviation (caption "excerpts" appears as child of a named text, for example). But once the tiddler becomes the focus of attention, the full title ("Excerpts from Epictetus' Enchiridion") is needed for clarity.

Even better, when I have "display titles as links" set to "on", I would love for that title -- at the top of the toc content pane -- to open as a separate tiddler (while all other internal links behave in the usual toc-internal way).

(I realize toc-internal is not mainly designed for opening the tiddler separately. But I want my primary "audience" (students) to get the elegant internal TOC experience, though that same simplicity is currently an obstacle when I'm editing and suddenly see the need to revise the tiddler being displayed in the content pane.)

-Springer

springer

unread,
Jan 10, 2020, 3:45:41 PM1/10/20
to TiddlyWiki
Somehow this TOC post flew under the radar, or didn't spark any interest. I've since rummaged around and figured out a partial solution to one of the two questions.

I restored real title headings to the top of the TOC content pane (as opposed to captions) by editing the shadow tiddler
   $:/core/macros/toc
and replacing 
<h1><<toc-caption>></h1>
(toward the end, in section starting 
\define toc-tabbed-external- )
with
<h1><$link><$view field='title'/></$link></h1>

But after throwing nearly an hour at it, I still am having no success at getting the toc-link[no] tiddlers to disappear altogether from the TOC left pane. 

Cheers!

-Springer
Reply all
Reply to author
Forward
0 new messages