The code block from Drupal\ds\Form\ClassesForm seems to unessarily prevent the use of custom CSS classes for fields if the ds_extras module is not enabled:
// Only show field classes if DS extras module is enabled.
if (\Drupal::moduleHandler()->moduleExists('ds_extras')) {
$form['fields'] = [
'#type' => 'textarea',
'#title' => $this->t('CSS classes for fields'),
'#default_value' => implode("\n", $config->get('classes.field')),
'#description' => $this->t('Configure CSS classes which you can add to fields on the "manage display" screens. Add multiple CSS classes line by line.<br />If you want to have a friendly name, separate class and friendly name by |, but this is not required. eg:<br /><em>class_name_1<br />class_name_2|Friendly name<br />class_name_3</em>'),
];
}
Since Field Templates is part of Display Suite core (and even mentions adding classes in its enable form), why is this feature disabled if ds_extras is not enabled? I tested with the restriction removed and the feature worked as expected without ds_extras. Is there something I am missing and somewhere things will explode if this feature is used without ds_extras or is it some old code hold over when maybe the Field Templates feature may have been intended to go into the Extras module? If the later it would be useful if the restriction was removed.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2893219-ds-allways-allow-field-custom-css.patch | 1.81 KB | magicmyth |
Comments
Comment #2
magicmyth CreditAttribution: magicmyth as a volunteer commentedAttaching a patch to always enable "CSS classes for fields" form field.
Comment #3
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedHmm, you're right, this doesn't make any sense at all, let's see what the bot thinks.
Comment #5
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedcommited and pushed, thanks!
Comment #6
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commented