Extension for Radiant CMS which enables per page admin options, such as setting caching to a non-default value, or turning it off altogether
- Created by: Andrew vonderLuft
- Contact: avonderluft [at] avlux [dot] net
- 1.0 – 4/2009 – Radiant 0.7 compatible, per page caching options
- Radiant 0.7 or greater
- no other known dependencies
From your RADIANT_ROOT:
$ script/extension install page_options
- Restart your radiant app, and you should be good to go.
- Other per page options — suggestions most welcome
- Available to admin users only. You can change this by removing “if current_user.admin?” from the top of the caching_meta template.
- The cache_expire_time is being set with a text field with no validation for a few reasons:
- The time_select in rails has issues when the :include_blank => true option is set, viz. it consistently throws multi-parameter assignment errors.
- At validation time the text entered has already been parsed into a Time object, therefore attempting validates_format_of with a regex for hh:mm is pointless.
- Consequently, if you enter “www” it will parse the input into Time 00:00 (midnight). To avoid possible confusion, I hare added Current Setting in the meta partial.
- Expire time displays as hh:mm:ss, due to fact that it is a Time object being handled by ActiveRecord, but it is entered as hh:mm, with seconds defaulting to 00.
As always, Sean Cribbs lent assistance with the finer points of Ruby, Rails and Radiant. The Jupiter of Holst is still exquisite, even if it is a little bit of overkill for a podcast.