8.5.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
8.0.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
8.1.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
8.2.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
8.3.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
8.4.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
8.6.x node.module node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL)
4.6.x node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
4.7.x node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
5.x node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
6.x node.module node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
7.x 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/tests/src/Functional/CommentRssTest.php
Tests comments as part of an RSS feed.
FrontPageTest::doTestFrontPageViewCacheTags in core/modules/node/tests/src/Functional/Views/FrontPageTest.php
Tests the cache tags on the front page.
PageCacheTagsIntegrationTest::testPageCacheTags in core/modules/page_cache/tests/src/Functional/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 811
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);