Solved badges: Difference between icon and image, precedence changed in 2.0.0beta10

badge

(Michael Friedrich) #1

Hi,

I’m using custom badges for this nifty plugin, and since I couldn’t really figure out how to set icon images for the badge, I’ve just copied the fa-check-square-o string into both fields, icon and image.

This has worked ever since up until beta10 changed the order somehow, and prefers the image class over the fontawesome class resulting in a broken image.

This isn’t a bug, still it took me a while to figure out what I did wrong. I’ve compared the HTML sources here on meta, and mine which led me to the conclusion that img src for fa-check-square-o cannot be correct.

1906

If anyone else has fallen into this, just ensure to configure only one icon field - fontawesome icon, or the image URL.
This isn’t clearly visible in the badge editor, don’t know though how to change this into an “OR” for the admin. The subtitle text which is a copy suggests to fill in a value into each field, also because “font awesome class” does not match with “icon”. The help text should maybe be corrected then.

Cheers,
Michael


(Joshua Rosenfeld) #2

The help text has already been changed, about a day ago by @Johani. It now correctly explains what to add to each field. If both fields are filled, the image URL takes precedence.


(Michael Friedrich) #3

Oh, thanks for the fast heads-up, now I see it :slight_smile: Maybe add the detail with “image URL takes precedencen” somehow to the help text too.


(Vaping Community) #4

Why not use Icon / Image field instead?

What does the image field do that the Icon one doesn’t?


(Joe) #5

Yeah, that’s a good idea. Added via:


The icon field adds an <i> tag with the classname you selected. The image field adds an <img> tag with the src set to the value you enter.


(Vaping Community) #6

The Icon field takes an image URL as well…


(Joe) #7

Yes, but the icon field is validated against Font Awesome classes. So, if you add a URL there, it would be stripped out.