0
votes

I know there is the Content Construction Kit for Drupal, which provides a useful UI for adding new Content Types in Drupal. However, I find it hideously slow and painful to create large new content types.

reason

I want to create a Content Type so I can convert all data to being a node, and therefore expose it to Views and be able to have a good UI for updating nodes.

possible?

  1. Is there any module that will "convert" an sql query into it's hook_form() equiv?
  2. Will hook_form() expose it to Views?
  3. Any others ideas?

Cheers

Gary


just one example of 100s of table sql query to be converted imagine the the pain; the sleepless nights, the tripping over the bundles of hair on the floor of creating each field in CCK

CREATE TABLE `files` (
  `file_id` int(11) NOT NULL auto_increment,
  `user_id` int(10) NOT NULL default '0',
  `file_author` varchar(255) NOT NULL default '',
  `file_email` varchar(255) NOT NULL default '',
  `file_type` varchar(100) NOT NULL default '',
  `file_name` text NOT NULL,
  `file_file` varchar(255) NOT NULL default '',
  `file_url` varchar(255) NOT NULL default '',
  `file_desc` text NOT NULL,
  `downloads` int(11) NOT NULL default '0',
  `file_date` int(11) NOT NULL default '0',
  `file_review` text NOT NULL,
  `screenshot` text NOT NULL,
  `updated` int(12) NOT NULL default '0',
  `update_notes` text NOT NULL,
  `author_desc` text NOT NULL,
  `sub_author` varchar(50) NOT NULL default '',
  `version` varchar(10) NOT NULL default '',
  `mirc_version` varchar(10) NOT NULL default '',
  `reviewer` varchar(50) NOT NULL default '',
  `posted` int(1) NOT NULL default '1',
  PRIMARY KEY  (`file_id`),
  KEY `user_id` (`user_id`),
  KEY `file_author` (`file_author`),
  KEY `file_type` (`file_type`),
  KEY `downloads` (`downloads`),
  KEY `file_date` (`file_date`),
  KEY `updated` (`updated`)
) ENGINE=MyISAM AUTO_INCREMENT=4544 DEFAULT
2
i'm in the exact same situation; what did you end up doing to solve it? - ted.strauss

2 Answers

0
votes

The hook_form() is not really a hook but nonetheless it's just generating forms, it's not handling the storage.

If you want to manage a custom storage to avoid CCK you will have to declare your tables through the schema API and then handle the actions you want to perform in the hook_nodeapi() or the submit callback automatically invoked.

Good luck for your quest.

0
votes

If you have existing data you want to access from Drupal (Views), I recommend one of these solutions:

  1. Create CCK content types and import your data using the Migrate module
  2. Make the data available to Views using the Table Wizard module