Jump to content
thirty bees forum
  • 0

Custom change in theme/../views/css not working for beesblog


Dolfijn

Question

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 by Dolfijn
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

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');
    }

 

  • Like 1
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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. 😉 

Link to comment
Share on other sites

  • 0

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 🙂

Link to comment
Share on other sites

  • 0

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" />
Link to comment
Share on other sites

  • 0

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..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...