Add Page external_link
This commit is contained in:
1 parent
a4c900af4d
commit
32fdf99833
4 files changed
+13
-4
No files matched your search
@@ -6,7 +6,9 @@ class PagesController < ApplicationController
|
||||
@page = Page.find_by_name(params[:page_name])
|
||||
@layout = @page.layout
|
||||
|
||||
if @page
|
||||
if @page && @page.external_link
|
||||
redirect_to @page.external_link
|
||||
elsif @page
|
||||
@page_content = Liquid::Template.parse(@page.content).render
|
||||
@layout_content = (@page.layout)? @layout.content : "{{page_content}}"
|
||||
render :text => Liquid::Template.parse(@layout_content).render( 'page_content' => @page_content )
|
||||
|
||||
Reference in new issue
Block a user