Custom Navigation Renderer

‹ Back

Ornament comes with a custom simple-navigation ornament_menu renderer:

<%= koi_render_navigation "header_nav", 
  "header_navigation", 
  renderer: :ornament_menu, 
  level: 1..2, 
  expand_all: true, 
  id_namespace: "header"
%>

Features:

  • id_namespace option can be used to namespace the key ids that get added to each menu item. This option can be used to avoid duplicate ids between for example a header menu and a mobile menu.

The renderer gets generated in to app/renderers/ornament_nav_renderer.rb for easy customisation.