Module: ImedoClientCommunication::BaseProvider

Defined in:
lib/imedo_client_communication/base_provider.rb

Class Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/imedo_client_communication/base_provider.rb', line 4

def self.included(receiver)
  receiver.class_eval do

    provides_context :title
    provides_context :main_title, :main_subtitle, :meta_title, :title_class, :subtitle
    provides_context :page_description, :page_keywords, :keywords
    provides_context :geo_location_city, :geo_location_latlong, :geo_location_icbm, :geo_location_region
    provides_context :noindex, :canonical, :no_breadcrumb

    provides_context :request_uri do
      request.request_uri
    end

    provides_context :forbidden

    provides_context :page_id
    provides_context :model_type => lambda { @navigation_model.class.name if @navigation_model },
      :model_id => lambda { @navigation_model.id if @navigation_model },
      # remove respond_to when all client apps implemented the necessary remote sitemap method in all models
      :model_name => lambda { @navigation_model.sitemap_name if @navigation_model && @navigation_model.respond_to?(:sitemap_name) },
      :model_param => lambda { @navigation_model.to_param if @navigation_model }

    provides_context :back_link

    provides_context :current_topic # hook to connect contents across apps

    provides_context :client_javascripts do
      (Array(@client_javascripts) || []).join(",")
    end

  end
end