navigation menu with more than 5 items

Originally written by Bryan Larsen on 2010-01-24.

For most applications, one of the first things that is done is to replace the navigation menu with a full custom menu.

However for some applications like admin subsites, the standard navigation would be fine, if it wasn’t limited to 5 items.

Put this in your application.dryml (or admin_site.dryml) for a navigation that isn’t limited to 5 items.

<def tag="main-nav">
  <navigation class="main-nav" merge-attrs param="default">
    <nav-item href="#{base_url}/">Home</nav-item>
    <% models = { |m| linkable?(m, :index) }.sort_by &:name -%>
    <repeat with="&models">
      <nav-item><ht key="#{}.nav_item"><%= this.view_hints.model_name_plural %></ht></nav-item>

Edit this page