How can I specify which CCK node type to create when using Import HTML? For example, I created a CCK node type called "Import Corp" with name "content_import_corp". I created a single field called import1 so it's named field_import1. Do I need to modify the XSLT or module so that the import creates a "content_import_corp" node instead of just a page node? I have a <div id="import1">...</div> section in the HTML page that I want to import into Drupal.

I tried changing <node type="story"> in the XSLT to be <node type="content_import_corp"> but the import HTML module still created page nodes with a title and body field instead of a content_import_corp node with a title and field_import1.

I also tried modifying the import_html.module array variable $import_html_file_classes but that only caused the import to create a static HTML file in my files/imported directory.

Any guidance would be greatly appreciated. Or maybe I don't fully understand how this feature of Import HTML works? Thanks!

Here's what my test HTML page looks like which imports a page correctly. Now I want it to import as a content_import_corp node instead.

<html>
<head>
<title>My title</title>
</head>
<body>

<p>here's a teaser</p>

<div id='main'><div class=h7>this is the main body</div><br></div>

<p>here's paragraph 2</p>

<div id='import1'><div class=h7>this is what i want to import</div><br></div>

</body>
</html>

When I add debugging, this is the import-xml node the process generates:

<?xml version="1.0" encoding="UTF-8"?>
<nodes xmlns:xhtml="http://www.w3.org/1999/xhtml"><node type="content_import_corp"><title>My title</title>
<teaser><p >here's a teaser</p></teaser>

<body><div class="h7" >this is the main body</div><br /></body>
<user uid="1">dman</user>
<vocabularies><vocabulary vid="1"><name>Section</name><terms><term tid="3"><name>Portfolio</name></term></terms></vocabulary></vocabularies></node>

</nodes>

Comments

vcheng’s picture

I see I needed to update my code to get the setting where I can specify the node type to be imported!