Module: Katalyst::Navigation::FrontendHelper

Defined in:
app/helpers/katalyst/navigation/frontend_helper.rb

Instance Method Summary collapse

Instance Method Details

Render items without a wrapper list, useful for inline rendering of items

@param(items: [Katalyst::Navigation::Item])

Returns:

  • Structured HTML containing top level + nested navigation links



29
30
31
32
33
34
35
36
37
# File 'app/helpers/katalyst/navigation/frontend_helper.rb', line 29

def navigation_items_with(items:, **)
  builder = navigation_builder(**)

  capture do
    items.each do |item|
      concat builder.render_item(item)
    end
  end
end

Render a navigation menu. Caches based on the published version’s id.

@param(menu: Katalyst::Navigation::Menu)

Returns:

  • Structured HTML containing top level + nested navigation links



14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/katalyst/navigation/frontend_helper.rb', line 14

def navigation_menu_with(menu:, **)
  builder = navigation_builder(**)
  menu    = navigation_menu_for(menu) if menu.is_a?(Symbol)

  return if menu.blank?

  cache menu do
    concat builder.render(menu.published_tree) if menu.published_version.present?
  end
end