Closed (works as designed)
Project:
Context
Version:
6.x-3.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2010 at 18:20 UTC
Updated:
13 Mar 2010 at 08:54 UTC
Context module is very useful and we use it in some our projects. But sometimes conditions provided by module are not enough for building all required contexts. I created simple module for context 3 branch that adds PHP code condition - user (administrator) can write some PHP code, that returns boolean value.
I'm attaching module code. It would be nice if this functionality will be bundled with context module. You can bundle module as optional or merge module code to main module.
| Comment | File | Size | Author |
|---|---|---|---|
| context_php.zip | 1.67 KB | vgarvardt |
Comments
Comment #1
yhahn commentedYou're welcome to use this on your own projects, but I would highly recommend simply providing new context condition plugins in a custom module for each custom condition you need. Given that it is simple to extend an existing or base condition plugin for your own needs and this keeps code out of the database, this is the approach I would recommend.
Comment #2
dixon_I just contributed vgarvardt's code with some modifications here: http://drupal.org/project/contextphp
But as yhahn says, this kind of condition should only be used in rare cases where a custom condition module doesn't make sense. Keeping code out of the database is always best practice.