usesOptions example

'#options' => $format_options,
      '#default_value' => $this->options['summary']['format'],
      '#states' => [
        'visible' => [
          ':input[name="options[default_action]"]' => ['value' => 'summary'],
        ],
      ],
    ];

    foreach ($summary_plugins as $id => $info) {
      $plugin = $this->getPlugin('style', $id);
      if (!$plugin->usesOptions()) {
        continue;
      }
      if ($plugin) {
        $form['summary']['options'][$id] = [
          '#prefix' => '<div id="edit-options-summary-options-' . $id . '-wrapper">',
          '#suffix' => '</div>',
          '#id' => 'edit-options-summary-options-' . $id,
          '#type' => 'item',
          // Trick it into checking input to make #process run.           '#input' => TRUE,
          '#states' => [
            
$options['style'] = [
      'category' => 'format',
      'title' => $this->t('Format'),
      'value' => $style_title,
      'setting' => $style_summary,
      'desc' => $this->t('Change the way content is formatted.'),
    ];

    // This adds a 'Settings' link to the style_options setting if the style has     // options.     if ($style_plugin_instance->usesOptions()) {
      $options['style']['links']['style_options'] = $this->t('Change settings for this format');
    }

    if ($style_plugin_instance->usesRowPlugin()) {
      $row_plugin_instance = $this->getPlugin('row');
      $row_summary = empty($row_plugin_instance->definition['title']) ? $this->t('Missing row plugin') : $row_plugin_instance->summaryTitle();
      $row_title = empty($row_plugin_instance->definition['title']) ? $this->t('Missing row plugin') : $row_plugin_instance->pluginTitle();

      $options['row'] = [
        'category' => 'format',
        'title' => $this->t('Show'),
        
Home | Imprint | This part of the site doesn't use cookies.