Sha256: 4e8cf20f72d0feb517138472f428202876423f0c4686d51cf36f54351008f12d
Contents?: true
Size: 1.27 KB
Versions: 3
Compression:
Stored size: 1.27 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.includes(:slugs) 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 sibling_count = roots.length - 1 -%> <nav id='<%= dom_id %>' class='<%= %W(#{css} clearfix).join(' ') %>'> <ul> <%= render :partial => "/shared/menu_branch", :collection => roots, :locals => { :hide_children => hide_children, :sibling_count => sibling_count, :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 -%>
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
refinerycms-core-0.9.9.8 | app/views/shared/_menu.html.erb |
refinerycms-core-0.9.9.7 | app/views/shared/_menu.html.erb |
refinerycms-core-0.9.9.5 | app/views/shared/_menu.html.erb |