By chiggsy on
I have some perl code that cheerfully parses a static html/php site and puts the content into drupal. So far, so good. What i need to do now is to be able to assign categories to content on the fly. Can someone explain how the taxonnomy module stores content in the db? or even a tutorial on it? I've searched a lot of stuff about it's flaws, but cant seem to find a description of how the taxonomy interacts with the node table.
the goal here is that when i import page content into a node, i also want to put it into a category, and it must be done via db manipulation since i am using perl for this.
Comments
term_node, term_data tables are the key
What you need to do is grab the nid (node id) value for the node you create with your perl script. So when execute a query 'INSERT INTO node .....' - assuming the INSERT query suceeds it will create a nid.
Now you can get this value with a call to the last insert id from mysql.
Then you can insert this value into the term_node column (assuming you know the tid (term id) from the term_data table.
I have a perl script that does exactly this. I'm happy to share it, but won't have access to it until after the new year
thanks
Thanks a lot, that was the hint that should make a difference. I'll try it before the new year for sure.
How about that script?
Any chance I could see that perl script that imports static content?
hi
we all need a good importer to move static content to drupal..pls help
seek
If you started with the modules list you'd find a few, like import_html
That's more likely to be useful than repeat-posting requests onto threads from last year.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
dman u r right
however the import html seems too complicated and technical for a novice like me...can u something easier for people like me
Copy & Paste
Because there are a million different ways the source HTML may look, import_html is indeed complex to deal with it all.
If you can get your pages down to pure text, I think there was a CSV import at one time ... import/export
Otherwise, get happy with copy & paste. It's probably best for sites less that 100 pages anyway.
If you have more, it'll take a few days. But so would setting up and customizing a solution anyway.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
importing html book pages/files into Drupal
i am interested in importing text only..the pages may have other things..but i would be happy to get just the text..if i can get the info from http://vedabase.net/ into Drupal...it would be great...
pls help me out..thanks