This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
forked from pero-ict-solutions/spree-static-content
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from ethier/master
Issue #63 - Add partial support
- Loading branch information
Showing
6 changed files
with
67 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
<% content_for :head do -%> | ||
<%- if @page.meta_title.present? -%> | ||
<meta name="title" content="<%=@page.meta_title%>"> | ||
<%- else -%> | ||
<meta name="title" content="<%=@page.title%>"> | ||
<%- end -%> | ||
<meta name="keywords" content="<%=@page.meta_keywords%>"> | ||
<meta name="description" content="<%=@page.meta_description%>"> | ||
<% end -%> | ||
<% if @page.layout.present? and @page.render_layout_as_partial? %> | ||
<%= render :partial => @page.layout %> | ||
<% else %> | ||
<% content_for :head do -%> | ||
<%- if @page.meta_title.present? -%> | ||
<meta name="title" content="<%=@page.meta_title%>"> | ||
<%- else -%> | ||
<meta name="title" content="<%=@page.title%>"> | ||
<%- end -%> | ||
<meta name="keywords" content="<%=@page.meta_keywords%>"> | ||
<meta name="description" content="<%=@page.meta_description%>"> | ||
<% end -%> | ||
<% content_for :sidebar do %> | ||
<% if "products" == @current_controller && @taxon %> | ||
<%= render :partial => "spree/shared/filters" %> | ||
<% else %> | ||
<%= render :partial => "spree/shared/taxonomies" %> | ||
<% content_for :sidebar do %> | ||
<% if "products" == @current_controller && @taxon %> | ||
<%= render :partial => "spree/shared/filters" %> | ||
<% else %> | ||
<%= render :partial => "spree/shared/taxonomies" %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<h1><%= @page.title %></h1> | ||
<div id="page_content"> | ||
<%= raw @page.body %> | ||
</div> | ||
<h1><%= @page.title %></h1> | ||
<div id="page_content"> | ||
<%= raw @page.body %> | ||
</div> | ||
<% end %> |
13 changes: 13 additions & 0 deletions
13
db/migrate/20120723144115_add_render_as_partial_for_layout_for_spree_pages.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AddRenderAsPartialForLayoutForSpreePages < ActiveRecord::Migration | ||
def up | ||
unless column_exists? :spree_pages, :render_layout_as_partial | ||
add_column :spree_pages, :render_layout_as_partial, :boolean, :default => false | ||
end | ||
end | ||
|
||
def down | ||
if column_exists? :spree_pages, :render_layout_as_partial | ||
remove_column :spree_pages, :render_layout_as_partial | ||
end | ||
end | ||
end |