module Cms::ApplicationHelper MENU_INDEX = {}.freeze def sp_snippet(name, snippets = nil) return '' if name.blank? snippet = if !snippets.blank? snippets.select { |s| s.name == name } else SpudSnippet.where(name: name).first end if !snippet.blank? # cache(snippet) do # concat snippet.content_processed.html_safe # end snippet.content_processed.html_safe else return nil end end def sp_list_pages(options = {}) pages = SpudPage.viewable.published_pages start_page = nil max_depth = 0 active_class = 'menu-active' if !options.blank? if options.key?(:exclude) pages = pages.where(['name NOT IN (?)', options[:exclude]]) end start_page = options[:start_page_id] if options.key?(:start_page_id) content = if options.key?(:id) "