Importing image nodes into the example site

Source data

Start by downloading Package iconDfH-data-image-nodes.zip. Unzip it; inside you will find one CSV files and a set of image files. If you want to take a look the source data for this import, open Drupal-for-humanists-images.csv in a plain text editor like TextWrangler on Mac, or Notepad on Windows-- not Microsoft Excel, which can corrupt data in a CSV if it gets saved in Excel. The header row contains the following fields:

  • Title
  • Profession
  • Institution
  • Person
  • Image
  • Description
  • Source collection
  • Source URL

Creating the importer and basic configuration

Create a new feeds importer by going to Structure > Feeds importers > Add importer. For the name, call it “Image importer from DfH CSV”, with the description “Imports images using the CSV file from the Drupal for Humanists website.”

The default values under “Basic settings” are mostly fine, but change “Periodic import” to “Off” and save.

Set the fetcher to “File upload” and the parser to “CSV parser”. The default node processor setting is correct. In the settings for the node processor, choose “Image” under “Bundle”. Under “Update existing nodes”, select “Replace existing nodes”. For the author, choose your own account.

Mapping

Create the following mappings:

Source

Target

Target configuration

Title

Title (title)

Click the cog and choose “used as unique”. Click “update” and save.

Profession

Profession (field_profession)

Search taxonomy terms by: term name

Institution

Institution (field_institution)

Search taxonomy terms by: term name, click the cog, check “autocreate”, click “update” then “save”

Person

Person (Node reference by node title) (field_person:title)

 

Image

Image: URI (field_image:uri)

 

Description

Description (body)

 

Source collection

Source collection (field_source_collection)

Search taxonomy terms by: term name, click the cog, check “autocreate”, acheter viagra click “update” then “save”

Source URL

Source URL: URL (field_source_url:url)

 

Import

Go to /import (e.g. yoursite.org/import) and choose “Image importer from DfH CSV”. Click the “Choose File” button and select the Drupal-for-humanists-images.csv file from your computer. The other default settings are fine. Click the “Import” button.

If the import is successful, you’ll see a progress bar, then a notice at the top of the screen that Drupal created 13 nodes. There’ll also be a list of 10 “ does not match an existing node”, which is okay: 10 of the 13 images are not connected to a Person node in the database.

Modules: 
Tags: