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!

Important

This module is intended to be used by PHP developers to insert & execute PHP code on a Drupal website. It does not provide a macro interface, a code builder or anything other than insert your working code here into this text area. You need to have a good working knowledge of PHP and the Drupal API to use this module. To get the best results with this module, pre-test your PHP code in the Body field of a Page in Drupal.

Please do not post questions to the issue queue asking for help with your specific PHP code snippet. Use this page for Computed Field code examples and for seeking assistance, http://drupal.org/node/149228

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 releasesDateSizeLinksStatus
6.x-1.0-beta32009-Aug-0114.21 KBRecommended for 6.xThis is currently the recommended release for 6.x.
5.x-1.22007-May-1610.72 KBRecommended for 5.xThis is currently the recommended release for 5.x.
Development snapshotsDateSizeLinksStatus
6.x-1.x-dev2009-Aug-0114.21 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.


 
 

Drupal is a registered trademark of Dries Buytaert.