gluttonberg/lib/gluttonberg/helpers/public.rb
def navigation_tree(pages, opts = {})
        content = ""
        pages.each do |page|
          li_opts = {}
          li_opts[:class] = "current" if page == @page
          li_content = tag(:a, page.nav_label, :href => page_url(page))
          children = page.children_with_localization(:dialect => params[:dialect], :locale => params[:locale])
          li_content << navigation_tree(children) unless children.empty?
          content << "\n\t#{tag(:li, li_content, li_opts)}"
        end
        tag(:ul, "#{content}\n", opts)
      end
# A simple helper which loops through a heirarchy of pages and produces a
# set of nested lists with links to each page.
A simple helper which loops through a heirarchy of pages and produces a
set of nested lists with links to each page.
A simple helper which loops through a heirarchy of pages and produces a set of nested lists with links to each page .
def navigation_tree(pages, opts = {})
        content = ""
        pages.each do |page|
          li_opts = {}
          li_opts[:class] = "current" if page == @page
          li_content = tag(:a, page.nav_label, :href => page_url(page))
          children = page.children_with_localization(:dialect => params[:dialect], :locale => params[:locale])
          li_content << navigation_tree(children) unless children.empty?
          content << "\n\t#{tag(:li, li_content, li_opts)}"
        end
        tag(:ul, "#{content}\n", opts)
      end
def navigation_tree ( pages , opts = { } ) content = "" pages . each do | page | li_opts = { } li_opts [ :class ] = "current" if page == @page li_content = tag ( :a , page . nav_label , :href => page_url ( page ) ) children = page . children_with_localization ( :dialect => params [ :dialect ] , :locale => params [ :locale ] ) li_content << navigation_tree ( children ) unless children . empty? content << "\n\t#{tag(:li, li_content, li_opts)}" end tag ( :ul , "#{content}\n" , opts ) end
A simple helper which loops through a heirarchy of pages and produces a
set of nested lists with links to each page.
A simple helper which loops through a heirarchy of pages and produces a set of nested lists with links to each page .
pages
opts