-
-
Save danielres/827850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to re-use the menu partial for a submenu in Refinery CMS >= 0.9.8.5 | |
# header menu (main menu) which hides its children. | |
<%= render :partial => "/shared/menu", | |
:locals => { | |
:dom_id => 'menu', | |
:css => 'menu', | |
:collection => @menu_pages, | |
:hide_children => true | |
} -%> | |
# content menu (submenu) (extra_suffix cures double-up on cache) | |
<%= render :partial => '/shared/menu', | |
:locals => { | |
:dom_id => 'submenu', | |
:css => 'menu', | |
:roots => @menu_pages.reject{|p| p.parent_id != @page.root.id }, | |
:collection => @menu_pages.reject{|p| !p.self_and_ancestors.map(&:id).include?(@page.root.id) }, | |
:extra_suffix => 'submenu' | |
} %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment