public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
add Site.default_assigns for default liquid assigns for all templates

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2521 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Dec 03 21:39:19 -0800 2006
commit  1b252a48bb2e3db3a0db819bfc148b3c189d6dbe
tree    1c48bf6c3b4de95d30ecff9b9ae2bcc4ffddbfb6
parent  7e36c99b3ac7ec9a65b993ad583ea06c5de52470
...
1
2
3
 
 
 
4
5
6
...
163
164
165
 
166
167
168
...
1
 
 
2
3
4
5
6
7
...
164
165
166
167
168
169
170
0
@@ -1,6 +1,7 @@
0
 class Site < ActiveRecord::Base
0
- @@theme_path = Pathname.new(RAILS_ROOT) + 'themes'
0
- cattr_reader :theme_path
0
+ @@default_assigns = {}
0
+ @@theme_path = Pathname.new(RAILS_ROOT) + 'themes'
0
+ cattr_reader :theme_path, :default_assigns
0
 
0
   cattr_accessor :multi_sites_enabled, :cache_sweeper_tracing
0
 
0
@@ -163,6 +164,7 @@ class Site < ActiveRecord::Base
0
 
0
   def render_liquid_for(section, template_type, assigns = {}, controller = nil)
0
     assigns.update('site' => to_liquid(section), 'mode' => template_type)
0
+ assigns.update(default_assigns) unless default_assigns.empty?
0
     parse_inner_template(set_content_template(section, template_type), assigns, controller)
0
     parse_template(set_layout_template(section, template_type), assigns, controller)
0
   end

Comments

    No one has commented yet.