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.
Dear,
I am trying to create a table views layout with 3 cols. I'd like to customize the width of these columns and therefore have provided each "Field" with a CSS class and a wrapper element of default (I have tried multiple options). When I save the view and look at it on my page it shows that the class is omitted. There's also no wrapper present, regardless of my choice of element. What could be causing this issue, and more importantly, how do I solve it?
Kind thanks in advance
Comment | File | Size | Author |
---|---|---|---|
problem.png | 42.84 KB | Sherbet |
Comments
Comment #1
dawehnerCan you please try out the latest dev version?
A lot of things got fixed there already, also in the area you report.
Comment #2
Sherbet CreditAttribution: Sherbet commentedI upgraded to the latest dev. This however does not seem to fix the issue.
EDIT: If I try to wrap just the field, rather than field+label, it does seem to work, perhaps a misinterpretation on my end?
Comment #3
dawehnerWrap is the actual content.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedSo what actually shows up in the output?
Comment #5
Sherbet CreditAttribution: Sherbet commentedBy wrapping the field in default elements and not the label I get this output:
Class: "views-field views-field-title archieftitle"
If I try to wrap field+label in a specific class, it simply gives "views-field views-field-title", regardless of my chosen wrapper element (including default).
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedAH! Okay, I understand what is going on.
The Wrap "Field and Label" means the class that goes around the combination of the field and label. In a normal style, that means you would get this:
However, you imply that you're using the table style. Since the label and the field are separated, this 3rd checkbox doesn't actually apply. What I think you mean is that you would expect the class there to be applied to both the field and the label.
This expectation is reasonable, actually. And certainly the table style could interpret it to mean that, and that's a good idea, at least for the class. However, things get more difficult for the associated element, because for the class you can just merge them together; but for the element, if they're different, you either have to double-wrap or pick one over the other.
I need to think about how best to handle this one.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedRetitling.
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedI updated the wording and description slightly. Hopefully this will make the option more understandable.
Comment #10
naught101 CreditAttribution: naught101 commentedWhy not just add the field+label classes to both the field and the label, separately? e.g. same behaviour as adding the class to each of the field and label class textfields.