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.
The function theme_on_the_web_icon wraps all icons in a span with class "on-the-web". It would be nice if we could identify each element with a more specific class, such as on-the-web-0 for the first icon. To achieve this, theme_on_the_web icon needs a $delta variable passed to it.
Comment | File | Size | Author |
---|---|---|---|
#7 | on_the_web-add_more_css_classes-1815088-6.patch | 2.47 KB | jenlampton |
#7 | on_the_web-add_more_css_classes-1815088-6-D6.patch | 3.15 KB | jenlampton |
#6 | on_the_web-add_more_css_classes-1815088-5.patch | 2.41 KB | jenlampton |
#1 | add-delta-to-theme-on-the-web-icon.patch | 2.28 KB | c31ck |
Comments
Comment #1
c31ck CreditAttribution: c31ck commentedPatch that adds the $delta to the theme function and adds a more specific class.
Comment #2
jarune CreditAttribution: jarune commentedComment #3
jenlamptonI don't think the delta is necessary, can't we just use the service to identify which one is which? I could see adding a first and last, as well as service. But is knowing which is 3 important? Let me know if I'm wrong here :)
Comment #4
c31ck CreditAttribution: c31ck commentedIn my use case, knowing which is 3 was important :). I needed to apply some specific CSS to the third element in a row. I could have used the service name to identify that element, but if the order of the services changes then my CSS would no longer apply to the third element.
Apart from that, adding the service name too would be a nice addition.
Comment #5
jenlamptonOkay, let's do both. But since we're now getting very Drupalish by adding all these crazy classes, let's create a $classes variable and pass that in, instead of just the delta.
Comment #6
jenlamptonSomething more like this.
Comment #7
jenlamptonminor bugfix, and a version for D6 too. Now committed. Thanks for your help on this :)