Hi,
I noticed two problems in the html output of the "Display suite fields" row plugin for views
(class views_plugin_ds_fields_view)

1. Missing class "clear-block" on views rows.
We need this class to clear the floating ds regions.

Temporary fix: Custom module with

<?php
function mymodule_preprocess_views_view_unformatted(&$vars) {
  if (is_a($vars['view']->style_plugin->row_plugin, 'views_plugin_ds_fields_view')) {
    foreach ($vars['classes'] as $id => $class) {
      $vars['classes'][$id] .= ' clear-block';
    }
  }
}
?>

2. No class on fields
It's hard to target individual fields with css, if they don't have a class with them.

Temporary fix:
In views_plugin_ds_fields_view::ds_fields_render()

<?php
      // Class.
      $class = '';
      if (!empty($this->view->style_plugin->row_plugin->options[$key]['css-class'])) {
        $class = $this->view->style_plugin->row_plugin->options[$key]['css-class'];
      }
?>

becomes

<?php
      // Class.
      $class = 'views-field-' . $field->class . ' ';
      if (!empty($this->view->style_plugin->row_plugin->options[$key]['css-class'])) {
        $class = $this->view->style_plugin->row_plugin->options[$key]['css-class'];
      }
?>

------

Fyi, I did this on display suite 6.x-1.4

Comments

swentel’s picture

1. Should we just include this always in ds by default or not then ?
2. this is related to #1003380: Original field css class has disappeared. also - wondering how to make sure I don't break this again.

aspilicious’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

There is no use in changing this now. Closing this to make the queue maintainable.