rowStyleOptions example


  protected function buildFormStyle(array &$form, FormStateInterface $form_state$type) {
    $style_form = &$form['displays'][$type]['options']['style'];
    $style = $style_form['style_plugin']['#default_value'];
    $style_plugin = Views::pluginManager('style')->createInstance($style);
    if (isset($style_plugin) && $style_plugin->usesRowPlugin()) {
      $options = $this->rowStyleOptions();
      $style_form['row_plugin'] = [
        '#type' => 'select',
        '#title' => $this->t('of'),
        '#options' => $options,
        '#access' => count($options) > 1,
      ];
      // For the block display, the default value should be "titles (linked)",       // if it's available (since that's the most common use case).       $block_with_linked_titles_available = ($type == 'block' && isset($options['titles_linked']));
      $default_value = $block_with_linked_titles_available ? 'titles_linked' : key($options);
      $style_form['row_plugin']['#default_value'] = static::getSelected($form_state[$type, 'style', 'row_plugin']$default_value$style_form['row_plugin']);
      

  protected $createdColumn = 'changed';

  /** * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::rowStyleOptions(). * * Node revisions do not support full posts or teasers, so remove them. */
  protected function rowStyleOptions() {
    $options = parent::rowStyleOptions();
    unset($options['teasers']);
    unset($options['full_posts']);
    return $options;
  }

  /** * {@inheritdoc} */
  protected function defaultDisplayOptions() {
    $display_options = parent::defaultDisplayOptions();

    
Home | Imprint | This part of the site doesn't use cookies.