In the Format settings, I have two fields set to align right. However, if I turn off "Add default classes" for style settings at the field level, the alignment doesn't work for the field data, though it does still apply to the column heading. See example screenshot.
It may be argued that when turning off "Add default classes", this class really should *not* be added, but I think this class should not be included in the "defaults" as it is due to a setting that is selected specifically for the view, not generic default classes that views generates. We don't want all the extra classes in the markup of our pages, but we do want to be able to control justification.
UPDATE: The following copied from comment #13, as requested.
In this one, see the circled "Settings" option.
This is the form shown when you click "Settings". The alignment setting circled in red is how we right-justify numeric columns.
And in the "Fields" section, I clicked on "Field Collection Item: Quantity". The "Add default classes" setting is the one I referred to in my original post. Note that we had to leave that set on all fields in the site because of this issue.
With the settings as they are shown in the above screenshots, here's the rendered HTML. One thing I hadn't noticed before is that the "views-align-right" class is added twice on the column heading (red arrows). And, as you can see, it is also on the quantity field in the detail row (yellow underscore).
Then with the alignment setting for the quantity field still set to "Right", I unchecked its "Add default classes" setting. This is the rendered HTML with those settings.
Things to note there...
- One of the duplicated "views-align-right" classes has been removed from the column heading for that field, and that class has also been removed from the field (td).
- The default field classes were not actually removed from the quantity field. Instead, it appears that the classes for that field have been duplicated from the previous field ("position_year") - see the yellow underscores.
Comment | File | Size | Author |
---|---|---|---|
#13 | 2847925-e3.png | 212.5 KB | ExTexan |
#13 | 2847925-a.png | 42.15 KB | ExTexan |
#13 | 2847925-b.png | 118.31 KB | ExTexan |
#13 | 2847925-c.png | 75.71 KB | ExTexan |
#13 | 2847925-d.png | 225.56 KB | ExTexan |
Comments
Comment #2
LendudeMoving to the right queue.
@ExTexan I would be inclined to agree that these are to separate things. Would have to look at the underlying code if there are any other reasons these two things are connected.
Comment #12
larowlanCan you provide some steps to reproduce here.
I'm not sure which format settings you're referring to.
Comment #13
ExTexan CreditAttribution: ExTexan commentedPerhaps a series of screenshots would help...
In this one, see the circled "Settings" option.
This is the form shown when you click on "Settings". The alignment setting circled in red is how we right-justify numeric columns.
And in the "Fields" section, I clicked on "Field Collection Item: Quantity".
The "Add default classes" setting is the one I referred to in my original post. Note that we had to leave that set on all fields in the site because of this issue.
With the settings as they are shown in the above screenshots, here's the rendered HTML.
One thing I hadn't noticed before is that the "views-align-right" class is added twice on the column heading (red arrows).
And, as you can see, it is also on the quantity field in the detail row (yellow underscore).
Then with the alignment setting for the quantity field still set to "Right", I unchecked its "Add default classes" setting.
This is the rendered HTML with those settings.
Things to note there...
Comment #14
smustgrave CreditAttribution: smustgrave at Mobomo commentedCan confirm this issue on 11.x
Can the issue summary be updated with the steps written out like above.
Comment #15
ExTexan CreditAttribution: ExTexan commented