Feeds Module

From Stadm
Jump to navigationJump to search


Feeds is a Drupal module for importing data from feeds or structured content files (ie. csv).

About

  • Import csv data as nodes of a specified content type
  • Module located at "import" page
    • Several built in Importers
    • You can add more importers in the module configuration page
  • Can import csv with three types of delimiters
  1. semicolon
  2. comma
  3. TAB

Use

  • Feeds can be used in two ways
  1. To sync data from an rss feed
  2. To import or migrate data in the form of a CSV file

Pre-configuration

  • Before importing your content, you should set up an importer unless you plan on using the Events Importer that imports fields title, date, url and pi as nodes with the content type Event.
  • To add an importer
    • Go to admin->modules->Feeds->Feeds Admin UI->Configure->Add Importer
    • Enter name and description of the importer you are creating
      • On the configuration page of your importer:
        • Fetcher -- change import type (upload or url)
          • In the settings subsection you can chose which filetypes should be allowed
      • You can select the parser to be used in the Parser field
        • In most cases you should use CSV because it is easier to match to database
          • In the settings you can change the default delimiter -- a semicolon is often the most effective because it is usually not used in content
      • Select Node Processor
        • In settings, chose the content type for which you would like to add the imported nodes
        • In Node Processor Mapping, you can select which CSV fields should be put into each Event Field in Drupal

Exporting

    • To use, place an exported xml file containing data from the old events database into the same directory as the script
    • the script should initially load a form that will ask you for the name of the file -- select it in the drip down menu and press Submit.
    • a link will appear to download the converted file
    • You should check the file for obvious errors before you upload it
      • Check to make sure there aren't any semicolons that should not be used as a delimiter
      • Check to make sure there aren't any new lines wehre there shouldn't be.

Importing

  • How feeds works
    • In the feeds configuration settings, there is an option to add more "Importers" (see Pre-Configuration guide above)
    • I created an import function specifically for events
    • go to /import
    • select the Importer you want to use
    • leave all options as they are, and choose the converted file with the upload form
    • Click "Import"

Notes

  • Importing dates can be problematic
  1. If you don't already have a content type set up, you should change the date field in the content type settings to not alter the time zone in "Time Zone Handling"
  2. IF you do have a content type set up, you should make sure all the dates you are importing have a time following the date (it should look something like "2012-08-10 07:30:00")
    1. If you want to change these to all day events (so time doesn't show up in Events view) you have to manually go through each imported event and select the checkbox for "All Day"
    2. Feeds does not have a way of importing data into All Day checkbox, so it appears this process can't be automated