Module to create and populate CCK nodes from existing database table
Hello all, I need a module which will create CCK nodes according to structure of an existing database table. More specifically, the idea is following: I have a few tables containing some data. I would like to represent them as Drupal content so that it becomes easier to add/modify/delete the entries. 1. So I am planning to create a new "content type" for each table looking at its columns. ( For e.g. if a database table called "db_table" contains columns called "column1", "column2", "column3", then I wish to create a new content type called say "db_table_node" with members as textfields called "column1", "column2" and "column3". ) 2. I am planning to import data in that table into drupal as nodes. I was not able to find any module to do this (I'm using D6). Seems like no choice but to write a new module for this. All suggestion welcome! - Pushya
I would love to see a module do this. I often have a need for something like this. It would be great if it could use data created by other Content types also. On Fri, Sep 5, 2008 at 8:22 AM, Pushyamitra Navare <pushyamitra@gmail.com>wrote:
Hello all,
I need a module which will create CCK nodes according to structure of an existing database table.
More specifically, the idea is following:
I have a few tables containing some data. I would like to represent them as Drupal content so that it becomes easier to add/modify/delete the entries. 1. So I am planning to create a new "content type" for each table looking at its columns. ( For e.g. if a database table called "db_table" contains columns called "column1", "column2", "column3", then I wish to create a new content type called say "db_table_node" with members as textfields called "column1", "column2" and "column3". )
2. I am planning to import data in that table into drupal as nodes.
I was not able to find any module to do this (I'm using D6). Seems like no choice but to write a new module for this. All suggestion welcome!
- Pushya
I would love to see a module do this. I often have a need for something like this. It would be great if it could use data created by other Content types also.
Well I wrote autonode (drupal.org/project/autonode) a while ago, its a bit different, but might be what you eventually need for, or a base to start from if you want to code. Its only for D5 though. Balazs
I will check that out!!! Thnks for the tip. Gina On Fri, Sep 5, 2008 at 10:54 AM, Balazs Dianiska <csillagasz@gmail.com>wrote:
I would love to see a module do this. I often have a need for something like this. It would be great if it could use data created by other Content types also.
Well I wrote autonode (drupal.org/project/autonode) a while ago, its a bit different, but might be what you eventually need for, or a base to start from if you want to code. Its only for D5 though.
Balazs
You could use node_factory module (not tested for D6) and if you want command line interface you can use drush. node_factory knows a few cck fields, og, free format tags With drush you can insert your nodes from the command line too. drush nf create json 'json-string' If you are willing to test node_factory for D6 I will apply your findings asap :-) Regards, Clemens
On Fri, Sep 5, 2008 at 8:45 PM, Clemens Tolboom <clemens@build2be.nl> wrote:
You could use node_factory module (not tested for D6) and if you want command line interface you can use drush.
node_factory knows a few cck fields, og, free format tags
With drush you can insert your nodes from the command line too.
drush nf create json 'json-string'
If you are willing to test node_factory for D6 I will apply your findings asap :-)
Hey, Thanks for the tip. My guess is that I will end up testing it for D6. Will update you with findings quite soon. :-) Pushya
I would love to see a module do this. I often have a need for something like this. It would be great if it could use data created by other Content types also.
Well I wrote autonode (drupal.org/project/autonode) a while ago, its a bit different, but might be what you eventually need for, or a base to start from if you want to code. Its only for D5 though.
Really, this is more of a support question. See http://drupal.org/support FWIW, node_import is probably what you are looking for. Daniel
On Fri, Sep 5, 2008 at 8:24 PM, Balazs Dianiska <csillagasz@gmail.com>wrote:
Well I wrote autonode (drupal.org/project/autonode) a while ago, its a bit different, but might be what you eventually need for, or a base to start from if you want to code. Its only for D5 though.
Yes, I will use it as starting point when I start coding a module. I can also try and use/modify it to work with D6 (If you're willing to help, cool!). How much work is involved? Is there some major difference between D5 and D6 for autonode to work? What I can probably do is: 1. Create a new CCK node type ( programatically ) based on table name. 2. _All_ node fields can be handled by keeping them CCK autonode fields referring to columns in table. ( Will I need nid, vid columns in existing table? ) This way, node details can be loaded from existing table; any node edits will be reflected in existing table. And we will be providing existing table in editable form as Drupal nodes. Anyone with spare time willing to help? :-) - Pushya
You could try node_factory together with drush. Hmmm ... the drush integration is only for 5.x-1.x-dev And node_factory is not tested for D6 ... so if you test node_factory from within the devel php block I will do a upstream to node_factory drush integration. [1] http://drupal.org/project/node_factory [2] http://drupal.org/project/drush On Fri, 2008-09-05 at 17:52 +0530, Pushyamitra Navare wrote:
Hello all,
I need a module which will create CCK nodes according to structure of an existing database table.
-- Clemens Tolboom http://build2be.com
participants (5)
-
Balazs Dianiska -
Clemens Tolboom -
Daniel F. Kudwien -
Gina Beisel -
Pushyamitra Navare