diff -u b/src/Form/GeneralSettingsForm.php b/src/Form/GeneralSettingsForm.php
--- b/src/Form/GeneralSettingsForm.php
+++ b/src/Form/GeneralSettingsForm.php
@@ -2,6 +2,7 @@
namespace Drupal\diff\Form;
+use Drupal\Component\Utility\Xss;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\diff\DiffLayoutManager;
@@ -100,7 +101,7 @@
$form['layout_plugins'] = [
'#type' => 'table',
- '#header' => [t('Layout'), t('Weight')],
+ '#header' => [t('Layout'), t('Description'), t('Weight')],
'#empty' => t('There are no items yet. Add an item.'),
'#suffix' => '
' . $this->t('The layout plugins that are enabled for displaying the diff comparison.') .'
',
'#tabledrag' => [
@@ -115,13 +116,17 @@
uasort($layout_plugins_order, 'Drupal\Component\Utility\SortArray::sortByWeightElement');
foreach ($layout_plugins_order as $id => $layout_plugin) {
+ $description = $this->diffLayoutManager->getDefinition($id)['description'];
$form['layout_plugins'][$id]['#attributes']['class'][] = 'draggable';
$form['layout_plugins'][$id]['enabled'] = [
'#type' => 'checkbox',
'#title' => $layout_plugin['label'],
'#title_display' => 'after',
'#default_value' => $layout_plugin['enabled'],
- '#description' => $this->diffLayoutManager->getDefinition($id)['description'],
+ ];
+ $form['layout_plugins'][$id]['description'] = [
+ '#type' => 'markup',
+ '#markup' => isset($description) ? Xss::filter($description) : '',
];
$form['layout_plugins'][$id]['weight'] = [
'#type' => 'weight',
only in patch2:
unchanged:
--- a/src/Annotation/DiffLayoutBuilder.php
+++ b/src/Annotation/DiffLayoutBuilder.php
@@ -30,4 +30,11 @@ class DiffLayoutBuilder extends Plugin {
*/
public $label;
+ /**
+ * The plugin description.
+ *
+ * @var string
+ */
+ public $description;
+
}