extend Social Links (missing icons for bandcamp, email)

Permalink
Using 5.7.3.

I want to use the Social Links block, but I also need icons for "bandcamp" and "email" (opens mailto: link).

The bandcamp service is missing, and after further investigation, it is also missing from font-awesome which is used by concrete 5.7.
Adding services is impossible without modifying core files (Sharing/SocialNetwork/ServiceList) since the list of services is hardcoded as an array. Would have been nice if this list was in the database, so I could extend it easily ;)

Also, getServiceIconHTML(), which is in the core (Service), returns html for the icon based on font-awesome. But I was actually thinking about using icomoon font or even svg...

Probably going to semi-hardcode the social icons in my site now (maybe I'll override the Social Links block)... any other suggestions?

View Replies:
mjsminkey replied on at Permalink Reply
I was actually SHOCKED myself when I was going to use this list only to find it didn't include one of the most popular sites that people use in conjunction with a personal website and that is Etsy. Not sure why it wasn't included, but like you, I'm not interested in trying to modify core files so will have to do all the social links another way.
mjsminkey replied on at Permalink Reply
I was actually SHOCKED myself when I was going to use this list only to find it didn't include one of the most popular sites that people use in conjunction with a personal website and that is Etsy. Not sure why it wasn't included, but like you, I'm not interested in trying to modify core files so will have to do all the social links another way.
razorcommerce replied on at Permalink Reply
razorcommerce
I was shocked that the C5 core has social links. I can't think of any other CMS that ships a feature like this. I think they deserve some credit for that, instead of complaints about the comprehensiveness of services and how they are structured.

Sure of course in WP or Drupal you can add a module or plugin to provide this, and maybe then you expect it to be perfect. I'm sure C5 will be the same, somebody will develop a "Better Social Links" addon that is extendable or has more items or whatever. For now I'm impressed that they thought of this and decided to make something core that probably fits 95% of use cases. If you're in the other 5% (what on earth is BandCamp!?) then start coding or pledge some money for an addon.

There probably is a way to extend the existing list... even if it doesn't use a DB table... it's in an array you mention, but is there a way to get that array?
andrew replied on at Permalink Reply
andrew
This would be a useful addition:https://github.com/concrete5/concrete5-5.7.0/issues/2420.... The only reason it isn't this way right now is because we are supporting the services that have a corresponding icon in font awesome, since that was the easiest way. We'd be open to adding support for other services if the icons could work in a complimentary way and could match the font awesome style/icon approach.
memedia replied on at Permalink Reply
Bit late to the party but I thought I would add my 2 cents.

I decided to extend this so that the class name was all that came out of the block (instead of the complete fontawesome html) so that I could choose to use the stacked fontawesome html etc.

First you need to extend the SocialNetwork class from the core - found at concrete/src/Sharing/SocialNetwork - extend all files this to your application folder, making sure to update the namespacing, including where other classes are used. To add more icons, put them in the array in ServiceList.php - just be sure to check that you are using a corresponding class from fontawesome.

Then extend the dashboard page, so that you will see any additional icons you add to ServiceList.php - this is found at concrete/controllers/single_page/dashboard/system/basics/social.php - again be sure to modify namespacing.

Next extend the block - updating namespacing and also the namespacing where you are using the classes you extended above. This is because controller.php calls all the core classes we have already modified.

If you're not already comfortable with extending the core then that might be over your head - but the above works and is the correct way to modify the core so that it's safe for updates.

Andrew
wessamzaghloul replied on at Permalink Reply
I have tried this method, I copied src folder from concrete to application with Sharing folder inside and containing SocialNetwork folder and changed paths in the files Link.php, Service.php and ServiceList.php. also copied the controller path and changed namespace to refer to application
namespace Application\Controller\SinglePage\Dashboard\System\Basics;

use \Concrete\Core\Page\Controller\DashboardPageController;
use Application\src\Sharing\SocialNetwork\Link;
use Application\src\Sharing\SocialNetwork\ServiceList;
use Application\src\Sharing\SocialNetwork\Service;
use Core;
it showed the changes I made to the list and I added the new social links but when I add the block I get this error "Call to a member function getName() on null ", do you have any idea why ?, thank you so much this method looks wonderful
TMDesigns replied on at Permalink Reply
TMDesigns
Another quick way is pick an icon or social service you might not use and then change the icon on in you CSS.

.fa-github-square:before{content:"\f194"}


git hub is now vimeo
MrKDilkington replied on at Permalink Reply
MrKDilkington
@TMDesigns

The following tutorial describes adding new social links using a config file. I believe this approach is simpler and less error prone than approaches described in this thread.
http://documentation.concrete5.org/tutorials/add-new-links-to-the-s...