', 'No image displayed when no image is attached and no default image specified.');
+ $this->assertNoPattern('
', 'No image displayed when no image is attached and no default image specified.');
$cache_tags_header = $this->drupalGetHeader('X-Drupal-Cache-Tags');
$this->assertTrue(!preg_match('/ image_style\:/', $cache_tags_header), 'No image style cache tag found.');
diff --git a/core/modules/node/node.js b/core/modules/node/node.js
index af2ed46..ebb22ff 100644
--- a/core/modules/node/node.js
+++ b/core/modules/node/node.js
@@ -31,8 +31,8 @@
$context.find('.node-form-author').drupalSetSummary(function (context) {
var $authorContext = $(context);
- var name = $authorContext.find('.field-name-uid input').val();
- var date = $authorContext.find('.field-name-created input').val();
+ var name = $authorContext.find('.field--name-uid input').val();
+ var date = $authorContext.find('.field--name-created input').val();
return date ?
Drupal.t('By @name on @date', {'@name': name, '@date': date}) :
Drupal.t('By @name', {'@name': name});
diff --git a/core/modules/node/src/Tests/NodeViewTest.php b/core/modules/node/src/Tests/NodeViewTest.php
index c60d44a..ed400ea 100644
--- a/core/modules/node/src/Tests/NodeViewTest.php
+++ b/core/modules/node/src/Tests/NodeViewTest.php
@@ -41,7 +41,7 @@ public function testMultiByteUtf8() {
$this->assertTrue(mb_strlen($title, 'utf-8') < strlen($title), 'Title has multi-byte characters.');
$node = $this->drupalCreateNode(array('title' => $title));
$this->drupalGet($node->urlInfo());
- $result = $this->xpath('//span[contains(@class, "field-name-title")]');
+ $result = $this->xpath('//span[contains(@class, "field--name-title")]');
$this->assertEqual((string) $result[0], $title, 'The passed title was returned.');
}
diff --git a/core/modules/quickedit/js/editors/plainTextEditor.js b/core/modules/quickedit/js/editors/plainTextEditor.js
index 4e43d61..8a51fc6 100644
--- a/core/modules/quickedit/js/editors/plainTextEditor.js
+++ b/core/modules/quickedit/js/editors/plainTextEditor.js
@@ -30,7 +30,7 @@
// Store the original value of this field. Necessary for reverting
// changes.
var $textElement;
- var $fieldItems = this.$el.find('.field-item');
+ var $fieldItems = this.$el.find('.field__item');
if ($fieldItems.length) {
$textElement = this.$textElement = $fieldItems.eq(0);
}
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 1beb1a1..fa53333 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -268,6 +268,18 @@ function rdf_preprocess_html(&$variables) {
}
/**
+ * Implements hook_preprocess_HOOK() for field templates.
+ */
+function rdf_preprocess_field(&$variables) {
+ // Swap the regular field property attribute and use rel instead so that it
+ // plays well with the RDFa markup generated for the username.
+ if (!empty($variables['attributes']['property']) && $variables['field_type'] == 'entity_reference' && $variables['field_name'] == 'uid') {
+ $variables['attributes']['rel'] = $variables['attributes']['property'];
+ unset($variables['attributes']['property']);
+ }
+}
+
+/**
* Implements hook_preprocess_HOOK() for node templates.
*/
function rdf_preprocess_node(&$variables) {
@@ -294,12 +306,6 @@ function rdf_preprocess_node(&$variables) {
);
}
- // Adds RDFa markup for the relation between the node and its author.
- $author_mapping = $mapping->getPreparedFieldMapping('uid');
- if (!empty($author_mapping['properties']) && $variables['display_submitted']) {
- $variables['author_attributes']['rel'] = $author_mapping['properties'];
- }
-
// Adds RDFa markup for the date.
$created_mapping = $mapping->getPreparedFieldMapping('created');
if (!empty($created_mapping) && $variables['display_submitted']) {
diff --git a/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php b/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php
index f5974bb..120d6f0 100644
--- a/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php
+++ b/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php
@@ -24,7 +24,7 @@ public function testIntegerFormatter() {
$this->assertFormatterRdfa(array('type' => 'number_integer'), 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
@@ -32,6 +32,8 @@ public function testIntegerFormatter() {
* Tests the integer formatter with settings.
*/
public function testIntegerFormatterWithSettings() {
+ \Drupal::service('theme_handler')->install(['classy']);
+ $this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'integer';
$formatter = array(
'type' => 'number_integer',
@@ -50,7 +52,7 @@ public function testIntegerFormatterWithSettings() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
@@ -65,7 +67,7 @@ public function testFloatFormatter() {
$this->assertFormatterRdfa(array('type' => 'number_unformatted'), 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
@@ -73,6 +75,8 @@ public function testFloatFormatter() {
* Tests the float formatter with settings.
*/
public function testFloatFormatterWithSettings() {
+ \Drupal::service('theme_handler')->install(['classy']);
+ $this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'float';
$formatter = array(
'type' => 'number_decimal',
@@ -92,7 +96,7 @@ public function testFloatFormatterWithSettings() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
@@ -113,7 +117,7 @@ public function testFloatFormatterWithScale() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
@@ -121,6 +125,8 @@ public function testFloatFormatterWithScale() {
* Tests the float formatter with a scale. Scale is exercised.
*/
public function testFloatFormatterWithScaleExercised() {
+ \Drupal::service('theme_handler')->install(['classy']);
+ $this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'float';
$formatter = array(
'type' => 'number_decimal',
@@ -134,7 +140,7 @@ public function testFloatFormatterWithScaleExercised() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
@@ -149,7 +155,7 @@ public function testDecimalFormatter() {
$this->assertFormatterRdfa(array('type' => 'number_decimal'), 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
@@ -157,6 +163,8 @@ public function testDecimalFormatter() {
* Tests the decimal formatter with settings.
*/
public function testDecimalFormatterWithSettings() {
+ \Drupal::service('theme_handler')->install(['classy']);
+ $this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'decimal';
$formatter = array(
'type' => 'number_decimal',
@@ -176,7 +184,7 @@ public function testDecimalFormatterWithSettings() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
- $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
+ $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
diff --git a/core/modules/rdf/src/Tests/StandardProfileTest.php b/core/modules/rdf/src/Tests/StandardProfileTest.php
index 784bd80..d94f40b 100644
--- a/core/modules/rdf/src/Tests/StandardProfileTest.php
+++ b/core/modules/rdf/src/Tests/StandardProfileTest.php
@@ -107,6 +107,10 @@ class StandardProfileTest extends WebTestBase {
protected function setUp() {
parent::setUp();
+ // Use Classy theme for testing markup output.
+ \Drupal::service('theme_handler')->install(['classy']);
+ $this->config('system.theme')->set('default', 'classy')->save();
+
$this->baseUri = \Drupal::url('
', [], ['absolute' => TRUE]);
// Create two test users.
diff --git a/core/modules/search/src/Tests/SearchExcerptTest.php b/core/modules/search/src/Tests/SearchExcerptTest.php
index 9ed4403..01dd620 100644
--- a/core/modules/search/src/Tests/SearchExcerptTest.php
+++ b/core/modules/search/src/Tests/SearchExcerptTest.php
@@ -69,7 +69,7 @@ function testSearchExcerpt() {
// The node body that will produce this rendered $text is:
// 123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
- $text = "123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
\n
";
+ $text = "123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
\n
";
$result = search_excerpt('HTMLTest', $text);
$this->assertFalse(empty($result), 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts');
}
diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css
index 3a8bddb..8c3be2a 100644
--- a/core/modules/system/css/system.theme.css
+++ b/core/modules/system/css/system.theme.css
@@ -576,22 +576,20 @@ ul.tabs {
}
/* Field display */
-.field .field-label {
+.field__label {
font-weight: bold;
+ vertical-align: top;
}
-.field-label-inline .field-label,
-.field-label-inline .field-items {
- float:left; /*LTR*/
- margin-right: 0.5em; /*LTR*/
-}
-[dir="rtl"] .field-label-inline .field-label,
-[dir="rtl"] .field-label-inline .field-items {
- float: right;
- margin-left: 0.5em;
- margin-right: 0;
+.field--label-inline .field__label,
+.field--label-inline > .field__item,
+.field--label-inline .field__items {
+ display: inline-block;
+ padding-right: 0.5em;
}
-.field-label-inline .field-label::after {
- content: ':';
+[dir="rtl"] .field--label-inline .field__label,
+[dir="rtl"] .field--label-inline .field__items {
+ padding-left: 0.5em;
+ padding-right: 0;
}
/* Form display */
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index 5c3a60a..f87100d 100644
--- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php
+++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
@@ -60,7 +60,7 @@ function testMultiForm() {
$field_name = 'field_ajax_test';
$form_xpath = '//form[starts-with(@id, "node-page-form")]';
- $field_xpath = '//div[contains(@class, "field-name-field-ajax-test")]';
+ $field_xpath = '//div[contains(@class, "field--name-field-ajax-test")]';
$button_name = $field_name . '_add_more';
$button_value = t('Add another item');
$button_xpath_suffix = '//input[@name="' . $button_name . '"]';
diff --git a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php
index 362f269..a80b984 100644
--- a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php
@@ -46,12 +46,9 @@ protected function setUp() {
*/
function testEntityViewController() {
$get_label_markup = function($label) {
- return '
-
';
+ return '
+
' . $label . '
+ ';
};
foreach ($this->entities as $entity) {
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index 9826070..ddb86ae 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -97,7 +97,7 @@ function testPreserveFormActionAfterAJAX() {
// field items in the field for which we just added an item.
$this->drupalGet('node/add/page');
$this->drupalPostAjaxForm(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), NULL, array(), array(), 'node-page-form');
- $this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
+ $this->assert(count($this->xpath('//div[contains(@class, "field--name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
// Submit the form with the non-Ajax "Save" button, leaving the title field
// blank to trigger a validation error, and ensure that a validation error
diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig
index 0745f84..d3ddcd2 100644
--- a/core/modules/system/templates/field.html.twig
+++ b/core/modules/system/templates/field.html.twig
@@ -1,7 +1,7 @@
{#
/**
* @file
- * Default theme implementation for a field.
+ * Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
@@ -24,7 +24,7 @@
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
- * - content_attributes: HTML attributes for the content.
+ * - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
@@ -33,35 +33,34 @@
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
- * @see template_preprocess_field()
*
- * @ingroup themeable
+ * @see template_preprocess_field()
*/
#}
-{% set field_name_class = field_name|clean_class %}
-{%
- set classes = [
- 'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
- label_display == 'inline' ? 'clearfix',
- ]
-%}
-{%
- set title_classes = [
- 'field-label',
- label_display == 'visually_hidden' ? 'visually-hidden',
- ]
-%}
-
- {% if not label_hidden %}
-
{{ label }}
+
+{% if label_hidden %}
+ {% if multiple %}
+
+ {% for item in items %}
+
{{ item.content }}
+ {% endfor %}
+
+ {% else %}
+ {% for item in items %}
+
{{ item.content }}
+ {% endfor %}
{% endif %}
-
+{% else %}
+
+
{{ label }}:
+ {% if multiple %}
+
+ {% endif %}
{% for item in items %}
-
{{ item.content }}
+
{{ item.content }}
{% endfor %}
+ {% if multiple %}
+
+ {% endif %}
-
+{% endif %}
diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php
index 09a0de2..3af85d8 100644
--- a/core/modules/taxonomy/src/Tests/TermTest.php
+++ b/core/modules/taxonomy/src/Tests/TermTest.php
@@ -339,12 +339,12 @@ function testTermInterface() {
$this->assertText($edit['description[0][value]'], 'The randomly generated term description is present.');
// Did this page request display a 'term-listing-heading'?
- $this->assertTrue($this->xpath('//div[contains(@class, "field-taxonomy-term--description")]'), 'Term page displayed the term description element.');
+ $this->assertTrue($this->xpath('//div[contains(@class, "field--name-description")]'), 'Term page displayed the term description element.');
// Check that it does NOT show a description when description is blank.
$term->setDescription(NULL);
$term->save();
$this->drupalGet('taxonomy/term/' . $term->id());
- $this->assertFalse($this->xpath('//div[contains(@class, "field-taxonomy-term--description")]'), 'Term page did not display the term description when description was blank.');
+ $this->assertFalse($this->xpath('//div[contains(@class, "field--entity-taxonomy-term--description")]'), 'Term page did not display the term description when description was blank.');
// Check that the description value is processed.
$value = $this->randomMachineName();
diff --git a/core/modules/views/src/Tests/Handler/FieldWebTest.php b/core/modules/views/src/Tests/Handler/FieldWebTest.php
index 3ffec6b..0435809 100644
--- a/core/modules/views/src/Tests/Handler/FieldWebTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldWebTest.php
@@ -400,7 +400,7 @@ public function testFieldClasses() {
$output = $view->preview();
$output = $renderer->renderRoot($output);
$this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', array(':class' => 'field-content')));
- $this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', array(':class' => 'field-label')));
+ $this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', array(':class' => 'field__label')));
$id_field->options['element_default_classes'] = TRUE;
$output = $view->preview();
diff --git a/core/themes/bartik/css/components/comments.css b/core/themes/bartik/css/components/comments.css
index 8515cd9..4b9980e 100644
--- a/core/themes/bartik/css/components/comments.css
+++ b/core/themes/bartik/css/components/comments.css
@@ -29,8 +29,8 @@
.comment__attribution img {
border: 1px solid #d3d7d9;
}
-/* This is required to win over specificity of .field-type-image img */
-.comment .field-name-user-picture img {
+/* This is required to win over specificity of .field--type-image img */
+.comment .field--name-user-picture img {
margin: 0;
}
.comment__author .username {
diff --git a/core/themes/bartik/css/components/content.css b/core/themes/bartik/css/components/content.css
index cf436e8..850323f 100644
--- a/core/themes/bartik/css/components/content.css
+++ b/core/themes/bartik/css/components/content.css
@@ -87,47 +87,47 @@ h1#page-title {
color: #68696b;
margin-bottom: -5px;
}
-.node__meta .field-name-field-user-picture img {
+.node__meta .field--name-field-user-picture img {
float: left; /* LTR */
margin: 1px 20px 0 0; /* LTR */
}
-[dir="rtl"] .node__meta .field-name-field-user-picture img {
+[dir="rtl"] .node__meta .field--name-field-user-picture img {
float: right;
margin-left: 20px;
margin-right: 0;
}
-.field-name-field-tags {
+.field--name-field-tags {
margin: 0 0 1.2em;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
-.field-name-field-tags .field-label {
+.field--name-field-tags .field__label {
font-weight: normal;
margin: 0;
padding-right: 5px; /* LTR */
}
-[dir="rtl"] .field-name-field-tags .field-label {
+[dir="rtl"] .field--name-field-tags .field__label {
padding-left: 5px;
padding-right: 0;
}
-.field-name-field-tags .field-label,
-.field-name-field-tags ul.links {
+.field--name-field-tags .field__label,
+.field--name-field-tags ul.links {
font-size: 0.8em;
}
-.node--view-mode-teaser .field-name-field-tags .field-label,
-.node--view-mode-teaser .field-name-field-tags ul.links {
+.node--view-mode-teaser .field--name-field-tags .field__label,
+.node--view-mode-teaser .field--name-field-tags ul.links {
font-size: 0.821em;
}
-.field-name-field-tags ul.links {
+.field--name-field-tags ul.links {
padding: 0;
margin: 0;
list-style: none;
}
-.field-name-field-tags ul.links li {
+.field--name-field-tags ul.links li {
float: left; /* LTR */
padding: 0 1em 0 0; /* LTR */
white-space: nowrap;
}
-[dir="rtl"] .field-name-field-tags ul.links li {
+[dir="rtl"] .field--name-field-tags ul.links li {
padding: 0 0 0 1em;
float: right;
}
@@ -138,23 +138,23 @@ h1#page-title {
text-align: left;
}
@media all and (min-width: 560px) {
- .node .field-type-image {
+ .node .field--type-image {
float: left; /* LTR */
margin: 0 1em 0 0; /* LTR */
}
- [dir="rtl"] .node .field-type-image {
+ [dir="rtl"] .node .field--type-image {
float: right;
margin: 0 0 0 1em;
}
- .node .field-type-image + .field-type-image {
+ .node .field--type-image + .field--type-image {
clear: both;
}
}
-.field-type-image img,
-.field-name-field-user-picture img {
+.field--type-image img,
+.field--name-field-user-picture img {
margin: 0 0 1em;
}
-.field-type-image a {
+.field--type-image a {
border-bottom: none;
}
ul.links {
diff --git a/core/themes/bartik/css/components/user.css b/core/themes/bartik/css/components/user.css
index 3963534..e5e0ebf 100644
--- a/core/themes/bartik/css/components/user.css
+++ b/core/themes/bartik/css/components/user.css
@@ -1,6 +1,6 @@
/* -------------- User Profile -------------- */
-.profile .field-name-field-user-picture {
+.profile .field--name-field-user-picture {
float: none;
}
div.password-suggestions {
diff --git a/core/themes/bartik/templates/field--node--field-tags.html.twig b/core/themes/bartik/templates/field--node--field-tags.html.twig
index c228697..dab4094 100644
--- a/core/themes/bartik/templates/field--node--field-tags.html.twig
+++ b/core/themes/bartik/templates/field--node--field-tags.html.twig
@@ -21,20 +21,18 @@
* @see bartik_preprocess_field()
*/
#}
-{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
+ 'field--name-' ~ field_name|clean_class,
+ 'field--type-' ~ field_type|clean_class,
+ 'field--label-' ~ label_display,
'clearfix',
]
%}
{%
set title_classes = [
- 'field-label',
+ 'field__label',
label_display == 'inline' ? 'inline',
]
%}
@@ -42,7 +40,7 @@
{% if not label_hidden %}
{{ label }}
{% endif %}
-
+
{% for item in items %}
- {{ item.content }}
{% endfor %}
diff --git a/core/themes/classy/templates/field/field--comment.html.twig b/core/themes/classy/templates/field/field--comment.html.twig
index 930c232..f797310 100644
--- a/core/themes/classy/templates/field/field--comment.html.twig
+++ b/core/themes/classy/templates/field/field--comment.html.twig
@@ -13,7 +13,6 @@
* - title_suffix: Additional title output populated by modules, intended to
* be displayed after the main title tag that appears in the template.
* - comments: List of comments rendered through comment.html.twig.
- * - content_attributes: HTML attributes for the form title.
* - comment_form: The 'Add new comment' form.
* - comment_display_mode: Is the comments are threaded.
* - comment_type: The comment type bundle ID for the comment field.
@@ -26,15 +25,12 @@
* @see comment_preprocess_field()
*/
#}
-{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
- label_display == 'inline' ? 'clearfix',
+ 'field--name-' ~ field_name|clean_class,
+ 'field--type-' ~ field_type|clean_class,
+ 'field--label-' ~ label_display,
'comment-wrapper',
]
%}
@@ -54,7 +50,7 @@
{{ comments }}
{% if comment_form %}
- {{ 'Add new comment'|t }}
+
{{ comment_form }}
{% 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 6bc3939..72d5d67 100644
--- a/core/themes/classy/templates/field/field--node--created.html.twig
+++ b/core/themes/classy/templates/field/field--node--created.html.twig
@@ -19,14 +19,12 @@
* @see field.html.twig
*/
#}
-{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
+ 'field--name-' ~ field_name|clean_class,
+ 'field--type-' ~ field_type|clean_class,
+ 'field--label-' ~ label_display,
]
%}
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 48a732d..33b105f 100644
--- a/core/themes/classy/templates/field/field--node--title.html.twig
+++ b/core/themes/classy/templates/field/field--node--title.html.twig
@@ -19,14 +19,12 @@
* @see field.html.twig
*/
#}
-{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
+ 'field--name-' ~ field_name|clean_class,
+ 'field--type-' ~ field_type|clean_class,
+ 'field--label-' ~ label_display,
]
%}
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 dcebead..a31f2b8 100644
--- a/core/themes/classy/templates/field/field--node--uid.html.twig
+++ b/core/themes/classy/templates/field/field--node--uid.html.twig
@@ -19,14 +19,12 @@
* @see field.html.twig
*/
#}
-{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
+ 'field--name-' ~ field_name_class,
+ 'field--type-' ~ field_type|clean_class,
+ 'field--label-' ~ label_display,
]
%}
diff --git a/core/themes/classy/templates/field/field.html.twig b/core/themes/classy/templates/field/field.html.twig
index 5ab1e92..8e072ae 100644
--- a/core/themes/classy/templates/field/field.html.twig
+++ b/core/themes/classy/templates/field/field.html.twig
@@ -24,7 +24,7 @@
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
- * - content_attributes: HTML attributes for the content.
+ * - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
@@ -33,33 +33,48 @@
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
+ *
* @see template_preprocess_field()
*/
#}
-{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
- 'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
- 'field-name-' ~ field_name_class,
- 'field-type-' ~ field_type|clean_class,
- 'field-label-' ~ label_display,
- label_display == 'inline' ? 'clearfix',
+ 'field--name-' ~ field_name|clean_class,
+ 'field--type-' ~ field_type|clean_class,
+ 'field--label-' ~ label_display,
]
%}
{%
set title_classes = [
- 'field-label',
+ 'field__label',
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
-
- {% if not label_hidden %}
-
{{ label }}
+
+{% if label_hidden %}
+ {% if multiple %}
+
+ {% for item in items %}
+
{{ item.content }}
+ {% endfor %}
+
+ {% else %}
+ {% for item in items %}
+
{{ item.content }}
+ {% endfor %}
{% endif %}
-
+{% else %}
+
+
{{ label }}:
+ {% if multiple %}
+
+ {% endif %}
{% for item in items %}
-
{{ item.content }}
+
{{ item.content }}
{% endfor %}
+ {% if multiple %}
+
+ {% endif %}
-
+{% endif %}