Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (28 sloc) 1.02 KB
<%
dom_id ||= 'menu'
css ||= 'menu'
hide_children = RefinerySetting.find_or_set(:menu_hide_children, false) unless defined?(hide_children)
cache_key = [Refinery.base_cache_key]
cache_key << RefinerySetting.find_or_set(:refinery_menu_cache_action_suffix, "site_menu")
cache_key << request.path
cache(cache_key.join('_')) do
roots = @menu_pages.select { |m| m.parent_id == nil } # Select top menu items
if roots.any?
sibling_count = roots.size - 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,
: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
-%>
Something went wrong with that request. Please try again.