0

I'm using computed field for my content types, but when I used $node, in Display Code, it doesn't display anything :

global $node;
$display_output = l("Apply", "apply_form?job_offer=".$node->nid); 
  • What version of the module do you have? – Steven Sep 24 '13 at 12:16
0

First of all, you are supposed to write to $entity_field[0]['value']. Second problem is that fields operate on entities, not nodes, so you need to use $entity instead. You can always use Devel module and dpr($entity) to see what's in it.

node id should be in the entity field if it is a node. In which case you can load it with node_load().

  • node id should be in the entity field if it is a node. In which case you can load it with node_load(); – Steven Sep 24 '13 at 12:40
  • Thank you, some example here : drupal.org/node/149232 – Bibix Sep 24 '13 at 13:26
  • @Bibix glad you found it :) hope it works for you now. – Mołot Sep 24 '13 at 13:28

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.