arc_pref_override

This is a tiny little Textpattern plugin that let's you temporarily override site preferences in templates.  This is useful if perhaps you want to slightly alter the global behaviour of articles (for example) in a particular section.  The preference is not altered in the database, just in the template (as a result it only works for preferences used during the template rendering).

Installation

To install go to the 'plugins' tab under 'admin' and paste the plugin code into the 'Install plugin' box, 'upload' and then 'install'. Finally activate the plugin.

Usage

Attribute Description Default Example
pref Name of preference in database unset pref="publish_expired_articles"
value Override value of the preference unset value="0"

Examples

Example 1 – override a preference for the remainder of the template

<txp:arc_pref_override pref="publish_expired_articles" value="0" />

Example 2 – override a preference for the wrapped content

<txp:arc_pref_override pref="publish_expired_articles" value="0">
  <txp:article limit="5" />
</txp:arc_pref_override>

The Details