From b220c19fb7b789eb6d00c9d1a71414676d87130e Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 2 Dec 2014 20:27:02 +0000 Subject: [PATCH] Add a template to the tabbed TOC macro Fixes #1177 --- core/wiki/macros/toc.tid | 8 ++++---- .../TableOfContentsMacro Tabbed Example.tid | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 6359f0abd..1d90eda36 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -162,7 +162,7 @@ tags: $:/tags/Macro [all[current]field:title{$selectedTiddler$}] \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$}}>
<$linkcatcher to="$selectedTiddler$"> @@ -172,15 +172,15 @@ tags: $:/tags/Macro

<$view field="caption"><$view field="title"/>

-<$transclude mode="block">$unselectedText$ +<$transclude mode="block" tiddler="$template$"><$transclude mode="block">$unselectedText$
\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$"""> -<$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$"""/> \end diff --git a/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid b/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid index 2c2082920..60a545d8e 100644 --- a/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid +++ b/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid @@ -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]`) | | |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 | | +|5th |template |Optional title of a tiddler to be used as a template for rendering the selected tiddler | | !!! Internal navigation