HTML fields

Can someone help me find where I can specify a field as HTML content? We have a lot of HTML descriptive content and the import is escaping the code.


Are you using the CSV or OAI to import this data?

CSV import

Was the ability to mark fields HTML added since version 1.0? I would swear I'd seen this checkbox somewhere? Is it only in the OAI importer?

I really need to import fields containing HTML through CSV Import unescaped.

Do you have the HTML purifier plugin installed, by any chance?

In CSV, there isn't a way to mark that incoming text is HTML, but we're going to look into it.

I will take a look to see if the plugin is installed. Thanks for the info. I will look at the code to see where it is escaping HTML and comment it out .

Hi folks,

thanks for finding this issue. Currently, the Csv Import plugin does not allow you to specify that a column is HTML data, although, perhaps it should.

In the short run, try this:

Edit plugins/CsvImport/models/Import.php

Change this line:

$itemElementText = array('text' => $columnValue, 'html' => false);

to this line:

$itemElementText = array('text' => $columnValue, 'html' => true);

Let me know if this works.

This works for me. I was cautious, so I limited the fields that would allow HTML, like this:

$allowHtml = ($elementName == 'Description' || $elementName == 'Text');
$itemElementText = array('text' => $columnValue, 'html' => $allowHtml);