If you want to learn how to create a custom content type with custom fields.

  $type = node_type_load('content_type_name');
  if (!$type) {
    $type = array(
      'type' => 'content_type_name',
      'name' => t('Content Type Human Name'),
      'base' => 'node_content',
      'description' => t(
        "Description of <em>Content Type Human Name</em> goes here."),
      'custom' => 1,
      'modified' => 1,
      'locked' => 0,
    );

    $type = node_type_set_defaults($type);

    // Create a custom Text Field
    $field = array(
      'field_name' => 'my_text_field_name',
      'type' => 'text',
      'entity_types' => array('node'),
    );
    $field = field_create_field($field);
    $instance = array(
      'field_name' => 'my_text_field_name',
      'entity_type' => 'node',
      'bundle' => 'content_type_name',
      'label' => t('Custom Field Human Name'),
      'widget' => array('type' => 'text_textfield'),
    );
    $instance = field_create_instance($instance);
    // Create URL Field

    node_type_save($type);
    node_add_body_field($type);
  }

Comments

nevets’s picture

You are starting to look like a spammer with these posts, you should consider joining the document team as this has been cover elsewhere.

WorldFallz’s picture

Yes, please consider adding your documentation to the documentation pages rather than random forum posts.