我正在寻找一种在代码中创建有机组的方法。在网上我找到了很多关于如何将节点添加到组等的资源,但没有找到如何创建组本身。
我已经使用drupal界面完成了它,但这不是很便携。我尝试过使用功能模块,尽管我发现这有很多问题。缺少字段等
通过界面,您可以通过创建新的内容类型来创建组,然后在“有机组”选项卡下选择“组”
我知道如何在代码中创建内容类型
$type = array(
'type' => 'Termbase2type',
'name' => t('Termbase2name'),
'base' => 'node_content',
'custom' => 1,
'modified' => 1,
'locked' => 0,
'title_label' => 'Termbase2',
'description' => 's a database consisting of concept-oriented terminological entries (or ‘concepts’) and related information, usually in multilingual format. Entries may include any of the following additional information: a definition; source or context of the term; subject area, domain, or industry; grammatical information (verb, noun, etc.); notes; usage label (figurative, American English, formal, etc.); author (‘created by’), creation/modification date (‘created/modified at’); verification status (‘verified’ or ‘approved’ terms), and an ID. A termbase allows for the systematic management of approved or verified terms and is a powerful tool for promoting consistency in terminology. *wiki',
'og_group_type' => 1,
'og_private' => 0,
'og_register' => 0,
'og_directory' => 0,
'og_selective' => 3,
);
$type = node_type_set_defaults($type);
node_type_save($type);
node_add_body_field($type);
但我找不到任何关于如何将内容类型设置为组的线索,因此它可以有组成员。