Computed Field

Submitted by admin@soz on Thu, 03/19/2020 - 01:48

Computed Field is a very powerful 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 fields. So start cooking up your PHP based values!

Security Warning

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.

Note that entering PHP code into the database is not recommended, as it is a security risk if someone is able to bypass access controls on the Web front-end. Additionally, the code is also not version controlled, and any mistakes can take down the site.

The recommended approach is to implement the provided hooks in custom modules. If you're not doing this, expect problems. You've been warned!

Source & download:

Links to read:

Study Hook:-

Alternatives Modules: