The sidebar is the menu by which you navigate Sapwood's Editor.

Since its organization will affect how your users will navigate your Sapwood property, we feel it's important that you understand the logic behind how it is rendered. What we mention here is mostly spread throughout the options documentation, but we wanted to pull it all together for you, because we're nice and we like you!

The Default Order

The first thing to know is that, as long as you have valid templates, Sapwood will automatically render a sidebar based on those templates, following what we'll call cascading pluralization.

It's a fancy word term that really just means two things:

  1. Templates higher up in the config are rendered first.
  2. Sapwood will take the title option for a template and attempt to make it plural.

Overriding Order

TBH, the easiest way to override the order is to ... well, reorder your templates. Just rearrange the JSON objects in your configuration until they are in the order (from top-to-bottom) that they should appear on the screen.

Changing the Name

Changing the name that represents the template is simple: set the menu_label option and it will take precedence.

Grouping Templates (Submenus)

Sapwood supports one level of sub-items in the sidebar. This is done using the namespace option.

When a namespace option is added, the template will be nested under the namespace exactly as you wrote the namespace.

But it does one more thing! It let's you group items together. So, once the menu building finds a namespace, it goes looking for other templates using that same namespace, and it groups any it finds together in a submenu. This is really the only way the templates may be rendered out of order.

Hiding Templates

Sometimes you may not want a template in the sidebar, for any number of reasons. That's also a simple option, and it happens via the hidden option (set it to true to hide it).