2012-10-11 40 views
0

在Drupal 7中,我需要Programmatically創建節點。像往常一樣,Different Fields設置爲Different Content TypesDrupal 7「新建節點」是否啓動/準備不同內容類型的字段?

對於非常簡單的例子:

Content Type: "car" 
Fields: "Model", "Engine", "GearType" 

Content Type: "article" 
Fields: "Title", "Author", "Media" 

我想在這裏證實是,while我創建一個新的節點,用於例如使用:

$node = new stdClass(); 
$node->type = "car"; 

然後..

  • 是(目前正在創建)新的$node已啓動/加載其相關的/對應d字段,之前已經保存?
  • 要更清楚一點,如果我突然保存節點node_save($node)(未填寫任何其他相關字段),那麼node是否仍然具有(遵循)其正確的內容類型結構?

回答

相關問題