Closed (fixed)
Project:
Feeds
Version:
7.x-2.0-alpha4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2011 at 15:09 UTC
Updated:
8 Apr 2013 at 14:25 UTC
First off. Thanks for a great module!
I'm trying to import some movie reviews into a project I'm working on. The ratings are simple numbers from 1-10. We have chosen to use the fivestar module to handle the ratings on the Drupal side.
As far I can see these fields are not available on the mapping page.
Does Feeds support fivestar or is it on the roadmap?
Comments
Comment #1
Silicon.Valet commentedHere's the code to create your own feed plugin. This could probably be easily adapted to add the ability to work with feeds dynamically based on installed fivestar fields. With enough interest, I might take that on.
Comment #2
chrisjlee commented@Silicon.valet How does one test something like that without having to import export? Is there documentation out there already?
Apologies, as I'm quite new to this
Comment #3
johnbarclay commentedSimpltests are the best way to test such code without running imports. There are a number of examples in feeds/tests and background on simpletests are at: http://drupal.org/simpletest-tutorial-drupal7
Much like views, fields, etc. such code belongs in the fivestar module or a new contrib module, not the feeds module. That is where you should search for any existing work on feeds, though there doesn't appear to be any work done there #1270616: Feeds support
Comment #4
Silicon.Valet commentedwe create import data subsets and make sure that we have guids set. That way feeds can rollback the import. (assuming you don't have some rule based changes firing)
Comment #5
InTheLyonsDen commentedSilicon.Valet et el,
Any breakthroughs on this process? I have about 5k reviews to import and sync with Fivestar w/ Drupal 7. Thanks!
Comment #6
emackn commentedCan't you run your import skipping over the ratings, then run a custom sql script to import your five start settings. You could also write a custom field mapper for fivestar data. See http://drupal.org/node/622700#mappingapi
Comment #7
robydago commented@InTheLyonsDen
if the imported ratings will only be used for display (no editing at all)
- or -
you can live with ratings being editable on node edit only and as "raw" numbers, and most importantly, having only one value\state (i.e. not being a vote)
than you can do what I did:
- create a standard numeric field (e.g. called "field_rating") that will be used to import the ratings via feeds
- import the feeds
- create a token field with some php code to select the correct stars display according to the numeric rating field value
e.g.
- go google for some nice stars icon sets (like this for example) that you'll save in the path shown in the php code above; each "stripe" of stars will be named, in the example above, 0_star_rating.png, 1_star_rating.png, 2_star_rating.png, etc.
Comment #8
Miszel commentedI needed to write a feeds mapper for fivestar for my data import project. I made the code available to the community in a separate module: http://drupal.org/project/feeds_voting_mappers