From 4aa4a0e4a44735d22ac7f8fd1b12b19699af087b Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 1 Sep 2009 11:49:56 +0200 Subject: added expirimental routing for image galeries added plain image gallery template refinements --- app/controllers/content_controller.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'app/controllers/content_controller.rb') diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index d548a34..d1bfa6b 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -1,14 +1,13 @@ class ContentController < ApplicationController + before_filter :find_page + # This is the method that renders most of the the public content. It recieves # a :locale and a :page_path parameter through the params hash. It looks up # the node with the corresponding unique_name attribute. The method doesn't # return a node though, the node is really a proxy object for pages. It # returns the most recent page associated to this node instead. def render_page - path = params[:page_path].join('/') - - @page = Node.find_page(path) if @page and @page.public? template = @page.valid_template @@ -26,4 +25,14 @@ class ContentController < ApplicationController end + def render_gallery + @images = @page.assets.images + render :file => "custom/page_templates/public/gallery"#, :layout => true + end + + private + def find_page + path = params[:page_path].join('/') + @page = Node.find_page(path) + end end -- cgit v1.3