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.
Hi,
It seems that view field "style settings" are lost when using "views displays".
Step-by-Step:
- Enabled "Views Displays"
- Changed the view's display mode to "Display suite fields"
- Adjusted the layout on
/admin/structure/ds/vd/manage/*
. - Changed a field's style settings: "Customize Field Wrapper HTML" and set Element to "H2"
- Navigate to the view's page; the field is not (!) displayed inside a H2 element
I can still override the field output with something like <h2>[title_1]</h2>
, but that seems kind-of ugly.
Is this a bug, by-design, or me doing something wrong? ;-)
Comment | File | Size | Author |
---|---|---|---|
#7 | ds-Views-field-style-override-label-fix-1678146-7.patch | 1.2 KB | steven.wichers |
#6 | ds-hack-in-views-field-styles-support-1678146-5.patch | 1.26 KB | steven.wichers |
Comments
Comment #1
swentel CreditAttribution: swentel commentedYeah, not all those things are supported with views fields, so more or less by design. It's kinda hard to mimic this and i've been contemplating to remove this because we haven't even used this anyway in a project so far :)
Comment #2
bforchhammer CreditAttribution: bforchhammer commentedPlease don't remove it, I'm using it now :-)
Comment #3
swentel CreditAttribution: swentel commentedok :)
Comment #4
dalehgeist CreditAttribution: dalehgeist commentedJust chiming in here: this feature is saving my bacon right now - I would be looking at tediously overriding several views tpl.php files if not for this feature. Unfortunately I'm running into the same problem: I have to do a rewrite within Views in order to apply the per-field styles that is such a cool feature of Views 3.
If you can get around to supporting this, I'd tell all my friends. ; )
Comment #5
steven.wichers CreditAttribution: steven.wichers commentedSecond this. We use this feature on several websites, but the lack of tweaking the individual fields really hurts. Even if the field templates functionality worked (so you had to manage classes, wrappers, etc. via DS) that would be great.
Comment #6
steven.wichers CreditAttribution: steven.wichers commentedThe source of the problem is that
template_preprocess_views_view_fields()
is not being called beforetemplate_preprocess_ds_row_fields()
, so the more advanced rendering of fields never happens. I do not know what needs to be done to ensure that this hook is called before the Display Suite one.I have hacked in a manual call to this function, and tweaked the logic of the render loop to prefer the views_view_fields rendered content instead of the thrown together markup that follows.
This is tested working on the site I am working on. This patch is a workaround, and not a fix. The fix would be to make sure the
template_preprocess_views_view_fields()
hook is called beforetemplate_preprocess_ds_row_fields()
and then use the available fields array it provides.Comment #7
steven.wichers CreditAttribution: steven.wichers commentedHere's another patch that fixes and issue with the labels on some fields not showing.
Comment #8
kclarkson CreditAttribution: kclarkson commentedSwentel,
What do you think of this patch ?
I too am in the same boat.
Another option would be for the views display fields to have the similar options for custom settings just like the normal displays.
Comment #9
kopeboy CreditAttribution: kopeboy commentedSame here, style in Views does not talk to Display Suite Views.
Are we gonna see this fix included in a version update of Views module? (please! :D )
Comment #10
rphillipsfeynman CreditAttribution: rphillipsfeynman commentedI am still having this issue with Display Suite 7.x-2.6 and Views 7.x-3.7. I am trying to wrap a field in h1 tags but it takes no effect when I try to set it in "Style settings". My view is using an Unformatted list format and Display Suite Fields.
Also, the patch from #7 didn't work for me.
Comment #11
steven.wichers CreditAttribution: steven.wichers commentedComment #12
littlepixiez CreditAttribution: littlepixiez commentedI have the same issue, with none of my custom views markup showing when choosing Display Suite Fields. Would be fantastic if these worked together rather than having to manually add the markup.
Comment #13
Per CreditAttribution: Per as a volunteer commentedSame issue, any clue?
Comment #14
cassio CreditAttribution: cassio as a volunteer commentedHow do i know if I'm using display suite fields in my view? does it matter? is enabling enough?