Sha256: 1f830e94e03cc3e589164dc9300c29faf74efe5ba6043ac484fb3fd5b299401d

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require_dependency 'application_controller'
require File.dirname(__FILE__)+'/lib/tagging_methods'
require 'radiant-tags-extension'

class TagsExtension < Radiant::Extension
  version RadiantTagsExtension::VERSION
  description "This extension enhances the page model with tagging capabilities, tagging as in \"2.0\" and tagclouds."
  url "http://gorilla-webdesign.be"  
  
  DEFAULT_RESULTS_URL = '/search/by-tag'

  def activate
    raise "The Shards extension is required and must be loaded first!" unless defined?(admin.page)
    if Radiant::Config.table_exists?
      Radiant::Config['tags.results_page_url'] = TagsExtension::DEFAULT_RESULTS_URL unless Radiant::Config['tags.results_page_url']
      Radiant::Config['tags.complex_strings'] = 'false' unless Radiant::Config['tags.complex_strings']
    end
    TagSearchPage
    Page.send :include, RadiusTags
    begin
      MetaTag
    rescue
      # dirty hack; need to get trough here to allow migrations to run..
    end
    Page.module_eval &TaggingMethods
    admin.page.edit.add :extended_metadata, 'tag_field'
    
    # HELP
    if admin.respond_to?(:help)
      admin.help.index.add :page_details, 'using_tags', :after => 'breadcrumbs'
    end
  end
  
  def deactivate
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-tags-extension-1.6.2 tags_extension.rb
radiant-tags-extension-1.6.1 tags_extension.rb
radiant-tags-extension-1.6.0 tags_extension.rb