Sha256: 666e2bc39aabc38cce98d855a252567e0ff56c1c589fb275a33161177d2159e6
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 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 = (cache_menu ||= RefinerySetting.find_or_set(:cache_menu, false)) cache_if(caching, [Refinery.base_cache_key, "pages_menus", dom_id, Globalize.locale, cache_path ||= 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
refinerycms-core-0.9.9.16 | app/views/shared/_menu.html.erb |