1

I have 2 content types, account and contact. I have a .csv file which contains the data.

In the Account table we have:

  • name
  • street address
  • postcode
  • city
  • province
  • country
  • created
  • lastModified

and in the contact table we have:

  • initials
  • lastName
  • gender
  • function
  • officePhone
  • mobilePhone
  • otherPhone
  • email

The csv contains all fields from the table like this:

“name”,“street address”,“postcode”,“city”,“province”,“country”,“initials”,“last name”,“gender”,“function”,“office phone”,“mobile phone”,“other phone”,“email”

Is it possible to use the Feeds module to import the csv, separate the data from the csv file and either append, replace or merge the data in the 2 different content types at once?

2

Unless anything has changed in the last couple of weeks, I don't think it's possible to set up one feed to import to multiple content types out of the box. There's some discussion here.

That said, someone did mention the Feeds Node Helper module which apparently does allow this feature, although I'm no sure how robust it is.

Feeds Node Helper is a collection of useful Feeds Import targets and Tampers. This is how book content can be imported and exported between Drupal sites. It provides helpers for the following:

  • UUIDs
  • Book parent based UUIDs
  • Book Weights
  • Node Types (by default Feeds just maps to 1 type, this allows multiple)

EDIT

If the module doesn't work, I don't see any reason why you couldn't simply set up two feeds that both use the same source CSV file; one for each content type.

  • Hi my friend, thanks for replying on this topic. In fact I need to import the csv file once. On file upload, the contents are mapped to the content types. Is there any other way to do it without using the module feeds? – Rishius Alive Dec 19 '12 at 11:35
  • You could look into Migrate - although it's nowhere near as straightforward as feeds (and would require custom coding - docs),and seems a bit overkill. – Chapabu Dec 19 '12 at 11:40

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.