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

CommentFileSizeAuthor
problem.png42.84 KBSherbet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Can you please try out the latest dev version?

A lot of things got fixed there already, also in the area you report.

Sherbet’s picture

I 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?

dawehner’s picture

Wrap is the actual content.

merlinofchaos’s picture

So what actually shows up in the output?

Sherbet’s picture

By 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).

merlinofchaos’s picture

AH! 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:

<div class="fieldandlabelclass">
  <span class="labelclass">Label</span>
  <div class="fieldclass">Field</span>
</div>

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.

merlinofchaos’s picture

Title: Classes added on fields are omitted from code output » Field + Wrapper class/element meaningless with table style

Retitling.

merlinofchaos’s picture

Status: Active » Fixed

I updated the wording and description slightly. Hopefully this will make the option more understandable.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

naught101’s picture

Why 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.