Sha256: ed2ee398ff3d2e1d01cb74f1af0003146904c650c7e511230bb70f02a13d9c0f

Contents?: true

Size: 1.82 KB

Versions: 16

Compression:

Stored size: 1.82 KB

Contents

#------------------------------------------------------------------------------
module DmCms
  module RenderHelper
    include DmCms::AnalyticsHelper

    # build title to use on a page
    # note: make sure we return a properly escpaed html_safe string
    #------------------------------------------------------------------------------
    def page_title
      title = current_account.preferred_site_title
      content_for?(:page_title) ? "#{h(content_for :page_title)} | #{h(title)}".html_safe : h(title)
    end
    alias :main_title :page_title  # keep old main_title around for now

    # keywords to use in meta name='keywords'
    #------------------------------------------------------------------------------
    def page_keywords
      content_for?(:page_keywords) ? content_for(:page_keywords) : current_account.preferred_site_keywords
    end

    # copyright to use in meta name='copyright'
    #------------------------------------------------------------------------------
    def page_copyright
      content_for?(:page_copyright) ? content_for(:page_copyright) : current_account.preferred_site_copyright
    end

    # description to use in meta name='description'
    #------------------------------------------------------------------------------
    def page_description
      content_for?(:page_description) ? content_for(:page_description) : current_account.preferred_site_description
    end

    #------------------------------------------------------------------------------
    def social_url(name)
      case name
      when :facebook
        current_account.preferred_facebook_url
      when :youtube
        current_account.preferred_youtube_url
      when :twitter
        current_account.preferred_twitter_url
      when :linkedin
        current_account.preferred_linkedin_url
      else
        nil
      end
    end
    
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_cms-4.2.3.10 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.9 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.8 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.7 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.6 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.5 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.4 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.3 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.2 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3.1 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.3 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.2.3 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.2.2 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.2.1 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.2 app/helpers/dm_cms/render_helper.rb
dm_cms-4.2.1.5 app/helpers/dm_cms/render_helper.rb