Is it possible to call the contents of specific fields into a PHP script running in the same node? For example, let's say a node type exists that has a field for product number (SKU) and I want to call that variable into a function. I noticed that PHP snippets can be inserted directly into fields, but I have no idea:

1) If individual field contents are callable by variable name, OR

2) What the call form might be.

Thanks!

Comments

2houseplague’s picture

This suggests what I want is at least compatible with Drupal's nested function scheme:

"Functions are therefore defined inside other functions in Drupal, with respect to the runtime scope. This is perfectly legal. However, PHP does not allow the same kind of nesting with class declarations. This means that the inclusion of files defining classes must be "top-level," and not inside any function, which leads either to slower code (always including the files defining classes) or a large amount of logic in the main index.php file. -- from: http://api.drupal.org/api/HEAD/file/developer/topics/oop.html

To give a more concrete example of what I'm looking to do, here is a very simple expression of the concept:

include '/query?=(contents of NAME field)';

http://profitlabinc.com

2houseplague’s picture

http://drupal.org/project/computed_field

Looks like I found the answer for myself. Here it is, that others may profit from the answer.