开发者

data that non changing frequently in drupal - how to do it right?

i got a form (using form api and drupal_Get form ) and i got a form开发者_开发问答 with 50 fields and some of them are non frequently chaning data like hobbies, year of birth , city/country etc... i currently do just them in array in file and put them in #options=>$array ... is that the fastest way to save resources? or should i use taxonomy/variable_set/database query/block/node or whatever?


  • variable_get/variable_Set : Is generally used to store admin preferences for the site. If these are user specific I don't think it's a good idea to save them using variable_set

  • taxonomy : Can also be used for populating the values of drop-downs, that is for options in the listing. In your case create a vocabulary called hobbies and add swimming,reading,drupaling as terms. Then use the content-taxonomy to use taxonomy terms as drop downs using CCK moudule.

  • nodes : Anything that is user specific should go in as nodes. And any content that can be created by the users should also go in as nodes.


For administering forms you can use variable_set/variable_get.
But for your task it seems like that users enter their bio, so in this case you should store each form submission to new "row", as you do now for file (wonder why you don't use DB storing).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜