1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-15 22:34:51 +00:00

Add a template to the tabbed TOC macro

Fixes #1177
This commit is contained in:
Jermolene 2014-12-02 20:27:02 +00:00
parent 64a905b9f8
commit b220c19fb7
2 changed files with 5 additions and 4 deletions

View File

@ -162,7 +162,7 @@ tags: $:/tags/Macro
[all[current]field:title{$selectedTiddler$}] [all[current]field:title{$selectedTiddler$}]
\end \end
\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText) \define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,template:"")
<$tiddler tiddler={{$selectedTiddler$}}> <$tiddler tiddler={{$selectedTiddler$}}>
<div class="tc-tabbed-table-of-contents"> <div class="tc-tabbed-table-of-contents">
<$linkcatcher to="$selectedTiddler$"> <$linkcatcher to="$selectedTiddler$">
@ -172,15 +172,15 @@ tags: $:/tags/Macro
</$linkcatcher> </$linkcatcher>
<div class="tc-tabbed-table-of-contents-content"> <div class="tc-tabbed-table-of-contents-content">
<h1><$view field="caption"><$view field="title"/></$view></h1> <h1><$view field="caption"><$view field="title"/></$view></h1>
<$transclude mode="block">$unselectedText$</$transclude> <$transclude mode="block" tiddler="$template$"><$transclude mode="block">$unselectedText$</$transclude></$transclude>
</div> </div>
</div> </div>
</$tiddler> </$tiddler>
\end \end
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText) \define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,template:"")
<$linkcatcher to="""$selectedTiddler$"""> <$linkcatcher to="""$selectedTiddler$""">
<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$"""/> <$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$""" template="""$template$"""/>
</$linkcatcher> </$linkcatcher>
\end \end

View File

@ -13,6 +13,7 @@ The tabbed table of contents macro renders a selective expandable table of conte
|2nd |sort |Optional sorting subfilter (eg `sort[title]`) | | |2nd |sort |Optional sorting subfilter (eg `sort[title]`) | |
|3rd |selectedTiddler |Title of the tiddler containing the title of the currently displayed tiddler |"$:/temp/toc/selectedTiddler" | |3rd |selectedTiddler |Title of the tiddler containing the title of the currently displayed tiddler |"$:/temp/toc/selectedTiddler" |
|4th |unselectedText |Text to be displayed when no tiddler is selected | | |4th |unselectedText |Text to be displayed when no tiddler is selected | |
|5th |template |Optional title of a tiddler to be used as a template for rendering the selected tiddler | |
!!! Internal navigation !!! Internal navigation