Class: OrthorContentController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/orthor_content_controller.rb

Instance Method Summary collapse

Instance Method Details

#orthor_contentObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/orthor_content_controller.rb', line 2

def orthor_content
  expires_in Orthor::Site.cache_for, :public => true if Orthor::Site.cache_for > 0

  if params[:id]
    resource = Orthor::Site.find_resource_by_page_path(request.request_uri, params[:id])
    @orthor_content = Orthorings.content(params[:id], (resource.page_template || resource.template))
    @orthor_page_title = Orthorings.content(id)["Title"]
  else
    resource = Orthor::Site.find_resource_by_path(request.request_uri)
    @orthor_content = resource.content
  end

  if resource.is_a?(Orthor::Feed)
    render :xml => @orthor_content
  else
    @name = resource.name
    @meta_keywords = resource.keywords
    @meta_description = resource.description
    @orthor_feeds = resource.respond_to?(:feeds) ? resource.feeds : []
    @orthor_page_title ||= resource.title

    render :action => (resource.view || "orthor_content"), :layout => Orthor::Site.layout.to_s
  end
end