Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello Mihai,
great idea for a social link field. Was about to write my own, when I found yours.
One thing though that I would like to remove is the dependency on Fontello fonts. There are so many font libraries out there and it's a unnecessary to load a font library just for the backend.
How about instead of rendering the Fontello icon on the edit form, you simply display the service name (e.g. Facebook, Twitter, etc.)?
If you are ok with this improvement, I can create a patch for you.
Thanks,
Johannes
Comments
Comment #1
jlyon CreditAttribution: jlyon commentedOne way around this I'm using: Just update the 'socialfield_services' variable. This code adds support for Fontawesome, provided the FontAwesome CSS file is included. I'm doing it in a hook_install, but it could be done wherever.
Comment #2
johannez CreditAttribution: johannez commentedHi Jeff,
thank you for the response and the code sample. My suggestion wasn't about replacing the Fontello (nothing wrong with it :) ) with Fontawesome.
I simply don't think it's a good idea to request any font library for the backend. I feel out of the box (without any library download), you should be able to use the field and just see text placeholders for the services. Once, you install a library, it'll be replaced by the proper icon.
I'll send you a patch with what I mean.
Happy Friday,
Johannes
Comment #3
k_zoltan CreditAttribution: k_zoltan commentedHi @johannez thank for filing this issue.
We should try to find a general solution that supports multiple font libraries.
We are working on a tight schedule but if you provide a patch we will happily review and include in the project.
Comment #4
Mihai Husar CreditAttribution: Mihai Husar commentedIt can be done, but in my opinion it will be ugly to display only text instead of icons. You are not dependent on Fontello library. The module settings comes by default for the Fontello library, but this can be changed easily. That is why I built for this module a configuration page where you can change the icon class used for any service. For this go to admin/config/media/socialfield. So if you want to use other library than Fontello just simply change the icon classes for the services (assuming that the library you want to use is loaded on your site).
Comment #5
jenlamptonIf you want to use fontello, you can use the provided submodule.
If you don't want to use fontello, you can add your own classes via the UI at admin/config/media/socialfield, or by modifying the
socialfield_services
variable, as recommended in #1.I'm going to close this issue, since I think the feature you are requesting already exists :)