Linked Titles in toc-tabbed-external-nav

57 views
Skip to first unread message

Pieter-Michiel Geuze

unread,
Oct 1, 2020, 6:11:21 AM10/1/20
to TiddlyWiki
I am looking at using the toc-tabbed-external-nav table of contents but I have not been able to make the the internal tab tiddler title a link. I would like the title to be a link so I can open the tiddler as external so I can then make edits.

Please let me know what I am missing?

Thank you.


2020-10-01 05_24_17-My TiddlyWiki —.jpg

TW Tones

unread,
Oct 1, 2020, 7:08:57 AM10/1/20
to TiddlyWiki
Pieter-Michiel,

You are using the macro $name="toc-tabbed-internal-nav", search with the advanced search shadows and you find it defined in $:/core/macros/toc

At the bottom you can see the definition of toc-tabbed-internal-nav

\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
<$linkcatcher to=<<__selectedTiddler__>>>
 
<$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>>/>
</
$linkcatcher>
\end

  1. This macro calls toc-tabbed-external-nav
  2. But we see in toc-tabbed-external-nav that it appears the heading is displayed using
    <h1><<toc-caption>></h1>

  3. This toc-caption macro is defined at the top and does not give a link, just the title.
  4. Lets add a link here (2) <$link to=<<currentTiddler>> >Open</$link>
  5. You will soon discover clickin Open seems to do nothing, but that is because you are using toc-tabbed-internal-nav
  6. Use toc-tabbed-external-nav macro instead to open links in the story and this will work if you add this link after toc-caption in toc-tabbed-external-nav.
  7. <h1><<toc-caption>></h1> BECOMES <h1><<toc-caption><$link to=<<currentTiddler>> >Open</$link></h1>
Regards
Tony

Pieter-Michiel Geuze

unread,
Oct 1, 2020, 10:57:42 AM10/1/20
to TiddlyWiki
Thank you. I see the change in the code, and your explanation helps me understand how the code works with the changes that you recommended.
Reply all
Reply to author
Forward
0 new messages