Context Weights

Déja Augustine's picture

The context module is great, but it's lacking one distinct feature: weighting. There's no way to explicitly determine which order the contexts are evaluated in.

This leaves us to rely on a little known, implicit ordering system: alphabetical by context name.

As of version 6.x-3.0-beta5, the context module evaluates contexts in the order they appear on the admin panel. Using ordering prefixes can help to control the order. For example, if we have three contexts that apply to a particular path:

One
Two
Three

they would show up on the admin list as

One
Three
Two

and be evaluated in that order. In order to control the order, one solution might be to do:

a_One
b_Two
c_Three

Making use of this "feature" is obnoxious at best, obfuscative at worst, but it's what we have out of the box.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockcode>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
Are you a robot? We usually like robots, but not in our comments.
By submitting this form, you accept the Mollom privacy policy.