Created
August 16, 2010 13:49
-
-
Save al2o3cr/526966 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<def tag="tabs"> | |
<set-scoped tab-names="&[]" tab-contents="&{}"> | |
<ul class="tabs" merge> | |
<do param="default" /> | |
</ul> | |
<do repeat="&scope.tab_names"> | |
<div id="#{this}"> | |
<%= scope.tab_contents[this] %> | |
</div> | |
</do> | |
</set-scoped> | |
</def> | |
<def tag="tab-content" attrs="id, label"> | |
<li><a href="##{id}" merge><%= label %></a></li> | |
<% scope.tab_names << id %> | |
<% scope.tab_contents[id] = parameters.default %> | |
<do if="&false"> | |
<do param="default" /> | |
</do> | |
</def> | |
Example: | |
<tabs> | |
<tab-content id="Feature1" label="One">Foo Bar Baz</tab-content> | |
<tab-content id="Feature2" label="Two">Foo Bar Baz</tab-content> | |
</tabs> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment