8 node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
4.6 node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
4.7 node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
5 node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
6 node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)

Generates an array for rendering the given node.


\Drupal\node\NodeInterface $node: A node entity.

$view_mode: (optional) View mode, e.g., 'full', 'teaser', etc. Defaults to 'full.'

$langcode: (optional) A language code to use for rendering. Defaults to NULL which is the global content language of the current request.

Return value

array An array as expected by drupal_render().

5 calls to node_view()
ImageFieldAttributesTest::testNodeTeaser in core/modules/rdf/src/Tests/ImageFieldAttributesTest.php
Tests that image fields in teasers have correct resources.
ManageDisplayTest::assertNodeViewTextHelper in core/modules/field_ui/src/Tests/ManageDisplayTest.php
Asserts that a string is (not) found in the rendered nodein a view mode.
Rss::render in core/modules/node/src/Plugin/views/row/Rss.php
Render a row object. This usually passes through to a theme template of some form, but not always.
TwigDebugMarkupTest::testTwigDebugMarkup in core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php
Tests debug markup added to Twig template output.
UnpublishByKeywordNode::execute in core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
Executes the plugin.
7 string references to 'node_view'
CommentRssTest::testCommentRss in core/modules/comment/src/Tests/CommentRssTest.php
Tests comments as part of an RSS feed.
FrontPageTest::doTestFrontPageViewCacheTags in core/modules/node/src/Tests/Views/FrontPageTest.php
Tests the cache tags on the front page.
PageCacheTagsIntegrationTest::testPageCacheTags in core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php
Test that cache tags are properly bubbled up to the page level.
SearchPageCacheTagsTest::testSearchTagsBubbling in core/modules/search/src/Tests/SearchPageCacheTagsTest.php
Tests the presence of expected cache tags with referenced entities.
UrlTest::setUp in core/tests/Drupal/Tests/Core/UrlTest.php

... See full list


core/modules/node/node.module, line 783
The core module that allows content to be submitted to the site.


function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
  return entity_view($node, $view_mode, $langcode);


$node = \Drupal\node\Entity\Node::load(2);