From b5a22c863f9861007312f65d408f9c9931dbd800 Mon Sep 17 00:00:00 2001 From: Grevil <js@webks.de> Date: Mon, 29 Aug 2022 16:03:27 +0200 Subject: [PATCH] added fences_field_items_wrapper_only_for_multiple_values checkbox --- config/schema/fences.schema.yml | 3 +++ fences.module | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/config/schema/fences.schema.yml b/config/schema/fences.schema.yml index b1e8602..2cb29cd 100644 --- a/config/schema/fences.schema.yml +++ b/config/schema/fences.schema.yml @@ -14,6 +14,9 @@ field.formatter.third_party.fences: fences_field_items_wrapper_classes: type: string label: 'The field items wrapper CSS classes' + fences_field_items_wrapper_only_for_multiple_values: + type: boolean + label: 'Only add wrapper for multiple values' fences_field_item_tag: type: string label: 'The field item HTML tag' diff --git a/fences.module b/fences.module index 5b4fd14..a3b40f1 100755 --- a/fences.module +++ b/fences.module @@ -81,6 +81,12 @@ function fences_field_formatter_third_party_settings_form(FormatterInterface $pl // Remove default maxlength of 128: '#maxlength' => NULL, ]; + $settings['fences']['fences_field_items_wrapper_only_for_multiple_values'] = [ + '#title' => t('Only for multiple values'), + '#type' => 'checkbox', + '#description' => 'Only add the wrapper, if there is more than one value present', + '#default_value' => $plugin->getThirdPartySetting('fences', 'fences_field_items_wrapper_only_for_multiple_values', FALSE), + ]; $settings['fences']['fences_field_item_tag'] = [ '#title' => t('Field Item Tag'), '#type' => 'select', -- GitLab