I’ve added an icon to my component and set a default Font Awesome regular icon.
Whenever I use this icon I’ll see the default, but in the front-end Font Awesome isn’t actually loaded. It’s not until I actually set the icon instead of relying on the default that it is loaded.
I’ve tried to replicate it, but I couldn’t. If I connect a property to the Icon control, and set a default one, it will render.
What do you mean by “Font Awesome” is not actually loaded?
What I mean when I say Font Awesome isn’t being loaded is the fact that I don’t see the script loaded in my network tab. When it is working I can see the CSS file (themes/bricks/assets/css/libs/font-awesome-6.min.css) actually being loaded.
Now, I’ve done some more digging and just noticed I failed to realize that I’m loading my component inside of a template. The template is being included in my page using the “Template” element in the builder.
As soon as I use that same structure directly, so not using a template element, it does work. Hope that helps you reproduce this issue!
thank you for this. By creating a component inside a template, and then using the template on the page, I was able to reproduce the issue and I’ve added it to our local bug tracker.
So, you can replicate it by creating a component with the icon, then choosing some default icon there (like Font Awesome regular), and you use this component on the page.
yep, I can confirm that if I don’t use icon, font-awesome styles are not loaded. As soon as I add an icon element inside the component, styles are there.
And because you could not replicate it on Bricks playground, I would say there is some issue with your local install.
I’m not sure how I could check it though, as it’s local.
yeah, so it looks like there is a way to replicate it. I would prefer to check it on a Bricks Playground or your staging website rather than have you send me a remote copy.
I’ll inspect the codebase a bit though, but it’s hard(er) without being able to replicate it. Must have been some edge case.
Oook, so got the assets.php file to output of the $bricks_settings_string right before icons sets loaders are checked.
ThenI dug the serialized values for the component from wp_options and the very same un-component-ified item from the wp_posts post_content
Searching for the two element ids only tracks back to the one in the page content, so $bricks_settings_string would fail the match for the themify icon set if only the component was left there.
For some reason the component is not loaded before the check. I guess I’ll have to check the get_component_instance calls…
Aside from this… it’s weird you can force it to load it by adding the font family to a dummy element in the theme styles section but not via the bricks core settings custom CSS field.