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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

c31ck’s picture

Status: Active » Needs review
FileSize
2.28 KB

Patch that adds the $delta to the theme function and adds a more specific class.

jarune’s picture

Status: Needs review » Reviewed & tested by the community
jenlampton’s picture

Status: Reviewed & tested by the community » Needs work

I 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 :)

c31ck’s picture

Status: Needs work » Needs review

In 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.

jenlampton’s picture

Title: Add delta variable to theme_on_the_web_icon » Add more useful CSS classes to theme_on_the_web_icon
Status: Needs review » Needs work

Okay, 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.

jenlampton’s picture

Status: Needs work » Needs review
FileSize
2.41 KB

Something more like this.

jenlampton’s picture

minor bugfix, and a version for D6 too. Now committed. Thanks for your help on this :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.