You are here

README.txt in Computed Field 7

Same filename and directory in other branches
  1. 5 README.txt
  2. 6 README.txt
CONTENTS OF THIS FILE
--------------------

* Introduction
* Requirements
* Installation
* Configuration
* Maintainers


INTRODUCTION
------------

The Computed Field module allows users to add custom "computed fields" to
content types. These computed fields are populated with values that you define
via PHP code.

* For a full description of the module visit https://www.drupal.org/node/126522

* To submit bug reports and feature suggestions, or to track changes visit
  https://www.drupal.org/project/issues/computed_field


REQUIREMENTS
------------

This module requires no modules outside of Drupal core.


INSTALLATION
------------

* Install the Computed Field as you would normally install a contributed Drupal
  module. Visit https://www.drupal.org/docs/7/extend/installing-modules for
  further information.


CONFIGURATION
--------------

1. To add a computed field to a content type, navigate to Administration >
   Structure > Content types and select the content type to be edited.
2. Select the "manage fields" tab.
3. "Add a new field" and now the field type "Computed" is available. Save.

Computed Code
* This is the code that will assign a value to your computed field. It should be
  valid PHP without the <?php ?> tags.
Display Code
* This is also PHP code which should assign a string to the $display_output
  variable. It has $entity_field_item['value'] available, which is the value of
  the computed field. It also has $field (and some language information)
  available, and you can call any Drupal functions you want to display your
  field. Alternately, the code can be supplied by your own custom function named
  computed_field_YOUR_FIELD_MACHINE_NAME_display().

Database Storage Settings
* Data type - This is the SQL data type to use for storing the field contents in
  the database. Let us know if you need any other storage types, or if you would
  like an 'other' option. For calculating dollars and cents, for example, you
  would choose the "decimal" option.
* Data Length - This value will simply be passed on to SQL. For storing up to 10
  digit integers (INTs), enter 10. For storing currency as a float, use 10,2
  (unless you'll store larger than 10 figure amounts). For storing usernames or
  other short text with a VARCHAR field, 64 may be appropriate.
* Default Value - Leave this blank if you don't want the database to store a
  default value if your computed field's value isn't set. Following the currency
  example above, you would set this to "0.00".
* Not NULL - Leave unchecked if you want to allow NULL values in the database
  field. For things like currency, you probably want to check this.
* Indexed - Adds a simple DB index on the computed values.


MAINTAINERS
-----------

* Ra Mänd (ram4nd) - https://www.drupal.org/u/ram4nd
* Vadym Myrgorod (dealancer) - https://www.drupal.org/u/dealancer
* Colan Schwartz (colan) - https://www.drupal.org/u/colan
* Moonshine - https://www.drupal.org/u/moonshine
* Pedro Lozano - https://www.drupal.org/u/pedro-lozano

Supporting organization for Drupal 7: 
Colan Schwartz Consulting - (https://www.drupal.org/colan-schwartz-consulting)

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. --------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Configuration
  7. * Maintainers
  8. INTRODUCTION
  9. ------------
  10. The Computed Field module allows users to add custom "computed fields" to
  11. content types. These computed fields are populated with values that you define
  12. via PHP code.
  13. * For a full description of the module visit https://www.drupal.org/node/126522
  14. * To submit bug reports and feature suggestions, or to track changes visit
  15. https://www.drupal.org/project/issues/computed_field
  16. REQUIREMENTS
  17. ------------
  18. This module requires no modules outside of Drupal core.
  19. INSTALLATION
  20. ------------
  21. * Install the Computed Field as you would normally install a contributed Drupal
  22. module. Visit https://www.drupal.org/docs/7/extend/installing-modules for
  23. further information.
  24. CONFIGURATION
  25. --------------
  26. 1. To add a computed field to a content type, navigate to Administration >
  27. Structure > Content types and select the content type to be edited.
  28. 2. Select the "manage fields" tab.
  29. 3. "Add a new field" and now the field type "Computed" is available. Save.
  30. Computed Code
  31. * This is the code that will assign a value to your computed field. It should be
  32. valid PHP without the tags.
  33. Display Code
  34. * This is also PHP code which should assign a string to the $display_output
  35. variable. It has $entity_field_item['value'] available, which is the value of
  36. the computed field. It also has $field (and some language information)
  37. available, and you can call any Drupal functions you want to display your
  38. field. Alternately, the code can be supplied by your own custom function named
  39. computed_field_YOUR_FIELD_MACHINE_NAME_display().
  40. Database Storage Settings
  41. * Data type - This is the SQL data type to use for storing the field contents in
  42. the database. Let us know if you need any other storage types, or if you would
  43. like an 'other' option. For calculating dollars and cents, for example, you
  44. would choose the "decimal" option.
  45. * Data Length - This value will simply be passed on to SQL. For storing up to 10
  46. digit integers (INTs), enter 10. For storing currency as a float, use 10,2
  47. (unless you'll store larger than 10 figure amounts). For storing usernames or
  48. other short text with a VARCHAR field, 64 may be appropriate.
  49. * Default Value - Leave this blank if you don't want the database to store a
  50. default value if your computed field's value isn't set. Following the currency
  51. example above, you would set this to "0.00".
  52. * Not NULL - Leave unchecked if you want to allow NULL values in the database
  53. field. For things like currency, you probably want to check this.
  54. * Indexed - Adds a simple DB index on the computed values.
  55. MAINTAINERS
  56. -----------
  57. * Ra Mänd (ram4nd) - https://www.drupal.org/u/ram4nd
  58. * Vadym Myrgorod (dealancer) - https://www.drupal.org/u/dealancer
  59. * Colan Schwartz (colan) - https://www.drupal.org/u/colan
  60. * Moonshine - https://www.drupal.org/u/moonshine
  61. * Pedro Lozano - https://www.drupal.org/u/pedro-lozano
  62. Supporting organization for Drupal 7:
  63. Colan Schwartz Consulting - (https://www.drupal.org/colan-schwartz-consulting)