简体   繁体   English

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

[英]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'] = .....

See the Features module. 请参阅功能模块。 When you create a feature, you can include node types, CCK, views, ImageCache presets and even module dependencies. 创建功能时,可以包括节点类型,CCK,视图,ImageCache预设甚至模块依赖性。

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.

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