1

For example on a recipe node, exposing a "yield" field on a rendered node to recalculate ingredient quantity values

1

I dont think there is any module that you can use, you can try hook_node_view_alter hook to change the rendered.

If the module wishes to act on the rendered HTML of the node rather than the structured content array, it may use this hook to add a post_render callback. Alternatively, it could also implement hook_preprocess_node(). See drupal_render() and theme() documentation respectively for details.

Check hook_entity_view_alter too

If you want to change in the node create form, there is Conditional Fields Module.

Define dependencies between fields based on their states and values. Conditional Fields for Drupal 7 is an user interface to the new States API, plus the ability to modify fields appearance and behavior on certain conditions when viewing content.

Installation and Usage

3
  • You're wrong, there is a module for just that. Posted in my answer. – Mołot May 20 '13 at 8:04
  • @Mołot Is the availability of module means i am wrong ? – niksmac May 20 '13 at 8:06
  • Yes, in the "I dont think there is any module" part on the beginning of your answer. The rest is valid. – Mołot May 20 '13 at 8:07
1

Computed Field module can be configured to work just the way you need:

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.

2
  • would this allow for end user input? – filmoreha May 21 '13 at 1:45
  • If you will not store it in database, then it might. Tricky part would be to make user able to input. Maybe Webform or Quick Forms are what you are looking for. Ask another question with explanation about user input you want, and who is "end user" in your use case. – Mołot May 21 '13 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.