content

Events happening in the community are now at Drupal community events on www.drupal.org.
nhocmuonlanhoc's picture

vấn đề về node trong drupal 7 .

mình muốn tạo ra 1 page sử dụng node ,

mình sử dụng đọan code sau


function create_node()
{
//body content
$body_text = 'Here code for body';

$node = new stdClass();
$node->type ='page';
//setup default value for the node

node_object_prepare($node);

$node->title = ' Page tested create';
$node->language = LANGUAGE_NONE;

$node->body[$node->language][0]['value'] = $body_text;
$node->body[$node->language][0]['summary'] = text_summary($body_text);
$node->body[$node->language][0]['format'] = 2;

$path = 'content/tested_page';

Read more
Subscribe with RSS Syndicate content