Skip to main content

Home/ Drupal for Developers/ Group items tagged programmatically create content type

Rss Feed Group items tagged

Daniel Gregoire

Programatic CCK Now Possible! | groups.drupal.org - 2 views

  • <?phpfunction mymodule_enable() {     // Get the files content   $filename = drupal_get_path('module','mymodule') . "/mymodule.cck";  $content = implode ('', file ($filename));      // Build form state    $form_state = array(       'values' => array(            'type_name' => '<create>',            'macro' => $content,      ),     );    // Put it in there     drupal_execute("content_copy_import_form", $form_state);}?>
  •  
    Start with comment 54181 - "This works for me in Drupal 6" and read along.
1 - 1 of 1
Showing 20 items per page