', '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 af2ed4638c923d3fc01f46837085b668e0ae946c..ebb22ff24566c5f9256c44bb74ddb9c38911c4fe 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 c60d44a0a950a5a2c2370a08c769e7a25cf20065..ed400ea15c76433b23491b9b7c09d14307c69c9f 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 4e43d61e81b10eb9e57c6ef44a5bfa03668d0a5a..8a51fc6b2cef92019646037b6864c078eebacb6a 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 0a7e1f80f9471cf1008c3a8c5f55d79559df0232..245dc44b83390000b4592ae25df23d84492b13f3 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -270,6 +270,36 @@ function rdf_preprocess_html(&$variables) {
}
}
+/**
+ * Implements hook_preprocess_HOOK().
+ *
+ * @todo remove after https://www.drupal.org/node/2556785 is fixed.
+ */
+function rdf_preprocess_field__node(&$variables) {
+ // Just an empty hook to avoid https://www.drupal.org/node/2556785.
+}
+
+/**
+ * Implements hook_preprocess_HOOK() for UID field templates.
+ */
+function rdf_preprocess_field__node__uid(&$variables) {
+ _rdf_set_field_rel_attribute($variables);
+}
+
+/**
+ * Transforms the field property attribute into a rel attribute.
+ */
+function _rdf_set_field_rel_attribute(&$variables) {
+ // Swap the regular field property attribute and use the rel attribute
+ // instead so that it plays well with the RDFa markup when only a link is
+ // present in the field output, for example in the case of the uid field.
+ if (!empty($variables['attributes']['property'])) {
+ $variables['attributes']['rel'] = $variables['attributes']['property'];
+ unset($variables['attributes']['property']);
+ }
+}
+
+
/**
* Implements hook_preprocess_HOOK() for node templates.
*/
@@ -297,12 +327,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 f5974bb33412602560a1f57b923899b6a06b8da8..120d6f017fc11d47fd6aeece1ce7dcde8352bbd1 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 5036c626c51f5a283a93b28d41dc94af78fbec48..57f4c3f6d4ec880e07434a72aed7467787f06128 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 9f4a5ad232258aaad1750c9ce6efc5e6bd74dcf8..4f14b2621cc528a87f411b4427d453c092df5391 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 = $this->doSearchExcerpt('HTMLTest', $text);
$this->assertFalse(empty($result), 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts');
}
diff --git a/core/modules/system/css/components/field.theme.css b/core/modules/system/css/components/field.theme.css
index 89a16aae02dd4d9a6b583eb39ef531f4eda11cf2..0ef4c2d8c64b53834ab0aea6897035225b2cd471 100644
--- a/core/modules/system/css/components/field.theme.css
+++ b/core/modules/system/css/components/field.theme.css
@@ -3,20 +3,23 @@
* Visual styles for fields.
*/
-.field .field-label {
+.field__label {
font-weight: bold;
}
-.field-label-inline .field-label,
-.field-label-inline .field-items {
- float:left; /*LTR*/
- margin-right: 0.5em; /*LTR*/
+.field--label-inline .field__label,
+.field--label-inline .field__items {
+ float: left; /*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 {
+ padding-right: 0.5em;
}
-.field-label-inline .field-label::after {
+[dir="rtl"] .field--label-inline .field__label,
+[dir="rtl"] .field--label-inline .field__items {
+ padding-left: 0.5em;
+ padding-right: 0;
+}
+.field--label-inline .field__label::after {
content: ':';
}
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index 5c3a60aa6b683b2a6b40299e4b3e8aa273114ddd..f87100de1037ca040c4cfc3fb355b41012346f1d 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 362f269bba17535922cbf2ab0f92c52cfd92fcb9..a80b98412ac160b2837dd8330bab665bd7b9e197 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 98260704172df7bf68a71e0e59d13ceb7ca93f24..ddb86aed2bfd9aee056734b6334907a7d3b05c23 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 0745f84bdc6358e73365208d88b2bfd8ae268c9c..1b7857467543dde3c6b59bac8e47b3c5d797fb0f 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 09a0de2b23741102dfb90bfb92a63d87476e0c28..3af85d835f726d0416e340c9be9ffc67cbbbc54d 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 3ffec6b8d5e2b8d17f8d1d7fa0654778e2f72f27..0435809aef63a252035eb09a5eda6bc508a3c38b 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 d81e63b6055d2e06bc7a1286e64da72164763e0a..30e1be8dae8118ba52f0995e28837fe0ef53ba3d 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/field.css b/core/themes/bartik/css/components/field.css
index c00033a0ccfff6f744ab23199c8c79033e3777e0..77653481d167ec789bf73eca08a864b965c6ed32 100644
--- a/core/themes/bartik/css/components/field.css
+++ b/core/themes/bartik/css/components/field.css
@@ -3,93 +3,93 @@
* Visual styles for Bartik's field components.
*/
-.field-type-taxonomy-term-reference {
+.field--type-entity-reference {
margin: 0 0 1.2em;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
-.field-type-taxonomy-term-reference .field-label {
+.field--type-entity-reference .field__label {
font-weight: normal;
margin: 0;
padding-right: 5px; /* LTR */
}
-[dir="rtl"] .field-type-taxonomy-term-reference .field-label {
+[dir="rtl"] .field--type-entity-reference .field__label {
padding-left: 5px;
padding-right: 0;
}
-.field-type-taxonomy-term-reference .field-label,
-.field-type-taxonomy-term-reference ul.links {
+.field--type-entity-reference .field__label,
+.field--type-entity-reference ul.links {
font-size: 0.8em;
}
-.node--view-mode-teaser .field-type-taxonomy-term-reference .field-label,
-.node--view-mode-teaser .field-type-taxonomy-term-reference ul.links {
+.node--view-mode-teaser .field--type-entity-reference .field__label,
+.node--view-mode-teaser .field--type-entity-reference ul.links {
font-size: 0.821em;
}
-.field-type-taxonomy-term-reference ul.links {
+.field--type-entity-reference ul.links {
padding: 0;
margin: 0;
list-style: none;
}
-.field-type-taxonomy-term-reference ul.links li {
+.field--type-entity-reference ul.links li {
float: left; /* LTR */
padding: 0 1em 0 0; /* LTR */
white-space: nowrap;
}
-[dir="rtl"] .field-type-taxonomy-term-reference ul.links li {
+[dir="rtl"] .field--type-entity-reference ul.links li {
padding: 0 0 0 1em;
float: right;
}
@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;
}
-.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;
}
diff --git a/core/themes/bartik/css/components/node.css b/core/themes/bartik/css/components/node.css
index dcf4ac0b148b1aeb3cece5fd292c9326be8b306b..e57a68645bbaacea718f6a026f2e30a8d9380a42 100644
--- a/core/themes/bartik/css/components/node.css
+++ b/core/themes/bartik/css/components/node.css
@@ -40,11 +40,11 @@
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;
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 c2286977bd9018427ce1ec79eac191c6ee35af62..dab40947ef0cb0594cd7bf3736bf7691935f2f27 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 930c232ec001018c7a3d6bdcf23d63f9306f83f1..f7973108f55f5bef0bb799e20617342b13bc9d69 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 6bc393966cc9907f8b838621a4f89029a391f8c7..72d5d6737d26898d95e1fd4a76875d107bee9e5d 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 48a732dd068af77fd21603a3a6290066a9838fda..33b105f50b3eb1f767414d69cb22a4ec33418f93 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 dcebead841af158a3b1d3c8592faa401853b7889..a31f2b878f38ea8ccb9d26619d133d1396656b2c 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 5ab1e926e4388fe4ec06ce7f93d98cef96e5fb70..216fe708fd648241d7b6a983f1f7b13c5291a46f 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 %}