Global styles and scripts #744
-
Is there any reason CDNs that I add to the global sections in ui.php wouldn't load on every page load? If I manually add them to a view, they work fine. I am using the default Tabler theme. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Hello @ale1981 , can you please detail the problem, in which sections it loads and in which it does not? Did you clean the cache after making the change?
To handle it with basset, you can check instructions here If you have any other problem, please tell us and send the output of to have the full panorama
Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @jorgetwgroup thanks for your response. As an example, I have some fa icons in the menu and by adding the font awesome CSS file to the Global Styles section of the ui.php file, it doesn't work, the icons don't appear. If I add the CSS file manually using This doesn't work...
I have read the basset help, but doesn't explain how I would utilise basset from inside the ui.php file to add packages globally?
|
Beta Was this translation helpful? Give feedback.
-
Hello @ale1981 I find this way we load font awesome on Backpack using basset https://github.com/Laravel-Backpack/CRUD/blob/7e10acf5f60156964ebd25e8481f317826ea86e0/src/resources/views/ui/inc/styles.blade.php#L4 You can try to override and load your own package as you need. Cheers. |
Beta Was this translation helpful? Give feedback.
-
Great @ale1981 , i will close the issue, in any case, please feel free to re-open or create a new one if needed. Thanks. |
Beta Was this translation helpful? Give feedback.
Hey @ale1981 the reason why backpack is not picking your
styles
definition on theui.php
config file, is because tabler theme overwrites thatstyles
key, so you need to configure it on theme config file, that takes precedence over the ui file.If you haven't published tabler configuration yet, you can do it with:
php artisan vendor:publish --tag="theme-tabler-config"
that will publish to your application the tabler config file, where you can find : https://github.com/Laravel-Backpack/theme-tabler/blob/1afe83382194d776717804ca9ea4a1e82e398ccc/config/theme-tabler.php#L41 to add your styles.No need to overwrite files, I think @jorgetwgroup may have misunderstood what you wanted to achieve here.