Feed Element Mapper should be able to map to node title and node body just as to any other element.

Comments

alex_b’s picture

Make sure 'mapping to 0' = hiding these fields is possible #323501: Hiding selected feed mappings?

alex_b’s picture

Title: Support mapping to title and body elements » Support mapping to node title and body

More accurate title.

alex_b’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

That's my first shot at this. Mapping to title, created date and body working quite well. It's going to be harder to make this completely override default feedapi node processor mappings. With completely override I mean e. g. not storing any body if the description -> body mapping is removed.

alex_b’s picture

Title: Support mapping to node title and body » Full overridability of node title, body, etc mapping
Status: Needs review » Active

I committed this to HEAD.

What's missing is full overridability as described in #3.

Per default mapper should show mappings as executed by feedapi_node, if these mappings are removed, targets should stay empty.

I need to think better on how to build this but for now I am thinking there should be a 'default' $op in hook_feedapi_mapper() that allows a mapper to define a default mapping. This default mapping is used to execute mappings on feed items that don't have a mapper defined and it is used to populate the configuration form.

siharris’s picture

StatusFileSize
new153 bytes

When you're mapping a feed element to body, looks like FeedAPI still maps the description to teaser.

This patch also maps the chosen feed element to the teaser if you're mapping to body.

KoCo’s picture

+1 subscribe

alex_b’s picture

#5 - this is actually OT, could you post a patch according to coding standards http://drupal.org/coding-standards on a separate issue? Thank you!

robertdjung’s picture

subscribe

iva2k’s picture

@alex_b:
Got a patch attached to a new issue #504642: Node teaser mapped from description - want to copy node body to teaser upon mapping . Please review there.

giorgio79’s picture

Hello,

I have title and body in my feed, yet, they do not get imported.

I have followed Sean's steps here, http://drupaltherapy.com/node/34, and I notice he did not need to map title and body feed fields, to his title and body node fields, and automagically it worked for him.

Still I checked, and even if I wanted to, on feed element mapper, the title and body fields do not show up in the dropdowns so I cannot tell the feed mapper to put my title and body from csv into the title and body of the node.

Can someone give me some light?

When I try to do the import all my nodes were imported with "No Title"

Even in the preview it shows "No Title"

All feed items of this feed merged into one. Here you can see which feed item elements are available for mapping. As this view is derived from the actual feed items on this feed, there might be more mappable elements than those listed here.

Array
(
    [title] => No title
    [description] => 
    [options] => Array
        (
            [timestamp] => 1247178149
            [guid] => b18ac06ea7acbf7b13242b0b1879fd75
            [raw] => Array
                (
                    [Title] => Whatever
                    [Tags] => Tags,Are,Detected,Here
                    [Taxonomy] => Computing & Internet
                    [Body] => Upgrades 
                    ...some more cck fields
                )

        )

)

giorgio79’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta9

Hmm, Alex I also checked your patch, but apparently there is no feedapi_mapper_node in my mappers folder in the latest version of the module? Has it been dropped?
I notice it exists in previous versions.

giorgio79’s picture

Sorry, it seems my feedapi mapper was not updated properly, so the node mapping file exists, yet the title and body was not imported.
I will try with mapping the title raw and body raw instead of the plain title and body now.

giorgio79’s picture

Status: Active » Reviewed & tested by the community

Ok, I got it to work finally by using the Title (raw) and body (raw) mappings, because those were coming straight from the csv file.

Thanks for this.

giorgio79’s picture

Status: Reviewed & tested by the community » Fixed

I guess I can set it straight to fixed :P

alex_b’s picture

Title: Full overridability of node title, body, etc mapping » Mapper for node title, body, etc

giorgio79: I think you misunderstood the issue. But I must say that the focus of this issue has shifted in #4 which is not ideal anyway.

I'd like to leave this closed then. I'll rename this issue to its original title and open a separate one for full overridability:

#518180: Full overridability of node title, body, etc mapping

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

emilyf’s picture

Version: 6.x-1.0-beta9 » 6.x-2.0-alpha3
Status: Closed (fixed) » Active

I'm sorry to reopen this issue, but I'm trying to figure out what other issue I should be following. I want to be able to map the feed description field to a custom field in my content type that is NOT the generic body field.

I am using the 2.x alpha release.

I looked here http://drupal.org/node/518180 which references 2 other issues but neither of those issues is explicit in saying it will do this.

emilyf’s picture

Status: Active » Closed (fixed)

Agggg. Sorry, I understand now. For anyone else trying to figure this out, this feature is indeed rolled into the 2.x version. You just need to delete the pre-mapped description element for it to show up in the mapping drop down.