June 24, 20215 yr Hi, I have a problem I don't understand. Tried to introduce my own css style code in the file "beesblogstyle.css" by copying it to my themes directory (<my-themes-name>/modules/beesblog/views/css). However, don't matter what I do, if I look at the source of the page it always uses : <link rel="stylesheet" href="/modules/beesblog/views/css/beesblogstyle.css" type="text/css" media="all" /> so, it won't use the theme directory. How can I solve that? I already disabled all css optimisations, caching and also cleared the cache (server and client side). Any help would be great! Or is the beesblog style sheets path somehow 'hard coded'? If not, where is it decided to use the one in the theme directory (I can't find that spot in the php or tpl code, but I'm also not an php/smarty expert). Edited June 24, 20215 yr by Dolfijn
June 24, 20215 yr Author I tried it but it still uses this link in the page: <link rel="stylesheet" href="/modules/beesblog/views/css/beesblogstyle.css" type="text/css" media="all" /> and ignores the file under "my-theme/css/modules/beesblog" (after clearing all caches) Its puzzling me.
June 24, 20215 yr Would it not be better to override the CSS by adding it to back office > preferences > custom code Or into some themes allow it. So in Panda theme I can add it in the theme configuration pages Putting the file on your server means it could get wiped next time you run a thirtybees update
June 25, 20215 yr Actually @yaniv14 already gave the solution. Just to make sure: The right path is this: /themes/your-theme/css/modules/beesblog/beesblogstyle.css If you are 100% sure, you have it there... Check if you are in a testfolder or if you use cloudflare it could be cached there... You could also try to call the url to the css file directly and see if the css code appears. 😉
June 25, 20215 yr Author I double checked it. I'm sure it is the right domain, right path, all performance optimization or off, cleared cache in BA and also in browser. But it renders the page with the link to the default css location, not the theme based one. I can fix it by putting my css code for the beesblog in the global.css. In this scenario I also made the change in a copy of global.css and have copied it to <my-theme>/css folder. So, why does it work with gobal.css in theme based folder but not when I use the css/beesblog folder? Therefore, I'm also curious how this works in the code. Anybody any idea where I should have a look in the code? Well, probably, I'm just doing something stupid. But, don't know what it is yet 🙂
June 25, 20215 yr Author Link to the default css file: https://www.gquipment.com/modules/beesblog/views/css/beesblogstyle.css Link to the <my-theme> copy: https://www.gquipment.com/themes/Gquipment-theme/css/modules/beesblog/beesblogstyle.css And what the source actual blog post files uses (in its head section) and where I see that it is still using the default file: <link rel="stylesheet" href="/modules/beesblog/views/css/beesblogstyle.css" type="text/css" media="all" />
June 25, 20215 yr Author I tried it: same result 😞 Can it not be that for the beesblog modules this construction of using theme related css is not implemented? Or is it some general construction that should always work? I'm not afraid to take a look at the code, just need a pointer where to start..
June 25, 20215 yr You can find the relevant code that deals with loading css/js under classes/controller/FrontController.php addMedia()
June 26, 20215 yr Author Solution Ok, I found it. The path for the BeesBlog module is a little different: it uses the format <my-theme>/css/modules/beesblog/views/css/beesblogstyle.css. So, my first attempt was close but not close enough. Thanks for showing the way. public function hookDisplayHeader() { $this->context->controller->addCSS($this->_path.'views/css/beesblogstyle.css', 'all'); }
Create an account or sign in to comment