Computed Field
Maintainers
Computed Field is being maintained by Agileware, http://www.agileware.net (Drupal 5 branch) and Moonshine (Drupal 6 branch). CVS HEAD is currently for Drupal 6!
If you would also like to help maintain this module then please contact Moonshine or Agileware.
About Computed Field
Computed Field is a very powerful CCK field module that lets you add a custom "computed fields" to your content types. These computed fields are populated with values that you define via PHP code. You may draw on anything available to Drupal, including other fields, the current user, database tables, you name it. (Feeling the power yet? :) ) You can also choose whether to store your computed field values in the database with other content fields, or have them "calculated" on the fly during node views. (Although you should note that Views use requires database stored values.) This field is literally the Swiss Army knife of CCK fields. So start cooking up your PHP based values!
Computed Field requires the content module (CCK) and working knowledge of PHP.
Updates
- As of 2006-9-12 The computed code and display format are field settings, not widget settings. This means if you add a computed field to more than one content type then they will share the same code. Updating shouldn't be a problem because the module will fall back to using a computed field's widget's code if its field's code hasn't been set.
-
As of 2006-8-11 the 'display format' setting has changed. You'll need to update any existing computed fields: If your display format was
This is the value: %value, then change it to$display = 'This is the value: ' . $node_field_item['value'];
Usage
Getting Started
Before you can use Computed Field, you'll need to get CCK and enable (at the very least) the 'content' module. You will probably also want to enable the other CCK modules, such as 'text', 'number', 'date', etc.
To add a computed field to a content type, go to administer > content > content types, select the content type you want to add to, and click on the 'add field' tab. One of the field types available should be 'Computed', and it should have one bullet point under it, also labelled 'Computed'. If you select this, give your field a name, and submit the form, you will get to the configuration page for your new computed field.
Configuration and examples
Configuration of this module has been relocated to a page of the CCK manual on drupal.org.
http://drupal.org/node/126522
If you have another useful (or instructive) example please add it to the manual pages.
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 5.x-1.2 | 2007-May-15 | 10.72 KB | Download · Release notes | Recommended for 5.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2008-Aug-26 | 11.2 KB | Download · Release notes | Development snapshot | |
