[英]export a content type form into a module in drupal6
is there a way to export the form structure of content type and put it in a module as same as we can do in views? 有没有办法像我们在视图中一样导出内容类型的表单结构并将其放入模块中? (and all the cck ofcourse) $form['item']=.....
(以及课程的所有cck)$ form ['item'] = .....
This sounds like what you are looking for here in more detail: 这听起来像您在这里寻找的详细信息:
http://www.tinpixel.com/node/53 http://www.tinpixel.com/node/53
I also use the following code on my sites, the function is a fork from the method used by the install_profile api module and I use this on my sites rather than loading the full module: 我还在我的网站上使用以下代码,该函数是install_profile api模块所使用的方法的分支,并且在我的网站上使用了此代码,而不是加载整个模块:
http://drupal.org/project/install_profile_api http://drupal.org/project/install_profile_api
function MYMODULE_install_content_copy_import_from_file($file) { // The import will be populate into the $content variable. $content = array(); ob_start(); include $file; ob_end_clean(); $form_state['values']['type_name'] = ''; $form_state['values']['macro'] = '$content = '. var_export($content, 1) .';'; $form_state['values']['op'] = t('Import'); drupal_execute('content_copy_import_form', $form_state); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.