在我的drupal程序的这一段中,我使用页面回调函数在页面上显示节点。现在我需要做的是删除基于其ID的节点。根据drupal中的id删除节点7
我希望通过在每个显示的节点旁提供一个“删除”链接来完成此操作。谁能帮我这个? 我对Drupal很新。所以一个详细的答案将不胜感激。 在此先感谢。
function mfrp_nodelist() {
$query = new EntityFieldQuery();
$result = $query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'article') //this part also confused me, is it bundle, type or both? bundle works for me
->propertyCondition('status', 1)
->propertyCondition('uid', '1');
$result = $query->execute();
$nids = array_keys($result['node']);
$nodes = node_load_multiple($nids);
$output = node_view_multiple($nodes);
return $output;
}
$ nids = array_keys($ result ['node']);. $ nids是一个包含所有节点的节点ID的数组吗?如果是这样,为什么不能使用foreach循环打印节点ID? – Saikat
根据您的解决方案进行链接,我需要单个节点ID。我怎样才能获得这些? – Saikat
你能分享你的查询输出吗? –