Sha256: 7f8b7094b7dd23b319203d7c957e90313151bf705731bf8037feb5b3695beb11
Contents?: true
Size: 522 Bytes
Versions: 23
Compression:
Stored size: 522 Bytes
Contents
class ComfortableMexicanSofa::Tag::File include ComfortableMexicanSofa::Tag def self.regex_tag_signature(label = nil) label ||= /[\w\-\.]+/ /\{\{\s*cms:file:(#{label}):?(.*?)\s*\}\}/ end def content return unless file format = params[0] text = params[1] || label case format when 'link' "<a href='#{file.file.url}' target='_blank'>#{text}</a>" when 'image' "<img src='#{file.file.url}' alt='#{text}' />" else file.file.url end end end
Version data entries
23 entries across 23 versions & 1 rubygems