Dashboard icons not working after updating to Font Awesome 5.0.6
PermalinkI have ensured that the following code is in my themes/page_theme.php file:
$this->requireAsset('css', 'font-awesome');
The problem is, the Concrete5 dashboard is still calling upon the old Font Awesome icon code:
(such as the old)
<i class="fa fa-pencil"></i>
(instead of the new)
<i class="fas fa-pencil"></i>
My questions is, which files can I edit in order to get the dashboard to call upon the new Font Awesome installation? Thank you in advance.
There are multiple approaches to conditionally loading assets.
Here is one you can try.
- in your theme page_theme.php registerAssets() method
$currentPage = \Page::getCurrentPage(); $currentPagePermissions = new \Permissions($currentPage); $user = new \User; if ($currentPagePermissions->canViewToolbar() || $user->isLoggedIn()) { // concrete5 loads its internal copy of Font Awesome $this->requireAsset('css', 'font-awesome'); } else { // you provide a copy of Font Awesome with your theme $this->providesAsset('css', 'font-awesome'); }
In your theme package controller, you can register your Font Awesome asset.You will likely need to change your Font Awesome CSS @font-face src path.
"Registering an asset in a package."
https://documentation.concrete5.org/developers/assets/registering-an...
If you are encountering conflicts with the concrete5 UI, then I would try conditionally loading the Font Awesome 5 assets and the shim.
https://www.concrete5.org/community/forums/customizing_c5/dashboard-...
I don't believe concrete5 supports the new version of Font Awesome. To support it, a lot of code would have to be changed.
One option would be to require the core version of Font Awesome while logged in and the new version when logged out.