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.
When generating zebra classes please also provide first
and last
classes to the item elements. This will enable site builder to properly style, for example, a row of guttered images, where the first or last item has to have different side margin than others. As this seems to be a relatively easy addition, please try to make it into 1.x branch
Comment | File | Size | Author |
---|---|---|---|
#10 | FirstAndLast-1619784-10.patch | 4.14 KB | lonehorseend |
#6 | firstlastclasses-1619784-6089974.patch | 1.05 KB | moniuch |
#4 | firstlastclasses-1619784-6089974.patch | 1.17 KB | moniuch |
#2 | firstlastclasses-1619784-6089974.patch | 1.19 KB | moniuch |
Comments
Comment #1
moniuch CreditAttribution: moniuch commentedAs I'm not git-savvy enough, please accept my traditional "patch" that works for me. Hope you will not mind applying it to your code.
ds/modules/ds_extras/ds_extras.module
Inside the foreach loop at line 460 I changed the first IF labeled
// Field item wrapper.
Comment #2
moniuch CreditAttribution: moniuch commentedComment #3
SpleshkaPatch is OK but I have one notice:
Please, remove extra spaces from the patch. And please set issue status to Needs Review when providing a patch.
Comment #4
moniuch CreditAttribution: moniuch commentedThanks, Spleshka, slowly making my progress :)
Comment #5
SpleshkaAccording to Drupal coding standards - at the end of comment should be dot :) I'm not sure if it is required for this patch, but if you have free minute - please fix this.
Comment #6
moniuch CreditAttribution: moniuch commentedAs desired :)
Comment #7
swentel CreditAttribution: swentel commentedNeeds to go into second branch first - with configuration option (if that's not in yet, not sure). I'm a bit afraid I can't add this by default in the first branch as it might possibly break existing css configurations. To overcome this in the first branch you can create your own field template function though with the hook_ds_field_theme_functions_info() hook.
Comment #8
moniuch CreditAttribution: moniuch commentedIn 1.5 I haven't seen any configuration option for zebra classes, so I did not worry about making first/last classes configurable. Also, I thought it would be more intuitive that first-last classes go into the same place as zebra. Hence the patch.
I've been using this patch with no CSS problems. It's just additional classes that should don't break anything.
You changed the version of the issue, but I created the patch against 1.5 and I'm not likely to test 2.x-dev as I'm using only release versions for my productions sites. Therefore, if you are not going to use that patch, simply disregard and close that issue. No offense.
Thanks for the hook info though, might come in handy some day.
Comment #9
jmix CreditAttribution: jmix commentedHI ! i'm using 7.x-2.0 and just understood this patch was for 1x...
Is there a simple way to have first / last class with DS ?
Thanks !
Comment #10
lonehorseend CreditAttribution: lonehorseend commentedHere's a patch against the latest version of 7.2.x. It has the admin functionality so you can select or deselect on a field item basis. Remember to clear your cache before using.
Comment #11
aspilicious CreditAttribution: aspilicious commentedI'm considering this... Will ask frontend input at work.
Comment #13
bceyssensThanks for the patch lonehorseend
This has been committed