Block: Social links how to change from Fontawesome to Glyphicons

Permalink
Hello Concrete5 members,

I was curious if it was possible to change the "Social links" block from Fontawesome icons to Glyphicons icons.
Also I would like to know how I can exclude Fontawesome from my theme in the page_theme.php.

The code below doesn't work anymore.
public function registerAssets()
    {
        $this->requireAsset('css', 'font-awesome');
    }

nesoor
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi nesoor,

You might be able to do this by overriding:
- the services array
https://github.com/concrete5/concrete5/blob/develop/concrete/src/Sha...
- the getServiceIconHTML() method
https://github.com/concrete5/concrete5/blob/develop/concrete/src/Sha...

I did not check to see if these files can be overridden.

If they can be overridden, you would need to use the Glyphicons naming conventions. Also, it appears that Glyphicons comes in two forms: bitmap images and vector/font. This might likely affect the naming.

Because the social links are displayed in the dashboard, you would need Glyphicons to be available outside of the block. There are multiple ways to do this, here are two examples.
- register and require the asset using app.php, so that it is available in the front end and dashboard
// in application\bootstrap\app.php
use \Concrete\Core\Asset\AssetList;
use \Concrete\Core\Asset\Asset;
$al = AssetList::getInstance();
// registering this file:
// application\css\glyphicons.css
$al->register(
    'css', 'glyphicons', 'css/glyphicons.css',
    array(
        // 'version' => '1.0',
        // 'position' => Asset::ASSET_POSITION_HEADER,
        // 'minify' => false,
        // 'combine' => false
    )
);

- in a package on_start()
/ / packages\your_package_name\controller.php
// use \Concrete\Core\Asset\AssetList;
// use \Concrete\Core\Asset\Asset;
$al = AssetList::getInstance();
// registering this file:
// packages\your_package_name\css\glyphicons.css
$al->register(
    'css', 'glyphicons', 'css/glyphicons.css',
    array(
        // 'version' => '1.0',
        // 'position' => Asset::ASSET_POSITION_HEADER,
        // 'minify' => false,
        // 'combine' => false
    ),
    'your_package_name'

I don't believe you can exclude an asset from loading. You can choose not to require FontAwesome in your theme page_theme.php, but any block that requires FontAwesome will cause it to be loaded. If you go through the core blocks and other blocks you use and remove their FontAwesome asset requirement, it will not load
nesoor replied on at Permalink Reply
nesoor
Hey MrKDilkington,

Thank your for your reply !
That will be more work than I expected !

But its worth it :)