MyBB Community Forums
How to change css stylesheet version? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: How to change css stylesheet version? (/thread-195622.html)



How to change css stylesheet version? - DrXotick - 2016-07-13

Look a bit about in templates... Headerinclude/header etc... Didn't see... Anyone know where to change?

Thank you very much.


RE: How to change css stylesheet version? - Ashley1 - 2016-07-13

You can look in the xml file, Upload\install\resources\mybb_theme.xml

The stylesheets and version numbers are listed there.


RE: How to change css stylesheet version? - DrXotick - 2016-07-27

Thanks Ashley... You mean there's no way to change stylesheet / css version in templates or otherwise in ACP?

I need to change the css version in the active template/theme in an already installed forum from time to time when I make changes to css. Not in the install directory. Surely there's some way to do this?


RE: How to change css stylesheet version? - Ashley1 - 2016-07-27

You can export your theme, edit the xml file, and import it again. Otherwise you would have to edit the database contents directly.


RE: How to change css stylesheet version? - DrXotick - 2016-08-10

Would you by chance know the command to edit css version database?

 I find this highly bizarre. CSS edits are common I think, why is there no easy way to change the version so browsers will load the new CSS?


RE: How to change css stylesheet version? - ILUXA - 2020-05-13

This is how I managed to solve this issue, solution is a little bit quirky, but should work fine.
Also it adds a possibility to edit your global.css on server side via your favorite editor.

1. Open your theme in ACP and use "Edit theme" in front of your theme name.
2. It'll open "Edit stylesheets", select global.css with "Properties" option.
3. Select "Attached to" with "Specific file".
4. As specific file name use "nonexistent.file".
5. ???
6. Profit.

Now you can copy global.css from /cache/themes/yourtheme/global.css to your server www dir - /global.css and then add a reference to this file to your headerinclude template, anyway, global.css should be attached to all pages, (better place it before "{$stylesheets}" line) —
<link type="text/css" rel="stylesheet" href="{$mybb->asset_url}/global.css?ver=0666" />
And now you're able to change this css file versions in headerinclude template. It's really missing feature in MyBB, because if you're a cloudlfare user, this feature should be available, at least for main css file. And in this case - "$stylesheets" feature (and in many others, like "template editor" notepad.exe "feature"...) MyBB isn't helping to user, more over, its functionality harms and interferes, when compared with more traditional forum CMS-s.