Programmatically Creating Drupal Nodes

The Drupal for Developers event was great fun this week. I did a 15 min presentation on Programmatically Creating Drupal Nodes. The slides from this presentation will be going up on the Drupal UK site in the near future, but you can get a preview of the presentation below.

Some of the other developers were able to contribute their own experiences, in particular about how painfully slow drupal_execute() can be.

I presented a case study from a site I have been working on recently where over 5k of content items had to be imported from XML data. I talked about setting up the content types with CCK (and ImageField) as well as creating a compound CCK field in a module, and what hooks to implement in order to create a simple Custom compound CCK field type.

I then went on to explain the import process, converting XML to an array of $field_values for use with drupal_execute().

Programmatically Creating Drupal Nodes
AttachmentSize
ProgrammaticallyCreatingDrupalNodes.pdf1.88 MB

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options