Render a Drupal node

限于喜欢 提交于 2019-12-04 23:47:48
Marius Ilie
<?php
  $nid = 739; // NOTE :: Hard coded, but need to be variable!!
  print drupal_render(node_view(node_load($nid)));
?>

NOTE: Reposted, as original answer got deleted.

Marius Ilie

I didn't test it but it should work with

drupal_render(node_view(node_load($nid)))

drupal 7
https://api.drupal.org/api/drupal/includes!common.inc/function/render/7
https://api.drupal.org/api/drupal/modules!node!node.module/function/node_view/7

<?php //use variable to avoid strict warning
$nid = 739;
$nodeview = node_view(node_load($nid));
print drupal_render($nodeview);
?>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!