View helpers to render the navigation.
Use render_navigation as following to render your navigation:
call render_navigation without :level option to render your complete navigation as nested tree.
call render_navigation(:level => x) to render a specific navigation level (e.g. :level => 1 to render your primary navigation, :level => 2 to render the sub navigation and so forth)
call render_navigation(:level => 2..3) to render navigation levels 2 and 3). For example, you could use render_navigation(:level => 1) to render your primary navigation as tabs and render_navigation(:level => 2..3) to render the rest of the navigation as a tree in a sidebar.
#primary_navigation= render_navigation(:level => 1) #sub_navigation= render_navigation(:level => 2) #nested_navigation= render_navigation #top_navigation= render_navigation(:level => 1..2) #sidebar_navigation= render_navigation(:level => 3)
# File lib/simple_navigation/rendering/helpers.rb, line 109 def apply_defaults(options) options[:level] = options.delete(:levels) if options[:levels] {:context => :default, :level => :all}.merge(options) end
# File lib/simple_navigation/rendering/helpers.rb, line 99 def load_config(options,includer) ctx = options.delete(:context) SimpleNavigation.init_adapter_from includer SimpleNavigation.load_config(ctx) SimpleNavigation::Configuration.eval_config(ctx) SimpleNavigation.config.items(options[:items]) if options[:items] SimpleNavigation.handle_explicit_navigation if SimpleNavigation.respond_to?(:handle_explicit_navigation) raise "no primary navigation defined, either use a navigation config file or pass items directly to render_navigation" unless SimpleNavigation.primary_navigation end
Generated with the Darkfish Rdoc Generator 2.