Font Awesome Manager

Font Awesome Manager 1.2.7

No permission to download
That only potentially works on that specific use case though, and even in that case it wouldn't update when new builds are made because the files generated by this add-on are inserted into the same directory as the XF default fontawesome icons, so if I symlinked all of that and XF updates FontAwesome the deployment process would overwrite that with the old versions in the copy of it from the NFS share.
Why?
The delopyment process just needs to take care of that symlink and follow it when writing files (instead of replacing it with the directory from XF ZIP).

Even if they were split into a separate directory that's not of as much use for environments running off of Docker images which have no sort of persistent filesystem and relies entirely on S3 for the data and internal_data filesystems and has an NFS share mounted for code_cache with a config.php edit pointing at it
I don't understand the problem here either :)
If there is at least one writable persistent storage that can be accessed via OS filesystem (and even if that is only for code-cache), this could be used with some configuration changes (symlinks, etc.).

As already pointed out, I'll add an option to use Flysystem - I just won't make it the default as I see more cons than pros to do that.
 
Just te4sting this, looks good so far.

A couple of questions though:

If I reference a specific icon in an addon (e.g. Top Navigation) do I need to add that icon to the list of icons in options or is it detected?

e.g. this one (fa-trophy)

Screenshot 2021-07-07 at 12.34.51.png
Screenshot 2021-07-07 at 12.36.38.webp

Also anything I have added in extra.LESS using Unicode ?

Code:
.block.block--category.block--category4 .block-header:before {
    
    .m-faBase();
    content: '\f79f';
    float: left;
    padding-right: 5px;
}
 
If I reference a specific icon in an addon (e.g. Top Navigation) do I need to add that icon to the list of icons in options or is it detected?

e.g. this one (fa-trophy)
Depends on how the Addon (that enables you to use FA icons in navigation, this is not a standard feature) does work:
Does it just use the entered class and do you use Solid as the font awesome weight for your style?
If so, it should be picked up automaticallyif you have added the entity field that contains the icon reference to the list of additional entities.
If either condiition is not true you would have to add the icon(s) to the appropriate icon list manually.

Version 1.3.0 (which is still a bit of work to get there) will add support for 3rd party Add-ons to add their own locations so manually adding entitiy fields can be avoided (if 3rd party Add-ons do provide the necessary data).

Also anything I have added in extra.LESS using Unicode ?

Code:
.block.block--category.block--category4 .block-header:before {
 
    .m-faBase();
    content: '\f79f';
    float: left;
    padding-right: 5px;
}
This definition should be picked up automatically as m-faBase() without parameters does use the selected font awesome weight.
 
Last edited:
Do you use Solid as the font awesome weight for your style?
If so, it should be picked up automatically - if not you would have to add it to the list of Solid icons (or change the class to use the icon in your selected weight).
Not using solid as FA weight.

So the fa-trophy displays as regular (which is what I want), do I therefore need to define it in the addon options as far fa-trophy instead of just fa-trophy? (Sorry if this is obvious, maybe I need an idiot's guide:))
 
Not using solid as FA weight.

So the fa-trophy displays as regular (which is what I want), do I therefore need to define it in the addon options as far fa-trophy instead of just fa-trophy? (Sorry if this is obvious, maybe I need an idiot's guide:))
If the icon is being used in regular and regular is your FA weight, the icon needs to go (implicitly) into list Icons als trophy by one of those options:

  1. Being detected automatically (unlikely if the information is stored in a entity field added by a 3rd party Add-on and you did not add this field to the list of additional entities)
  2. Aadding it manually
  3. Detection of a missing icon (if enabled)
 
If the icon is being used in regular and regular is your FA weight, the icon needs to go (implicitly) into list Icons als trophy by one of those options:

Thanks.

If in doubt, is it best to just put any icon I'm using outside of stock xenforo into one of those lists?

Or is there a way to know (and test) if something has actually been automatically detected by the addon?
 
If in doubt, is it best to just put any icon I'm using outside of stock xenforo into one of those lists?
No, you should only add missing icons to the appropriate list - otherwise the subsets will be larger than necessary.

Or is there a way to know (and test) if something has actually been automatically detected by the addon?
Yes. Set log level to Debug, run a rebuild manually and check the log afterwards.
 
How does this add-on even work? Will I have to set anything else after installation?
 
Last edited:
How does this add-on even work? I have installed it and there are no changes to the test speed results.
If your website is https://gtaforums.eu/, it does work just fine.
However, your site isn't optimized well and this Add-on isn't a silver bullet to fix everything - you need a proper setup :)

I'd start with basic things like
  • Properly setting up CF caching /this currently isn't the case)
  • Probably change jQuery host
  • Turn off the editor for guets (I don't know where it is being used, might be the Shoutbox for which guests do hov have permission anyway)
  • It seems liek you also use Material Design icons from Google Fonts, try to host that locally
  • It seems like you use three fonts (Asap, Roboto and Krona One) from Google Fonts, you might want to reconsinder if that's worth it and stick with system fonts like stock XenForo
 
Last edited:
It seems like you use three ftonts (Asap, Roboto and Krone One) from Google Fonts, you might want to reconsinder if that's worth it and stick with system fonts like stock XenForo
Yes, it's worth it. I didn't expect a lot of improvement in the speed tests, but this add-on did virtually nothing with the mobile test
 
Yes, it's worth it. I didn't expect a lot of improvement in the speed tests, but this add-on did virtually nothing with the mobile test
Well, as I said - you can't expect miracles if the base performance is too bad.

Is there a way to turn off Material Icons? I only use Font Awesome.
Maybes yes, maybe no - I don't know your site.
You'd have to find that out by yourself - or ask those that did the theming/design.
 
Ok, I'll check it out. Do you have any plans to create a Cloudflare add-on that would allow for a better configuration?
I have no idea what you are talking about?

As pointed out, your performance problems are
  • the fonts
  • JS bloat.
  • suboptimal caching
  • "giant", redundant images loaded from 3rd party sites (like the logo from imgur - this loads two files totaling > 200 KB on mobile ... for a logo, honestly?)
    Or 380 KB for the background image which is also loaded from imgur, is not even visible on mobile and requires JS to load :eek:

Fix this and the speed ratings will improve significantly.
 
Last edited:
updating a style

ErrorException: [E_WARNING] preg_match_all() expects parameter 2 to be string, array given in src/addons/Kirby/FontAwesomeManager/Helper.php at line 427
  1. XF::handlePhpError()
  2. preg_match_all() in src/addons/Kirby/FontAwesomeManager/Helper.php at line 427
  3. Kirby\FontAwesomeManager\Helper::getMatches() in src/addons/Kirby/FontAwesomeManager/Listener.php at line 318
  4. Kirby\FontAwesomeManager\Listener::Kirby\FontAwesomeManager\{closure}()
  5. call_user_func_array() in src/XF/Extension.php at line 50
  6. XF\Extension->fire() in src/XF.php at line 954
  7. XF::fire() in src/XF/Mvc/Entity/Entity.php at line 1272
  8. XF\Mvc\Entity\Entity->save() in src/XF/Service/Style/Import.php at line 365
  9. XF\Service\Style\Import->importProperties() in src/XF/Service/Style/Import.php at line 163
  10. XF\Service\Style\Import->importFromXml() in src/addons/Kirby/FontAwesomeManager/XF/Service/Style/Import.php at line 17
  11. Kirby\FontAwesomeManager\XF\Service\Style\Import->importFromXml() in src/XF/Admin/Controller/Style.php at line 434
  12. XF\Admin\Controller\Style->actionImport() in src/XF/Mvc/Dispatcher.php at line 350
  13. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  14. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  15. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  16. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2344
  17. XF\App->run() in src/XF.php at line 512
  18. XF::runApp() in admin.php at line 13
 
Are you 100% sure you are using the latest version (1.2.0 RC 2)?
This was an issue until 1.2.0 Beta 6 but should be fixed since.
 
Top Bottom