Class: ComfyPress::Tag::TabsContents

Inherits:
Object
  • Object
show all
Includes:
ComfyPress::Tag
Defined in:
lib/comfypress/tags/tabs_content.rb

Constant Summary

Constants included from ComfyPress::Tag

IDENTIFIER_REGEX, TOKENIZER_REGEX

Instance Attribute Summary

Attributes included from ComfyPress::Tag

#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/tabs_content.rb', line 4

def self.regex_tag_signature(identifier = nil)
  identifier ||= /[\w\-]+/
  /\{\{\s*cms:page_tabs:contents\s*\}\}/
end

Instance Method Details

#contentObject



9
10
11
# File 'lib/comfypress/tags/tabs_content.rb', line 9

def content
  "<%= render :partial => 'cms_content/tabs/content', locals: {page_id: #{page.id}} %>"
end

#renderObject



13
14
15
16
17
18
19
20
# File 'lib/comfypress/tags/tabs_content.rb', line 13

def render
  whitelist = ComfyPress.config.allowed_partials
  if whitelist.is_a?(Array)
    content if whitelist.member?(identifier)
  else
    content
  end
end