Tuesday, April 23, 2013

Import images using Drupal feeds module

View updated version of this blog here.

Importing text content using Drupal feeds module is easy. Importing images using feeds is easy too but it requires a bit work and it is not as straightforward as importing text content.

At first you have to copy image files on your server, you can copy them anywhere inside your website directory, but I prefer copying it to public files directory(sites/default/files).

After you have copied the images, you need to create a CSV importer. Inside that CSV importer we will specify the path of the image. Look at the feed importer:
Feeds importer


Product images is the important thing in this feed importer. Product images is an image field.

Here is the CSV importer:

"SKU";"Title";"Description";"Brief Description";"Taxonomy Terms";"Product Selection";"Product Images"

"IMPORTED-PRODUCT-1";"Imported product display one";"This is an imported product one. This is an imported product one.";"This is an imported product one";"Clothing";"IMPORTED-PRODUCT-1";"http://mysite.local/sites/default/files/_MG_4933-s.jpg"


If you have already uploaded the image to the server then you can import data using the CSV.

This was about importing images using feeds. Suppose, the field accepts multiple images and you want to import multiple images using the importer, then you can use feeds tamper module for this. Look at the feeds tamper configuration for the images field:
Feeds tamper setting

Feeds tamper configuration for images field

You can change the exploding character to anything else, but make sure the character is unique and is not present in the URL of image.

Here is the CSV importer for importing multiple images:

"SKU";"Title";"Description";"Brief Description";"Taxonomy Terms";"Product Selection";"Product Images"

"IMPORTED-PRODUCT-1";"Imported product display one";"This is an imported product one. This is an imported product one.";"This is an imported product one";"Clothing~Jackets";"IMPORTED-PRODUCT-1";"http://mysite.local/sites/default/files/compressed/_MG_4933-s.jpg~http://mysite.local/sites/default/files/compressed/_MG_4934-s.jpg"


I hope everything is clear. Good luck :)

7 comments:

  1. Hi, nice blog & good post. You have beautifully maintained it,Its really helpful for me, hope u have a wonderful day & awaiting for more new post. Keep Blogging! I have a Web Hosting package related blog/site drupal

    ReplyDelete
  2. Thank you very much it helped me

    ReplyDelete
  3. Thanks . Muy buenooo

    ReplyDelete
  4. Thanks for updating new information about web designing. It helped me a lot to improve my businesses. Practically as a developer you have shared lot of details about website designing. Also share your new updated details about website creation. Thanks mate.

    ReplyDelete
  5. Its really a nice update and helpful information. Developing a new website is not an easy way and after developing the websites have to be get the result. So many things are there to develop. As a developer i gathered coding related points and information from your blog.

    ReplyDelete
  6. I get a lot of great information from this blog. Thank you for your sharing this informative blog

    ReplyDelete
  7. I am following your blog from the beginning, it was so distinct & I had a chance to collect conglomeration of information that helps me a lot to improvise myself. I hope this will help many readers who are in need of this vital piece of information. Thanks for sharing & keep your blog updated.

    ReplyDelete

I am eager to hear from you