I installed the bootstrap module using composer/bower into the vendor into the "vendor/bower-asset" folder of my plugin. I defined the js and css files in my views.php file like this:
'default' => [ 'bootstrap.js' => __DIR__ . '/vendor/bower-asset/bootstrap/dist/js/bootstrap.min.js', 'bootstrap.css' => __DIR__ . '/vendor/bower-asset/bootstrap/dist/css/bootstrap.min.css',
Bootstrap loads fine. All other files load fine. However, I keep getting a 403 errors when the css tries to load the glyphicon font pack despite them being present in the views developer tools page in the admin panel.
After some research I realized it was because the fonts were defined in the bootstrap.css file using a relative link like this: "
'../fonts/glyphicons-halflings-regular.woff2'
So when the engine tried to get the file, instead of trying to access "http://192.168.33.10/cache/0/default/fonts/glyphicons-halflings-regular.woff2" it was going to "http://192.168.33.10/cache/0/fonts/glyphicons-halflings-regular.woff2", without the default.
I currently have a workaround where I redefine the font in my own css using the correct path without the "../" and so far so good.
Is there a better way to do this without editing the bootstrap.css file? Or am I loading the module incorrectly?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.