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