Hello,
Great module!
In my CSV I have a few situations where I have multiple columns that need to be concatenated into one CCK field on my node. An example is:
CSV Columns: Area Code, Phone Number
Node Field: Phone Number (including area code)
At first I thought this would be easy enough to do in hook_import_node_import_prepare(), I can just massage the data how I need. However, there is a problem in that I only have access to the $node variable in that hook. Is there any way to get the current CSV Row data in this hook? Or some other way to go about doing this? That way I could just say something like:
$node->phone = $row['area_code'] . $row['phone'];
The only way I can figure to do this is to create a hidden field for each CSV field I need access to but is not mapped to a node field directly. I would then have the data available to me in $node. This would work, but I don't want a bunch of hidden fields on my node just to make the import work if I can at all avoid it. Any ideas on how I can get this working? Perhaps I just need a nudge in the right direction. Thanks a lot.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node_import_271844b.patch | 1.79 KB | KingMoore |
Comments
Comment #1
KingMoore commenteddp.
Comment #2
KingMoore commentedThis patch does what I want, giving access to $row in hook_node_import_prepare. What do you think?
Comment #3
ajason98 commentedIs there anything like this for drupal 6?