layout_paragraphs-1.0.x-dev/tests/modules/layout_paragraphs_alter_controls_test/layout_paragraphs_alter_controls_test.module

tests/modules/layout_paragraphs_alter_controls_test/layout_paragraphs_alter_controls_test.module
<?php

/**
 * @file
 * Contains layout_paragraphs_alter_controls_test module.
 */

/**
 * Implements hook_preprocess_layout_paragraphs_builder_controls().
 */
function layout_paragraphs_alter_controls_test_preprocess_layout_paragraphs_builder_controls(array &$variables) {
  // Hide the edit link.
  $variables['controls']['edit_link']['#access'] = FALSE;
  // Delete the delete link.
  unset($variables['controls']['delete_link']);
  // Add an arbitrary span.
  $variables['controls']['test_span'] = [
    '#type' => 'html_tag',
    '#tag' => 'span',
    '#value' => 'Arbitrary Control Element',
    '#attributes' => [
      'class' => ['lpb-alter-controls-test-element'],
    ],
  ];
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc