I originally created this as support request, and stated that "I'm relatively sure this isn't a bug, because if it were, I'd certainly have found an issue for it." - but since then, I've realized it is, most likely, a bug in the Views Calc module, so I've moved it here and updated this OP.
[See additional details in post #4.]
I went to the settings for my field, clicked to expand "Style settings", checked "Customize field HTML", left "HTML Element" on "Use default", checked "Create a CSS class" and entered "my-class".
I updated the preview (in Views) and inspected the markup for that field. That class is not there. Just to be sure, I saved the view, refreshed the page and inspected again - still not there. Also, to be doubly sure, I cleared all caches, and even cleared the Views cache (even though Views caching is disabled in my dev environment). Still nothing.
I've also tried the Field Formatter Class module, but it won't add a class to the field either. I don't have any templates overriding the View - at any level (field, display, or view).
Comment | File | Size | Author |
---|---|---|---|
#5 | field-settings.png | 84.53 KB | ExTexan |
#5 | field-html.png | 127.14 KB | ExTexan |
Comments
Comment #2
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedIt works fine at my end. I added class to the field and I am able to see that class in inspect element of that field.
Comment #3
ankur.addweb CreditAttribution: ankur.addweb at AddWeb Solution Pvt. Ltd. commentedCan you please provide output of your view field and also which format you are using?
Comment #4
ExTexan CreditAttribution: ExTexan commentedOk, I was grabbing screenshots to post here for you, but then I saw that the classes are being rendered now - at least on a display I added to that view that does (almost) the same thing as the original. I created the new display because of an issue I was having adding an "Edit" link. Now, other than the Edit link, the only difference between the view that's working and the one that isn't is that one is "Table" format, the other is "Views Calc Table". [I'll move this issue to that module.]
Additional info re: the issue... I've uploaded two more screenshots. One shows the Style settings of one of the fields, to show the class I added. The other shows the HTML of all fields in that view. As you can see, there's something strange going on with the classes. Some of the fields I've specified to be centered, others as right-justified. The classes that handle that are being duplicated, and there appears to be an extra space between the two duplicates (not sure if that's a helpful clue, but there it is).
I suspect that the field class I specified not showing is tied into this issue somehow. The other display I created, with format "Table" shows the classes rendered correctly.
Comment #5
ExTexan CreditAttribution: ExTexan commentedComment #6
ExTexan CreditAttribution: ExTexan commentedComment #7
ExTexan CreditAttribution: ExTexan commented