Class: ComfyPress::Tag::SiteMenu
- Inherits:
-
Object
- Object
- ComfyPress::Tag::SiteMenu
show all
- Includes:
- ComfyPress::Tag
- Defined in:
- lib/comfypress/tags/site_menu.rb
Constant Summary
IDENTIFIER_REGEX, TOKENIZER_REGEX
Instance Attribute Summary
#identifier, #namespace, #page, #params, #parent
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.regex_tag_signature(identifier = nil) ⇒ Object
4
5
6
7
|
# File 'lib/comfypress/tags/site_menu.rb', line 4
def self.regex_tag_signature(identifier = nil)
identifier ||= /[\w\-]+/
/\{\{\s*cms:site_menu\s*\}\}/ end
|
Instance Method Details
#content ⇒ Object
9
10
11
12
|
# File 'lib/comfypress/tags/site_menu.rb', line 9
def content
site = Cms::Site.find(page.site_id)
"<%= render :partial => 'cms_content/menu', locals: {menu_id: #{site.}} %>"
end
|
#render ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/comfypress/tags/site_menu.rb', line 14
def render
whitelist = ComfyPress.config.allowed_partials
if whitelist.is_a?(Array)
content if whitelist.member?(identifier)
else
content
end
end
|