Permalink
Browse files

Merge commit 'mrgossett/master'

  • Loading branch information...
2 parents fd3244c + 5b8b132 commit d75a153d1e757172ec25bd2d173a1f64dc885211 @saturnflyer saturnflyer committed Jul 5, 2008
Showing with 26 additions and 0 deletions.
  1. +22 −0 lib/settings_tags.rb
  2. +4 −0 settings_extension.rb
View
@@ -0,0 +1,22 @@
+module SettingsTags
+ include Radiant::Taggable
+
+ class TagError < StandardError; end
+
+ tag "config" do |tag|
+ tag.expand
+ end
+
+ desc %{
+ Renders the Radiant::Config setting specified by the required 'key' attribute.
+
+ *Usage*:
+
+ <pre><code><r:config:setting key="admin.title" /></code></pre>
+ }
+ tag "config:setting" do |tag|
+ raise TagError, "'key' attribute required" unless key = tag.attr['key']
+ Radiant::Config["#{key}"]
+ end
+
+end
@@ -15,6 +15,10 @@ class SettingsExtension < Radiant::Extension
def activate
Radiant::Config.extend ConfigFindAllAsTree
admin.tabs.add "Settings", "/admin/settings", :after => "Layouts" #, :visibility => [:developer]
+
+ Page.class_eval {
+ include SettingsTags
+ }
end
def deactivate

0 comments on commit d75a153

Please sign in to comment.