Skip to content

Instantly share code, notes, and snippets.

@al2o3cr
Created August 16, 2010 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save al2o3cr/526966 to your computer and use it in GitHub Desktop.
Save al2o3cr/526966 to your computer and use it in GitHub Desktop.
<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