Sha256: d8f0edcf2eb0cdc08cfa58893f3d364a6f0e52581b61add13b135404c174517d

Contents?: true

Size: 1.55 KB

Versions: 3

Compression:

Stored size: 1.55 KB

Contents

<%
  dom_id ||= 'menu'
  css ||= 'menu'
  hide_children = RefinerySetting.find_or_set(:menu_hide_children, false) if hide_children.nil?
  # Select top menu items unless 'roots' is supplied.
  collection ||= @menu_pages
  caching = ((defined?(cache_menu) && cache_menu) || RefinerySetting.find_or_set(:cache_menu, false)) && File.writable?(Rails.cache.cache_path)
  cache_if(caching && !user_signed_in?, [Refinery.base_cache_key, "pages_menus", dom_id, Globalize.locale, request.path].join('_')) do
    if (roots ||= collection.select{|p| p.parent_id.nil?}).present?
      # In order to match items that aren't shown in menu and highlight their associations.
      # This can be supplied if the logic is different in your case.
      unless defined?(selected_item)
        selected_item = collection.detect{|page| selected_page?(page)}
        selected_item = @page if selected_item.nil?
      end
  -%>
      <nav id='<%= dom_id %>' class='<%= %W(#{css} clearfix).join(' ') %>'>
        <ul>
          <%= render :partial => "/shared/menu_branch",
                     :collection => roots,
                     :locals => {
                       :hide_children => hide_children,
                       :sibling_count => (roots.length - 1),
                       :collection => collection,
                       :selected_item => selected_item,
                       :apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
                     }
          -%>
        </ul>
      </nav>
  <% end -%>
<% end -%>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinerycms-core-0.9.9.15 app/views/shared/_menu.html.erb
refinerycms-core-0.9.9.14 app/views/shared/_menu.html.erb
refinerycms-core-0.9.9.13 app/views/shared/_menu.html.erb