I want to be able to choose an input filter when I import. How can I do this? especially when I'm importing HTML to a custom a field

Comments

dooug’s picture

Feeds does allow to set the node body format, but I don't think Feeds supports setting a custom field's format.

If you are familiar with writing a custom module, try the suggestions in this issue: #1191184: Update Feeds News feature

This code is from comment #3 in the issue I mentioned:

<?php
function yourmodulename_node_presave($node) {
  //
  // Workaround for Feeds module setting text format to Plain Text instead of Full HTML or Filtered HTML
  //
  if ($node->type == 'feed_whoi') {
      $node->body['und'][0]['format'] = 'full_html';   
  }
}
?>

Replace your node type where it says feed_whoi and replace the $node->body... with something like $node->field_CUSTOMFIELDNAME['und'][0]['format'] = 'full_html';.

andyf’s picture

Just thought I'd add that the text format configured for the processor is also used for any text fields. AFAICT there's currently no support for per-field configuration of text formats. HTH

twistor’s picture

Status: Active » Fixed

As stated in #2, setting the input format is supported on the Processor settings page.

Status: Fixed » Closed (fixed)

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

ibar’s picture

Status: Closed (fixed) » Active

Setting the input format can be set on the Processor settings page as noted in #3 but since the upgrade to feeds-7.x-2.0-alpha6 it doesnt work any more. Although I have set it to Filtered HTML it imports the body in plain text, so I have to open the created node and resave it in order to work.
Is there a fix for this?
I will try o implement the new module creation mentioned in #1191184: Update Feeds News feature.

lyricnz’s picture

Status: Active » Fixed

Yes, it was briefly broken. WIll be fixed in the next release. See #1807920: Imported nodes have NULL format.

mrharolda’s picture

Fix confirmed in feeds 7.x-2.0-alpha7!

http://drupal.org/node/1822298

Status: Fixed » Closed (fixed)

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