繁体   English   中英

将内容类型表单导出到drupal6中的模块

[英]export a content type form into a module in drupal6

有没有办法像我们在视图中一样导出内容类型的表单结构并将其放入模块中? (以及课程的所有cck)$ form ['item'] = .....

请参阅功能模块。 创建功能时,可以包括节点类型,CCK,视图,ImageCache预设甚至模块依赖性。

这听起来像您在这里寻找的详细信息:

http://www.tinpixel.com/node/53

我还在我的网站上使用以下代码,该函数是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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM