commit 37be6866e8f93cf481851a0cb7dd36c61e5f0076 Author: Joel Pittet Date: Sat May 23 21:42:49 2015 -0700 18 diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 4f01f09..f307555 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -586,6 +586,12 @@ function template_preprocess_node(&$variables) { // - The node is in preview and view mode is either 'full' or 'default'. $variables['page'] = ($variables['view_mode'] == 'full' && (node_is_page($node)) || (isset($node->in_preview) && in_array($node->preview_view_mode, array('full', 'default')))); + // Helpful $content variable for templates. + $variables += array('content' => array()); + foreach (Element::children($variables['elements']) as $key) { + $variables['content'][$key] = $variables['elements'][$key]; + } + // Display post information only on certain node types. $node_type = $node->type->entity; // Used by RDF to add attributes around the author and date submitted. @@ -604,12 +610,6 @@ function template_preprocess_node(&$variables) { unset($variables['elements']['uid']); unset($variables['elements']['created']); - // Helpful $content variable for templates. - $variables += array('content' => array()); - foreach (Element::children($variables['elements']) as $key) { - $variables['content'][$key] = $variables['elements'][$key]; - } - // Add article ARIA role. $variables['attributes']['role'] = 'article'; } diff --git a/core/modules/node/templates/node.html.twig b/core/modules/node/templates/node.html.twig index 66cdc0f..8bef128 100644 --- a/core/modules/node/templates/node.html.twig +++ b/core/modules/node/templates/node.html.twig @@ -19,10 +19,10 @@ * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. * If display_submitted is set, additional variables are prepared: - * - author_picture: The node author user entity, rendered using the "compact" - * view mode. - * - date: Themed creation date field. - * - author_name: Themed author name field. + * - author_picture: The node author user entity, rendered using the + * "compact" view mode. + * - date: Themed creation date field. + * - author_name: Themed author name field. * - author_attributes: Same as attributes, except applied to the author of * the node that appears in the template. * - attributes: HTML attributes for the containing element. @@ -53,7 +53,6 @@ * - page: Flag for the full page state. Will be true if view_mode is 'full'. * - readmore: Flag for more state. Will be true if the teaser content of the * node cannot hold the main body content. - * - is_front: Flag for front. Will be true when presented on the front page. * - logged_in: Flag for authenticated user status. Will be true when the * current user is a logged-in member. * - is_admin: Flag for admin user status. Will be true when the current user diff --git a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php index 30120ea..56c7a64 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php @@ -59,6 +59,7 @@ function testPageCacheTags() { 0 => array('value' => 'Body 2', 'format' => 'full_html'), ), 'promote' => NODE_PROMOTED, + 'display_submitted' => TRUE, )); // Place a block, but only make it visible on full node page 2. @@ -98,6 +99,7 @@ function testPageCacheTags() { 'config:block.block.bartik_messages', 'node_view', 'node:' . $node_1->id(), + 'user:' . $author_1->id(), 'config:filter.format.basic_html', 'config:system.menu.account', 'config:system.menu.tools', diff --git a/core/themes/bartik/templates/node.html.twig b/core/themes/bartik/templates/node.html.twig index ebd06d5..03b6621 100644 --- a/core/themes/bartik/templates/node.html.twig +++ b/core/themes/bartik/templates/node.html.twig @@ -1,7 +1,7 @@ {# /** * @file - * Default theme implementation to display a node. + * Bartik's theme implementation to display a node. * * Available variables: * - node: Full node entity. @@ -19,10 +19,10 @@ * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. * If display_submitted is set, additional variables are prepared: - * - author_picture: The node author user entity, rendered using the "compact" - * view mode. - * - date: Themed creation date field. - * - author_name: Themed author name field. + * - author_picture: The node author user entity, rendered using the + * "compact" view mode. + * - date: Themed creation date field. + * - author_name: Themed author name field. * - author_attributes: Same as attributes, except applied to the author of * the node that appears in the template. * - attributes: HTML attributes for the containing element. @@ -53,7 +53,6 @@ * - page: Flag for the full page state. Will be true if view_mode is 'full'. * - readmore: Flag for more state. Will be true if the teaser content of the * node cannot hold the main body content. - * - is_front: Flag for front. Will be true when presented on the front page. * - logged_in: Flag for authenticated user status. Will be true when the * current user is a logged-in member. * - is_admin: Flag for admin user status. Will be true when the current user diff --git a/core/themes/classy/templates/content/node.html.twig b/core/themes/classy/templates/content/node.html.twig index 5d746a6..56fe671 100644 --- a/core/themes/classy/templates/content/node.html.twig +++ b/core/themes/classy/templates/content/node.html.twig @@ -15,13 +15,16 @@ * or print a subset such as {{ content.field_example }}. Use * {{ content|without('field_example') }} to temporarily suppress the printing * of a given child element. - * - author_picture: The node author user entity, rendered using the "compact" - * view mode. * - metadata: Metadata for this node. - * - date: Themed creation date field. - * - author_name: Themed author name field. * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. + * If display_submitted is set, additional variables are prepared: + * - author_picture: The node author user entity, rendered using the + * "compact" view mode. + * - date: Themed creation date field. + * - author_name: Themed author name field. + * - author_attributes: Same as attributes, except applied to the author of + * the node that appears in the template. * - attributes: HTML attributes for the containing element. * The attributes.class element may contain one or more of the following * classes: @@ -42,14 +45,11 @@ * tag that appears in the template. * - content_attributes: Same as attributes, except applied to the main * content tag that appears in the template. - * - author_attributes: Same as attributes, except applied to the author of - * the node tag that appears in the template. * - title_prefix: Additional output populated by modules, intended to be * displayed in front of the main title tag that appears in the template. * - title_suffix: Additional output populated by modules, intended to be * displayed after the main title tag that appears in the template. * - view_mode: View mode; for example, "teaser" or "full". - * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. * - page: Flag for the full page state. Will be true if view_mode is 'full'. * - readmore: Flag for more state. Will be true if the teaser content of the * node cannot hold the main body content.