Sha256: b69076c9196f637d16daed93c5ef5e4a8e2ad6dcda31585a0f2d0e942f19009a
Contents?: true
Size: 758 Bytes
Versions: 25
Compression:
Stored size: 758 Bytes
Contents
class ComfortableMexicanSofa::Tag::Asset include ComfortableMexicanSofa::Tag def self.regex_tag_signature(identifier = nil) identifier ||= IDENTIFIER_REGEX /\{\{\s*cms:asset:(#{identifier}):?(.*?)\s*\}\}/ end def content return unless (layout = Cms::Layout.find_by_identifier(identifier)) type = params[0] format = params[1] case type when 'css' out = "/cms-css/#{page.site.id}/#{identifier}.css" out = "<link href='#{out}' media='screen' rel='stylesheet' type='text/css' />" if format == 'html_tag' out when 'js' out = "/cms-js/#{page.site.id}/#{identifier}.js" out = "<script src='#{out}' type='text/javascript'></script>" if format == 'html_tag' out end end end
Version data entries
25 entries across 25 versions & 1 rubygems