now,i want to custom a module by myself,expect someone can do me some favors. many thanks. the following is my thinking and some ways i did.
i use CCK module creating two content type "production" and "merchant", the production have four field (title, production introduction, merchant name (which merchant 开发者_如何学Gothe production belongs to , when you click the merchant name field,it will get to the merchant's page. and under the merchant's introduction i want to show all the productions which belongs to the merchant ). production image,) the merchant have three fields(title, merchant introduction,merchant image)
ps:every production only have one merchant,every merchant can have one or more productions.
the module which i want to custom can get this effect, clicking the merchant field in production part,it will get to the merchant's page. and show all the productions which belong to the merchant under the merchant's production). i thought maybe i use the hook_nodeapi and hook_form_alter ,node_node can get that.
Q1:how to make the database? how many fields i should created. Q2,how to write the hook_api's part. and make sure i can't add the same name merchants.
You don't have to code a single line to accomplish this. I've done the same many times using CCK's node reference fields, the node relationships and views module.
精彩评论