1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 18:47:20 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid

43 lines
2.2 KiB
Plaintext
Raw Normal View History

2014-11-13 21:39:28 +00:00
title: TableOfContentsMacro Tabbed Example
caption: Tabbed
tags: table-of-contents-example
!! Tabbed Table of Contents
The tabbed table of contents macro renders a selective expandable table of contents with an attached panel that displays the currently selected tiddler.
!!! Parameters
|!Position |!Name |!Description |!Default |
|1st |tag |Tag to be used for constructing the table of contents | |
|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 | |
2014-12-02 23:47:23 +00:00
|5th |missingText |Text to be displayed when the selected tiddler is missing | |
|6th |template |Optional title of a tiddler to be used as a template for rendering the selected tiddler | |
!!! Internal navigation
This example shows how to construct a tabbed table of contents with internal navigation, so that clicking links in the displayed tiddler will replace the displayed tiddler.
2014-11-15 12:29:46 +00:00
```
<<toc-tabbed-internal-nav tag:"TableOfContents" selectedTiddler:"$:/temp/toc/selectedTiddler" unselectedText:"Select a topic in the table of contents. Click the arrow to expand a topic.">>
```
!!! External navigation
This example shows how to construct a tabbed table of contents with external navigation, so that clicking links in the displayed tiddler will open those tiddlers in the story river in the usual way.
2014-11-15 12:29:46 +00:00
```
<<toc-tabbed-external-nav tag:"TableOfContents" selectedTiddler:"$:/temp/toc/selectedTiddler" unselectedText:"Select a topic in the table of contents. Click the arrow to expand a topic.">>
```
2014-11-15 12:29:46 +00:00
!! Example
2014-11-15 12:29:46 +00:00
Type: <$select tiddler="TabbedExampleType">
<option value="toc-tabbed-internal-nav">Open tiddler links internally (toc-tabbed-internal-nav)</option>
<option value="toc-tabbed-external-nav">Open tiddler links externally (toc-tabbed-external-nav)</option>
</$select>
2014-12-02 23:47:23 +00:00
<$macrocall $name={{TabbedExampleType}} tag="TableOfContents" selectedTiddler="$:/temp/toc/selectedTiddler" unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>" missingText="<p>Missing tiddler.</p>"/>