From 6cd908d31b0f5661cf7f23913272e50d689c3598 Mon Sep 17 00:00:00 2001 From: technoweenie Date: Thu, 19 Oct 2006 02:28:01 +0000 Subject: [PATCH] Added global mode var to all templates to check what mode you're in: section, single, page, archive, search, tag git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2377 567b1171-46fb-0310-a4c9-b4bef9110e78 --- CHANGELOG | 2 ++ app/models/site.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 10758db7..05ce1135 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ * SVN * +* Added global mode var to all templates to check what mode you're in: section, single, page, archive, search, tag + * Remove any notion of a template hierarchy, and the page template itself. Paged sections now default to the 'single' template. * Added {{ mode }} so you can check what 'view' you're in. diff --git a/app/models/site.rb b/app/models/site.rb index ca234048..eaf26c16 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -186,7 +186,7 @@ def accept_comments? end def render_liquid_for(section, template_type, assigns = {}, controller = nil) - assigns['site'] = to_liquid(section) + assigns.update('site' => to_liquid(section), 'mode' => template_type) parse_inner_template(set_content_template(section, template_type), assigns, controller) parse_template(set_layout_template(section, template_type), assigns, controller) end