Extend the tabs macro to allow tab contents to be templated

This commit is contained in:
Jermolene 2014-07-02 12:15:52 +01:00
parent f43cd5ba9c
commit e18d8a8866
2 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,7 @@
title: $:/core/macros/tabs
tags: $:/tags/Macro
\define tabs(tabsList,default,state:"$:/state/tab",class)
\define tabs(tabsList,default,state:"$:/state/tab",class,template)
<div class="tw-tab-set $class$">
<div class="tw-tab-buttons $class$">
<$list filter="$tabsList$" variable="currentTab">
@ -16,7 +16,15 @@ tags: $:/tags/Macro
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$transclude tiddler=<<currentTab>> mode="block"/>
<$tiddler tiddler=<<currentTab>>>
<$transclude tiddler="$template$" mode="block">
<$transclude mode="block"/>
</$transclude>
</$tiddler>
</$reveal>

View File

@ -1,5 +1,5 @@
created: 20131228162203521
modified: 20140509223527667
modified: 20140702113527667
tags: macros
title: TabsMacro
type: text/vnd.tiddlywiki
@ -15,6 +15,7 @@ By default the tab control arranges the tabs horizontally with the content under
|2nd |default |Name of the tiddler containing the default tab | |
|3rd |state |String to distinguish multiple tabs within the same tiddler (use of the system tiddler prefix is recommended) |''$:/state/tab'' |
|4th |class |Additional CSS classes for the three wrappers DIV of the tab | |
|5th |template |Optional template through which to render the tab content | |
! Examples