Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1290698.patch | 941 bytes | dawehner |
Comments
Comment #1
dawehnerHere is a patch which solves this issue
Comment #2
dawehnerThis issue probably needs some testing
Comment #3
dawehnerAn unneeded space.
It would be kind of cool if you could test the patch.
Comment #4
johan2 CreditAttribution: johan2 commentedHi,
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
Comment #5
johan2 CreditAttribution: johan2 commentedHi,
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 ;-)
Comment #6
tim.plunkettFixing tag.
Comment #7
Ronino CreditAttribution: Ronino commentedFor 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...
Comment #8
Renee S CreditAttribution: Renee S commentedComment #9
Renee S CreditAttribution: Renee S commentedI think the suggested solution here is ideal: #1368436: Customize field HTML css class with multiple fields in a column
Comment #10
end user CreditAttribution: end user commentedI'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.