Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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

Solved by Dolfijn

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

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

  • 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 🙂

  • 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" />
  • 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..

You can find the relevant code that deals with loading css/js under 

classes/controller/FrontController.php

addMedia()

 

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.