【发布时间】:2014-11-14 01:26:04
【问题描述】:
在drupal用户注册中,用户应该能够选择他们想要订阅的类型。那么,如何在自定义配置文件注册类型中列出内容类型(节点类型)?
【问题讨论】:
标签: drupal drupal-7 drupal-content-types
在drupal用户注册中,用户应该能够选择他们想要订阅的类型。那么,如何在自定义配置文件注册类型中列出内容类型(节点类型)?
【问题讨论】:
标签: drupal drupal-7 drupal-content-types
您可以使用node_type_get_names() 函数检索所有内容类型。
所以,在 hook_form_alter 添加:
$form['ct'] = array(
'#type' => 'checkboxes',
'#options' => node_type_get_names(),
'#title' => t('What standardized tests did you take?'),
);
【讨论】: