Default value for the same field, different depending on content type I am building a website and have 3 content-types.

Type A
Type B
Type C


I built these content types one after another, and used existing field when creating the content-type field Field.

My question is, how do I set a default value for Field for each of my content-types ?
Right now when I set a default it is default for all my content-types.

I want to have

Type A -&gt; Field = value 1
Type B -&gt; Field = value 2
Type C -&gt; Field = value 3
You can easily achieve you goal with the rules module, as @pico34 wrote in his answer, but use the trigger Before saving content instead of After saving new content.

Alternativey, if you need to do that programmatically, you can define your default values in just a few lines of code using hook_node_presave()

Example

/**
 * Implements hook_node_presave().
 */
function YOUR_MODULE_node_presave($node) {
  // set the value of field "field_somefield" in case of node type: a, b or c.
  if (in_array($node-&gt;type, array('a', 'b', 'c')) &amp;&amp; empty($node-&gt;field_somefield[$node-&gt;language][0]['value'])) {
    switch ($node-&gt;type) {
      case 'a' :
        $node-&gt;field_somefield[$node-&gt;language][0]['value'] = 'Default value for A';
        break;
      case 'b' :
        $node-&gt;field_somefield[$node-&gt;language][0]['value'] = 'Default value for B';
        break;
      case 'c' :
        $node-&gt;field_somefield[$node-&gt;language][0]['value'] = 'Default value for C';
        break;
    }
  }
}