送信されたデータから特定のコンテンツ タイプのノードを作成するように Web フォームを構成することはできますか? Web フォームのフィールドがコンテンツ タイプのフィールドと直接一致すると仮定します。
2 に答える
1
//Declare a new StdObj
$node = new StdObj();
//Set the type
$node->type='your_content_type';
//Set the Title
$node->title='title';
//Set the body
$node->body = 'body';
//Set other content fields
$node->field_name[0]['value'];
//Finally use functions to save, submit, and insert the node
$node = node_save($node);
node_submit($node);
content_insert($node);
于 2012-11-08T03:27:22.887 に答える
0
Web フォームと同じフィールドを持つコンテンツ タイプを作成し、そのコンテンツ タイプのノードを作成する権限を匿名ユーザーに付与します。
于 2012-11-04T15:15:12.763 に答える