Sections
Sections are the main component abstractions of Kabootit. These can be html snippet files, mustache templates files, Wakanda containers, or Wakanda components allowing for scenarios ranging from reporting to full on SPAs.
Sections are inherently reusable as page meta data for sections map
section tags to files anywhere in the WebFolder directory. By
convention, best practice is to put reusable sections in the src/views
directory and non-reusable sections under the specific page directory.
HTML files
- Map a section tag to an
.htmlfile
Build behavior:
Tag is replaced by the html file.
Mustache templates
TODO: implement
- Map a section tag to a
.tplfile - Create a
.jsonfile in the same location and name as the.tplfile (just different extension)
Build behavior:
Tag is replaced by a Mustache.render(tpl, json)
Kabootit widgets
Widgets that work with Kabootit have two required properties: Tag and
Order.
We have modified a number of Wakanda widgets to have these properties and all Kabootit custom widgets have these properties as well.
Any additional properties are used specifically by the widget and don’t have any bearing on the Kabootit build process.
Build behavior:
See Using Wakanda’s Widgets and Creating Custom Widgets
Wakanda containers
TODO: implement
- Create a Wakanda Web Component with the same name as the section tag it is meant to replace
- Place a Wakanda
Containerwidget on the page - Add
.tplmarkup to the container’s KabootitTemplateproperty - Place
Kabootit Widgetsinside the container and associate to specific.tpltags via theTagproperty - Multiple widgets with the same
Tagproperty can be ordered by theOrderproperty
Build behavior:
- Widget markup is merged into container template markup
- Tag is replaced by container results
Grid system
Kabootit models the Bootstrap grid system via Wakanda’s tab widget. An
additional Kabootit property Template has been added to the
tab widget and its sub containers. The various template properties are
where you enter specific Bootstrap grid markup.
Easiest starting point is to duplicate a Wakanda Component that
already has everything setup. Example setup:
- Create a
Wakanda Componentinsrc/pagesorsrc/views - Add a
tabwidget to the screen. This will be the horizontal tab panel - Horizontal
Templateproperty needs to have a.tpltag of{\{\{columns}\}\}.
<div class="container"><div class="row">{\{\{columns}\}\}</div></div>
- For each horizontal tab, click the tab container and enter markup in
the
Templateproperty. A.tpltag of{\{\{widgets}\}\}is required.
<div class="col-lg-4 col-md-4 col-xs-12">{\{\{widgets}\}\}</div>
- For each horizontal tab, add a new
tabwidget to the container. This is the vertical tab - For each vertical tab container, refer to the Wakanda containers instructions
Build behavior:
- Widget markup is merged into container template markup
- Vertical tab results are combined in order of tabs and then combined with horizontal parent template markup
- Horizontal tab container template markup is added up in order of tabs
- Horizontal tab container results is combined with horizontal tab template markup
- Tag is replaced by horizontal tab results