Module: CmsTag::InstanceMethods

Defined in:
lib/LucyCMS/cms_tag.rb

Instance Method Summary collapse

Instance Method Details

#ancestorsObject

Ancestors of this tag constructed during rendering process.



49
50
51
52
53
# File 'lib/LucyCMS/cms_tag.rb', line 49

def ancestors
  node, nodes = self, []
  nodes << node = node.parent while node.parent
  nodes
end

#contentObject

Content that is accociated with Tag instance.



63
64
65
# File 'lib/LucyCMS/cms_tag.rb', line 63

def content
  nil
end

#identifierObject

String indentifier of the tag



44
45
46
# File 'lib/LucyCMS/cms_tag.rb', line 44

def identifier
  "#{self.class.name.underscore}_#{self.label}"
end

#regex_tag_signatureObject

Regex that is used to identify instance of the tag Example:

/<\{\s*?cms:page:tag_label\}/


58
59
60
# File 'lib/LucyCMS/cms_tag.rb', line 58

def regex_tag_signature
  self.class.regex_tag_signature(label)
end

#renderObject

Content that is used during page rendering. Outputting existing content as a default.



69
70
71
72
73
74
75
76
# File 'lib/LucyCMS/cms_tag.rb', line 69

def render
  # cleaning content from possible irb stuff. Partial and Helper tags are OK.
  if LucyCms.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class)
    content.to_s.gsub('<%', '&lt;%').gsub('%>', '%&gt;')
  else
    content.to_s
  end
end