You are here

public function UIkitViewList::buildOptionsForm in UIkit Components 8

Same name and namespace in other branches
  1. 8.3 uikit_views/src/Plugin/views/style/UIkitViewList.php \Drupal\uikit_views\Plugin\views\style\UIkitViewList::buildOptionsForm()
  2. 8.2 uikit_views/src/Plugin/views/style/UIkitViewList.php \Drupal\uikit_views\Plugin\views\style\UIkitViewList::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

File

uikit_views/src/Plugin/views/style/UIkitViewList.php, line 53

Class

UIkitViewList
Style plugin to render each item in a UIkit List component.

Namespace

Drupal\uikit_views\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $args = [
    '@href' => 'https://getuikit.com/v2/docs/list.html',
    '@title' => 'List component - UIkit documentation',
  ];
  $form['wrapper_class'] = [
    '#title' => $this
      ->t('Wrapper class'),
    '#description' => $this
      ->t('The class to provide on the wrapper, outside the list.'),
    '#type' => 'textfield',
    '#size' => '30',
    '#default_value' => $this->options['wrapper_class'],
  ];
  $form['class'] = [
    '#title' => $this
      ->t('List class'),
    '#description' => $this
      ->t('The modifier to apply to the list. See <a href="@href" target="_blank" title="@title">List component</a> to view examples of each list modifier.', $args),
    '#type' => 'select',
    '#default_value' => $this->options['class'],
    '#options' => [
      'default' => $this
        ->t('Default'),
      'uk-list-line' => $this
        ->t('List line'),
      'uk-list-striped' => $this
        ->t('List striped'),
      'uk-list-space' => $this
        ->t('List space'),
    ],
  ];
}