Skip to content

Commit

Permalink
add more flexibility so that the menu could be used as a submenu or a…
Browse files Browse the repository at this point in the history
… footer menu or anywhere you want, just add in an extra suffix and specify the roots as locals
  • Loading branch information
parndt committed Sep 16, 2010
1 parent 78d0e87 commit 072853d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vendor/refinerycms/core/app/views/shared/_menu.html.erb
Expand Up @@ -3,10 +3,12 @@
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 << (action_suffix ||= RefinerySetting.find_or_set(:refinery_menu_cache_action_suffix, "site_menu"))
cache_key << extra_suffix if defined?(extra_suffix) and extra_suffix.present?
cache_key << request.path
cache(cache_key.join('_')) do
roots = @menu_pages.select { |m| m.parent_id == nil } # Select top menu items
cache(cache_key.compact.join('_')) do
# Select top menu items unless 'roots' is passed in.
roots ||= @menu_pages.select { |m| m.parent_id == nil }
if roots.any?
sibling_count = roots.size - 1
-%>
Expand Down

0 comments on commit 072853d

Please sign in to comment.