3 replies [Last post]
justageek's picture
Offline
Bug Finder
Joined: 10/29/2008
Juice: 189
Was this information Helpful?

What is the proper practice for creating modules that add data fields to the core 'product' content type? Do we add fields to uc_product or create a separate table holding our data fields?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: adding fields to product content type

If you can do it through CCK, I would strongly suggest doing that. If not, I would add a table w/ nid as the primary key and store your specific data in there. Then you can use hook_nodeapi() to load up the data when a product node is loaded.

justageek's picture
Offline
Bug Finder
Joined: 10/29/2008
Juice: 189
programmtically through cck

is their a module_invoke() type deal that will create the necessary table and field structure during my modules installation? Or do I have to write the sql to create content_product_whatever table and do all of that?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: programmtically through cck

You'll need a .install file for your module. For that, you can look at how the core files work and review the Schema API docs on d.o.