diff --git a/core/modules/locale/src/Tests/LocaleContentTest.php b/core/modules/locale/src/Tests/LocaleContentTest.php index 5229eb7..4c628fa 100644 --- a/core/modules/locale/src/Tests/LocaleContentTest.php +++ b/core/modules/locale/src/Tests/LocaleContentTest.php @@ -177,25 +177,25 @@ public function testContentTypeDirLang() { // Check if English node does not have lang tag. $this->drupalGet('node/' . $nodes['en']->id()); - $element = $this->xpath('//article[@class and contains(concat(" ", normalize-space(@class), " "), " node ") and @lang="en"]'); + $element = $this->cssSelect('article.node[lang="en"]'); $this->assertTrue(empty($element), 'The lang tag has not been assigned to the English node.'); // Check if English node does not have dir tag. - $element = $this->xpath('//article[@class and contains(concat(" ", normalize-space(@class), " "), " node ") and @dir="ltr"]'); + $element = $this->cssSelect('article.node[dir="ltr"]'); $this->assertTrue(empty($element), 'The dir tag has not been assigned to the English node.'); // Check if Arabic node has lang="ar" & dir="rtl" tags. $this->drupalGet('node/' . $nodes['ar']->id()); - $element = $this->xpath('//article[@class and contains(concat(" ", normalize-space(@class), " "), " node ") and @lang="ar" and @dir="rtl"]'); + $element = $this->cssSelect('article.node[lang="ar"][dir="rtl"]'); $this->assertTrue(!empty($element), 'The lang and dir tags have been assigned correctly to the Arabic node.'); // Check if Spanish node has lang="es" tag. $this->drupalGet('node/' . $nodes['es']->id()); - $element = $this->xpath('//article[@class and contains(concat(" ", normalize-space(@class), " "), " node ") and @lang="es"]'); + $element = $this->cssSelect('article.node[lang="es"]'); $this->assertTrue(!empty($element), 'The lang tag has been assigned correctly to the Spanish node.'); // Check if Spanish node does not have dir="ltr" tag. - $element = $this->xpath('//article[@class and contains(concat(" ", normalize-space(@class), " "), " node ") and @lang="es" and @dir="ltr"]'); + $element = $this->cssSelect('article.node[lang="es"][dir="ltr"]'); $this->assertTrue(empty($element), 'The dir tag has not been assigned to the Spanish node.'); } diff --git a/core/modules/node/templates/node.html.twig b/core/modules/node/templates/node.html.twig index 56b1c48..23d54a2 100644 --- a/core/modules/node/templates/node.html.twig +++ b/core/modules/node/templates/node.html.twig @@ -11,10 +11,10 @@ * - createdtime: Formatted creation date. Preprocess functions can * reformat it by calling format_date() with the desired parameters on * $variables['node']->getCreatedTime(). - * - isPromoted: Whether the node is promoted to the front page. - * - isSticky: Whether the node is 'sticky'. Sticky nodes are ordered above + * - isPromoted(): Whether the node is promoted to the front page. + * - isSticky(): Whether the node is 'sticky'. Sticky nodes are ordered above * other non-sticky nodes in teaser listings - * - isPublished: Whether the node is published. + * - isPublished(): Whether the node is published. * - label: The title of the node. * - content: All node items. Use {{ content }} to print them all, * or print a subset such as {{ content.field_example }}. Use @@ -80,9 +80,9 @@ set classes = [ 'node', 'node--type-' ~ node.bundle|clean_class, - node.isPromoted ? 'node--promoted', - node.isSticky ? 'node--sticky', - not node.isPublished ? 'node--unpublished', + node.isPromoted() ? 'node--promoted', + node.isSticky() ? 'node--sticky', + not node.isPublished() ? 'node--unpublished', 'node--view-mode-' ~ view_mode|clean_class, preview ? 'node--preview', ] diff --git a/core/themes/bartik/templates/node.html.twig b/core/themes/bartik/templates/node.html.twig index 9e95734..1b2d1b8 100644 --- a/core/themes/bartik/templates/node.html.twig +++ b/core/themes/bartik/templates/node.html.twig @@ -11,10 +11,10 @@ * - createdtime: Formatted creation date. Preprocess functions can * reformat it by calling format_date() with the desired parameters on * $variables['node']->getCreatedTime(). - * - isPromoted: Whether the node is promoted to the front page. - * - isSticky: Whether the node is 'sticky'. Sticky nodes are ordered above + * - isPromoted(): Whether the node is promoted to the front page. + * - isSticky(): Whether the node is 'sticky'. Sticky nodes are ordered above * other non-sticky nodes in teaser listings - * - isPublished: Whether the node is published. + * - isPublished(): Whether the node is published. * - label: The title of the node. * - content: All node items. Use {{ content }} to print them all, * or print a subset such as {{ content.field_example }}. Use @@ -75,9 +75,9 @@ set classes = [ 'node', 'node--type-' ~ node.bundle|clean_class, - node.isPromoted ? 'node--promoted', - node.isSticky ? 'node--sticky', - not node.isPublished ? 'node--unpublished', + node.isPromoted() ? 'node--promoted', + node.isSticky() ? 'node--sticky', + not node.isPublished() ? 'node--unpublished', 'node--view-mode-' ~ view_mode|clean_class, preview ? 'node--preview', 'clearfix', @@ -105,7 +105,7 @@ {% endif %} - + {{ content|without('comment', 'links') }}