I have a view where two fields are configured to appear in the same column. I've also manually defined wrappers and CSS classes for these fields. But in the final output, only the first field's wrapper appears; the data of the second (merged) field appears within the first field's wrapper, and the second field's wrapper is nowhere to be seen.

CommentFileSizeAuthor
#1 1290698.patch941 bytesdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
941 bytes

Here is a patch which solves this issue

dawehner’s picture

Issue tags: +dvcs11

This issue probably needs some testing

dawehner’s picture

Status: Needs review » Needs work
+++ b/theme/theme.incundefined
@@ -536,11 +536,13 @@ function template_preprocess_views_view_table(&$vars) {
+        $vars['field_classes'][$used_column ][$num] .= $classes;

An unneeded space.

It would be kind of cool if you could test the patch.

johan2’s picture

Hi,
I was struggling with this fields also, whatever css I added it didn't work. You noticed that the cause was the combined column...
So I tested your patch in an OM subtheme and now it works. I was looking everywhere what went wrong, so thank you for this patch.
with friendly regards, Johan

johan2’s picture

Hi,
I tested further and noticed that the fields first didn't apply any css from the field settings (with a table view). With the patch the styles are working but... Now I can apply a css but these are all combined. Even more strange is that the first field in the collumn keeps the default styles, from the second field in the collumn the styles are applied but combined, so they override each other. Strange ;-)

tim.plunkett’s picture

Issue tags: +Needs tests

Fixing tag.

Ronino’s picture

Version: 7.x-3.0-rc1 » 7.x-3.3
Component: Miscellaneous » table style

For me, the patch from #1 adds the field wrapper classes to the td containing the fields, but not to the field wrappers themselves which is what I would expect. So for me, this doesn't work. But I don't have a different solution either...

Renee S’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Renee S’s picture

end user’s picture

Issue summary: View changes

I'm using the latest dev and the patch seems to have worked for me. Before that figured out I could set the Rewrite the output of this field settings to do the same thing but this is much better.