This is the website of Andy Carter a Textpattern and Drupal web developer living in the Steel city.

arc_pref_override

Current release: version 0.1 (27/06/2010)

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 content of this page was first posted on Sunday June 27, 2010 and was last modified on Tuesday June 29, 2010.

Plugin downloads

arc_pref_override_v0.1_zip.txt [1.70KB] Last modified: Sunday June 27, 2010

Comment

Want to comment?

To comment you'll need to provide an e-mail address. Don't worry all e-mail addresses are kept private and will never be shown on this site or distributed to others.

Don't forget the http:// part

You'll need to preview your comment before it can be submitted; this is to help prevent spam and to give you a chance to review your comment before it gets posted on the site.

Comment formatting:

_emphasis_
*strong*
??citation??
-deleted text-
+inserted text+
^superscript^

Hyperlink:
"link text":http://link.com/

To define an acronym:
ABC(Always Be Closing)

Note: All (X)HTML tags will be escaped.

Textpattern links