diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php index 1a2df9f50d7491c19f78e83dbaea5316e87bf161..c5ee7caf98d3b01b4e3cdab8c2b82f8a5de6f973 100644 --- a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php +++ b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php @@ -67,10 +67,14 @@ public function buildTitle(array $page) { // If the entity's label is rendered using a field formatter, set the // rendered title field formatter as the page title instead of the default // plain text title. This allows attributes set on the field to propagate - // correctly (e.g. RDFa, in-place editing). + // correctly (e.g. in-place editing). if ($entity instanceof FieldableEntityInterface) { $label_field = $entity->getEntityType()->getKey('label'); if (isset($page[$label_field])) { + // Allow templates and theme functions to generate different markup + // for the page title, which must be inline markup as it will be placed + // inside <h1>. See field--node--title.html.twig. + $page[$label_field]['#is_page_title'] = TRUE; $page['#title'] = $this->renderer->render($page[$label_field]); } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 35176e5973a314e2cd8aa0a36779c582398345f7..a09512492dc35d1cd42ed9c8e3952c89a6e394bb 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -115,6 +115,8 @@ function node_theme() { 'node_edit_form' => [ 'render element' => 'form', ], + // @todo Delete the next three entries as part of + // https://www.drupal.org/node/3015623 'field__node__title' => [ 'base hook' => 'field', ], @@ -427,6 +429,30 @@ function node_preprocess_block(&$variables) { } } +/** + * Implements hook_preprocess_HOOK() for node field templates. + */ +function node_preprocess_field__node(&$variables) { + // Set a variable 'is_inline' in cases where inline markup is required, + // without any block elements such as <div>. + + if ($variables['element']['#is_page_title'] ?? FALSE) { + // Page title is always inline because it will be displayed inside <h1>. + $variables['is_inline'] = TRUE; + } + elseif (in_array($variables['field_name'], ['created', 'uid', 'title'], TRUE)) { + // Display created, uid and title fields inline because they will be + // displayed inline by node.html.twig. Skip this if the field + // display is configurable and skipping has been enabled. + // @todo Delete as part of https://www.drupal.org/node/3015623 + + /** @var \Drupal\node\NodeInterface $node */ + $node = $variables['element']['#object']; + $skip_custom_preprocessing = $node->getEntityType()->get('enable_base_field_custom_preprocess_skipping'); + $variables['is_inline'] = !$skip_custom_preprocessing || !$node->getFieldDefinition($variables['field_name'])->isDisplayConfigurable('view'); + } +} + /** * Implements hook_theme_suggestions_HOOK(). */ diff --git a/core/modules/node/templates/field--node--created.html.twig b/core/modules/node/templates/field--node--created.html.twig index 049144f50d95f3d907fa2f88cbbe1bd5922c033c..e28ca36d59b1fa81dbdae09ee46ab9303b2801e3 100644 --- a/core/modules/node/templates/field--node--created.html.twig +++ b/core/modules/node/templates/field--node--created.html.twig @@ -15,14 +15,25 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() * * @ingroup themeable + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} + +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/modules/node/templates/field--node--title.html.twig b/core/modules/node/templates/field--node--title.html.twig index 68142ca5d1b0d755b91f1053c0d84ca81199d11a..e6d0faaa9b9c10594d250b4462a1b494a51db0ff 100644 --- a/core/modules/node/templates/field--node--title.html.twig +++ b/core/modules/node/templates/field--node--title.html.twig @@ -15,14 +15,25 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() * * @ingroup themeable + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} + +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/modules/node/templates/field--node--uid.html.twig b/core/modules/node/templates/field--node--uid.html.twig index 91a97b3a9bf83d6dc6976d872ca2ce1f6a808ef3..8f66a5bf777cddadb3105f79720641c465ddb759 100644 --- a/core/modules/node/templates/field--node--uid.html.twig +++ b/core/modules/node/templates/field--node--uid.html.twig @@ -15,14 +15,25 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() * * @ingroup themeable + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} + +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php b/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php index 09876517b8bb9010d73e8db95f74fd80d458d08d..46cf6da90bca44a96c0fb4654228bddde00450ae 100644 --- a/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php +++ b/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php @@ -3,6 +3,8 @@ namespace Drupal\Tests\node\Functional; use Drupal\Core\Entity\Entity\EntityViewDisplay; +use Drupal\node\NodeInterface; +use Drupal\user\UserInterface; /** * Tests making node base fields' displays configurable. @@ -16,17 +18,43 @@ class NodeDisplayConfigurableTest extends NodeTestBase { * * @var array */ - protected static $modules = ['quickedit', 'rdf']; + protected static $modules = ['quickedit', 'rdf', 'block']; /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; + /** + * {@inheritdoc} + */ + protected function setUp(): void { + parent::setUp(); + $data = $this->getProvidedData(); + $theme = reset($data); + \Drupal::service('theme_installer')->install([$theme]); + $this->config('system.theme')->set('default', $theme)->save(); + $settings = [ + 'theme' => $theme, + 'region' => 'content', + 'weight' => -100, + ]; + $this->drupalPlaceBlock('page_title_block', $settings); + } + /** * Sets base fields to configurable display and check settings are respected. + * + * @param string $theme + * The name of the theme being tested. + * @param string $metadata_region + * The region of the node html content where meta data is expected. + * @param bool $field_classes + * If TRUE, check for field--name-XXX classes. + * + * @dataProvider provideThemes */ - public function testDisplayConfigurable() { + public function testDisplayConfigurable(string $theme, string $metadata_region, bool $field_classes) { // Change the node type setting to show submitted by information. $node_type = \Drupal::entityTypeManager()->getStorage('node_type')->load('page'); $node_type->setDisplaySubmitted(TRUE); @@ -35,17 +63,14 @@ public function testDisplayConfigurable() { $user = $this->drupalCreateUser([ 'access in-place editing', 'administer nodes', - ]); + ], $this->randomMachineName(14)); $this->drupalLogin($user); $node = $this->drupalCreateNode(['uid' => $user->id()]); $assert = $this->assertSession(); // Check the node with Drupal default non-configurable display. $this->drupalGet($node->toUrl()); - $assert->elementTextContains('css', 'span.field--name-created', \Drupal::service('date.formatter')->format($node->getCreatedTime())); - $assert->elementTextContains('css', 'span.field--name-uid[data-quickedit-field-id="node/1/uid/en/full"]', $user->getAccountName()); - $assert->elementTextContains('css', 'div.node__submitted', 'Submitted by'); - $assert->elementTextContains('css', 'span.field--name-title', $node->getTitle()); + $this->assertNodeHtml($node, $user, 'span', $metadata_region, $field_classes); // Enable module to make base fields' displays configurable. \Drupal::service('module_installer')->install(['node_display_configurable_test']); @@ -62,11 +87,8 @@ public function testDisplayConfigurable() { // Recheck the node with configurable display. $this->drupalGet($node->toUrl()); - $assert->elementTextContains('css', 'span.field--name-created', \Drupal::service('date.formatter')->format($node->getCreatedTime())); - $assert->elementTextContains('css', 'span.field--name-uid[data-quickedit-field-id="node/1/uid/en/full"]', $user->getAccountName()); - $assert->elementNotExists('css', 'span.field--name-uid a'); - $assert->elementTextContains('css', 'span.field--name-title', $node->getTitle()); - $assert->elementExists('css', 'span[property="schema:dateCreated"]'); + + $this->assertNodeHtml($node, $user, 'div', $metadata_region, $field_classes); // Remove from display. $display->removeComponent('uid') @@ -74,8 +96,62 @@ public function testDisplayConfigurable() { ->save(); $this->drupalGet($node->toUrl()); - $assert->elementNotExists('css', '.field--name-created'); - $assert->elementNotExists('css', '.field--name-uid'); + $assert->elementNotExists('css', 'div[data-quickedit-field-id="node/1/uid/en/full"]'); + $assert->elementTextNotContains('css', 'article[data-quickedit-entity-id="node/1"]', $user->getAccountName()); + } + + /** + * Asserts that the node HTML is as expected. + * + * @param \Drupal\node\NodeInterface $node + * The node being tested. + * @param \Drupal\user\UserInterface $user + * The logged in user. + * @param string $html_element + * Either 'div' or 'span' + * @param string $metadata_region + * The region of the node html content where meta data is expected. + * @param bool $field_classes + * If TRUE, check for field--name-XXX classes. + */ + protected function assertNodeHtml(NodeInterface $node, UserInterface $user, string $html_element, string $metadata_region, bool $field_classes) { + $assert = $this->assertSession(); + + $title_selector = 'h1 span' . ($field_classes ? '.field--name-title' : '') . '[data-quickedit-field-id="node/1/title/en/full"]'; + $created_selector = 'article[data-quickedit-entity-id="node/1"] ' . $html_element . ($field_classes ? '.field--name-created' : '') . '[data-quickedit-field-id="node/1/created/en/full"]'; + $uid_selector = 'article[data-quickedit-entity-id="node/1"] ' . $html_element . ($field_classes ? '.field--name-uid' : '') . '[data-quickedit-field-id="node/1/uid/en/full"]'; + + $assert->elementTextContains('css', $title_selector, $node->getTitle()); + $assert->elementTextContains('css', $created_selector, \Drupal::service('date.formatter')->format($node->getCreatedTime())); + if ($html_element === 'div') { + $assert->elementTextContains('css', "$uid_selector $html_element" . '[rel="schema:author"]', $user->getAccountName()); + $assert->elementNotExists('css', "$uid_selector a"); + $assert->elementTextContains('css', "$uid_selector $html_element", 'Authored by'); + $assert->elementExists('css', 'span[property="schema:dateCreated"]'); + } + else { + $assert->elementTextContains('css', $uid_selector . ' a[property="schema:name"]', $user->getAccountName()); + $assert->elementTextContains('css', 'article[data-quickedit-entity-id="node/1"] ' . $metadata_region, 'Submitted by'); + } + } + + /** + * Data provider for ::testDisplayConfigurable(). + * + * @return array + */ + public function provideThemes() { + return [ + ['bartik', 'header', TRUE], + ['claro', 'footer', TRUE], + ['classy', 'footer', TRUE], + // @todo Add coverage for olivero after fixing + // https://www.drupal.org/project/drupal/issues/3215220. + // ['olivero', 'footer', TRUE], + ['seven', 'footer', TRUE], + ['stable', 'footer', FALSE], + ['stable9', 'footer', FALSE], + ]; } } diff --git a/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--created.html.twig b/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--created.html.twig index 72d5d6737d26898d95e1fd4a76875d107bee9e5d..f4d1acd439b412ede7b49fb0ff16e069962a6dd8 100644 --- a/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--created.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--created.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--title.html.twig b/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--title.html.twig index 33b105f50b3eb1f767414d69cb22a4ec33418f93..e79c39eb52cc9ad55449993e583026731d4806c5 100644 --- a/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--title.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--title.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--uid.html.twig b/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--uid.html.twig index 9afc591b7194a73395075161ee016839d8b516f9..0a381083246a5fd8a4ad4f9738f088fc31760bc5 100644 --- a/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--uid.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/classy/field/field--node--uid.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ConfirmClassyCopiesTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ConfirmClassyCopiesTest.php index babc8efc145e022475d2a17054537e2ef52d3445..158071d6c55660a0743e3a959dda5e7a0c4e620a 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/ConfirmClassyCopiesTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/ConfirmClassyCopiesTest.php @@ -812,10 +812,10 @@ protected function getClassyHash($type, $file) { 'field.html.twig' => '4da82841bf83d728ed2f3757de7402fb', 'file-link.html.twig' => '0f10f3e79ecb9b6e82ef30c66e4ebcc6', 'field--text-with-summary.html.twig' => '898425e3da212ed81ff01c7b624033fd', - 'field--node--uid.html.twig' => 'eec25d4a07d3447ba012a1f6bf8c2cea', - 'field--node--title.html.twig' => 'bd618d16c576614d2f2c6d3e60315559', + 'field--node--uid.html.twig' => 'd8b6b27f106d1494dca27efe7bf76c59', + 'field--node--title.html.twig' => '8b1830816fb75a0025965b5eb09c24c6', 'image-style.html.twig' => '6d2588a4453ed014601f66cd45baf00f', - 'field--node--created.html.twig' => '7a33b0533f7bd12cc81af52f4151cb7c', + 'field--node--created.html.twig' => 'e597e1c783d32862b85720ab08049339', 'image-formatter.html.twig' => '9bc966dd2fe1a913cd7a89fbd243d947', 'file-video.html.twig' => '9f58b817bf059a86300d2757c76f0d97', 'links--media-library-menu.html.twig' => '31f4f0f507af5dde490e9a992fa89db6', diff --git a/core/themes/bartik/templates/classy/field/field--node--created.html.twig b/core/themes/bartik/templates/classy/field/field--node--created.html.twig index 72d5d6737d26898d95e1fd4a76875d107bee9e5d..f4d1acd439b412ede7b49fb0ff16e069962a6dd8 100644 --- a/core/themes/bartik/templates/classy/field/field--node--created.html.twig +++ b/core/themes/bartik/templates/classy/field/field--node--created.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/bartik/templates/classy/field/field--node--title.html.twig b/core/themes/bartik/templates/classy/field/field--node--title.html.twig index 33b105f50b3eb1f767414d69cb22a4ec33418f93..e79c39eb52cc9ad55449993e583026731d4806c5 100644 --- a/core/themes/bartik/templates/classy/field/field--node--title.html.twig +++ b/core/themes/bartik/templates/classy/field/field--node--title.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/bartik/templates/classy/field/field--node--uid.html.twig b/core/themes/bartik/templates/classy/field/field--node--uid.html.twig index 9afc591b7194a73395075161ee016839d8b516f9..0a381083246a5fd8a4ad4f9738f088fc31760bc5 100644 --- a/core/themes/bartik/templates/classy/field/field--node--uid.html.twig +++ b/core/themes/bartik/templates/classy/field/field--node--uid.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/claro/templates/classy/field/field--node--created.html.twig b/core/themes/claro/templates/classy/field/field--node--created.html.twig index 72d5d6737d26898d95e1fd4a76875d107bee9e5d..f4d1acd439b412ede7b49fb0ff16e069962a6dd8 100644 --- a/core/themes/claro/templates/classy/field/field--node--created.html.twig +++ b/core/themes/claro/templates/classy/field/field--node--created.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/claro/templates/classy/field/field--node--title.html.twig b/core/themes/claro/templates/classy/field/field--node--title.html.twig index 33b105f50b3eb1f767414d69cb22a4ec33418f93..e79c39eb52cc9ad55449993e583026731d4806c5 100644 --- a/core/themes/claro/templates/classy/field/field--node--title.html.twig +++ b/core/themes/claro/templates/classy/field/field--node--title.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/claro/templates/classy/field/field--node--uid.html.twig b/core/themes/claro/templates/classy/field/field--node--uid.html.twig index 9afc591b7194a73395075161ee016839d8b516f9..0a381083246a5fd8a4ad4f9738f088fc31760bc5 100644 --- a/core/themes/claro/templates/classy/field/field--node--uid.html.twig +++ b/core/themes/claro/templates/classy/field/field--node--uid.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/classy/templates/field/field--node--created.html.twig b/core/themes/classy/templates/field/field--node--created.html.twig index 72d5d6737d26898d95e1fd4a76875d107bee9e5d..f4d1acd439b412ede7b49fb0ff16e069962a6dd8 100644 --- a/core/themes/classy/templates/field/field--node--created.html.twig +++ b/core/themes/classy/templates/field/field--node--created.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/classy/templates/field/field--node--title.html.twig b/core/themes/classy/templates/field/field--node--title.html.twig index 33b105f50b3eb1f767414d69cb22a4ec33418f93..e79c39eb52cc9ad55449993e583026731d4806c5 100644 --- a/core/themes/classy/templates/field/field--node--title.html.twig +++ b/core/themes/classy/templates/field/field--node--title.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/classy/templates/field/field--node--uid.html.twig b/core/themes/classy/templates/field/field--node--uid.html.twig index 9afc591b7194a73395075161ee016839d8b516f9..0a381083246a5fd8a4ad4f9738f088fc31760bc5 100644 --- a/core/themes/classy/templates/field/field--node--uid.html.twig +++ b/core/themes/classy/templates/field/field--node--uid.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/seven/templates/classy/field/field--node--created.html.twig b/core/themes/seven/templates/classy/field/field--node--created.html.twig index 72d5d6737d26898d95e1fd4a76875d107bee9e5d..f4d1acd439b412ede7b49fb0ff16e069962a6dd8 100644 --- a/core/themes/seven/templates/classy/field/field--node--created.html.twig +++ b/core/themes/seven/templates/classy/field/field--node--created.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/seven/templates/classy/field/field--node--title.html.twig b/core/themes/seven/templates/classy/field/field--node--title.html.twig index 33b105f50b3eb1f767414d69cb22a4ec33418f93..e79c39eb52cc9ad55449993e583026731d4806c5 100644 --- a/core/themes/seven/templates/classy/field/field--node--title.html.twig +++ b/core/themes/seven/templates/classy/field/field--node--title.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/seven/templates/classy/field/field--node--uid.html.twig b/core/themes/seven/templates/classy/field/field--node--uid.html.twig index 9afc591b7194a73395075161ee016839d8b516f9..0a381083246a5fd8a4ad4f9738f088fc31760bc5 100644 --- a/core/themes/seven/templates/classy/field/field--node--uid.html.twig +++ b/core/themes/seven/templates/classy/field/field--node--uid.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/stable/templates/field/field--node--created.html.twig b/core/themes/stable/templates/field/field--node--created.html.twig index e00837d3e08b5f8e3e66a9ccaaeaefc1b69a2145..a9d394993e883c17709975adae0b7c339eb42755 100644 --- a/core/themes/stable/templates/field/field--node--created.html.twig +++ b/core/themes/stable/templates/field/field--node--created.html.twig @@ -15,12 +15,22 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/stable/templates/field/field--node--title.html.twig b/core/themes/stable/templates/field/field--node--title.html.twig index 5ab974f2ddb1a1114908def085233577ca2bd3c1..effe5c5daaad3b563a25ca7bd9c0364ee5e2ddd6 100644 --- a/core/themes/stable/templates/field/field--node--title.html.twig +++ b/core/themes/stable/templates/field/field--node--title.html.twig @@ -15,12 +15,22 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/stable/templates/field/field--node--uid.html.twig b/core/themes/stable/templates/field/field--node--uid.html.twig index af730dc02b5deefc9e21efd13bf4e5904ed91da6..ee49c9ae207dc6df289f48ea29dd6d9265a322d5 100644 --- a/core/themes/stable/templates/field/field--node--uid.html.twig +++ b/core/themes/stable/templates/field/field--node--uid.html.twig @@ -15,12 +15,22 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/stable9/templates/field/field--node--created.html.twig b/core/themes/stable9/templates/field/field--node--created.html.twig index e00837d3e08b5f8e3e66a9ccaaeaefc1b69a2145..a9d394993e883c17709975adae0b7c339eb42755 100644 --- a/core/themes/stable9/templates/field/field--node--created.html.twig +++ b/core/themes/stable9/templates/field/field--node--created.html.twig @@ -15,12 +15,22 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/stable9/templates/field/field--node--title.html.twig b/core/themes/stable9/templates/field/field--node--title.html.twig index 5ab974f2ddb1a1114908def085233577ca2bd3c1..effe5c5daaad3b563a25ca7bd9c0364ee5e2ddd6 100644 --- a/core/themes/stable9/templates/field/field--node--title.html.twig +++ b/core/themes/stable9/templates/field/field--node--title.html.twig @@ -15,12 +15,22 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/stable9/templates/field/field--node--uid.html.twig b/core/themes/stable9/templates/field/field--node--uid.html.twig index af730dc02b5deefc9e21efd13bf4e5904ed91da6..ee49c9ae207dc6df289f48ea29dd6d9265a322d5 100644 --- a/core/themes/stable9/templates/field/field--node--uid.html.twig +++ b/core/themes/stable9/templates/field/field--node--uid.html.twig @@ -15,12 +15,22 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} <span{{ attributes }}> {%- for item in items -%} {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/starterkit_theme/templates/field/field--node--created.html.twig b/core/themes/starterkit_theme/templates/field/field--node--created.html.twig index 72d5d6737d26898d95e1fd4a76875d107bee9e5d..f4d1acd439b412ede7b49fb0ff16e069962a6dd8 100644 --- a/core/themes/starterkit_theme/templates/field/field--node--created.html.twig +++ b/core/themes/starterkit_theme/templates/field/field--node--created.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/starterkit_theme/templates/field/field--node--title.html.twig b/core/themes/starterkit_theme/templates/field/field--node--title.html.twig index 33b105f50b3eb1f767414d69cb22a4ec33418f93..e79c39eb52cc9ad55449993e583026731d4806c5 100644 --- a/core/themes/starterkit_theme/templates/field/field--node--title.html.twig +++ b/core/themes/starterkit_theme/templates/field/field--node--title.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %} diff --git a/core/themes/starterkit_theme/templates/field/field--node--uid.html.twig b/core/themes/starterkit_theme/templates/field/field--node--uid.html.twig index 9afc591b7194a73395075161ee016839d8b516f9..0a381083246a5fd8a4ad4f9738f088fc31760bc5 100644 --- a/core/themes/starterkit_theme/templates/field/field--node--uid.html.twig +++ b/core/themes/starterkit_theme/templates/field/field--node--uid.html.twig @@ -15,10 +15,19 @@ * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. + * - is_inline: If false, display an ordinary field. + * If true, display an inline format, suitable for inside elements such as + * <span>, <h2> and so on. * * @see field.html.twig + * @see node_preprocess_field__node() + * + * @todo Delete as part of https://www.drupal.org/node/3015623 */ #} +{% if not is_inline %} + {% include "field.html.twig" %} +{% else %} {% set classes = [ 'field', @@ -32,3 +41,4 @@ {{ item.content }} {%- endfor -%} </span> +{% endif %}