MyBB Community Forums

Full Version: How to change css stylesheet version?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Look a bit about in templates... Headerinclude/header etc... Didn't see... Anyone know where to change?

Thank you very much.
You can look in the xml file, Upload\install\resources\mybb_theme.xml

The stylesheets and version numbers are listed there.
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?
You can export your theme, edit the xml file, and import it again. Otherwise you would have to edit the database contents directly.
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?
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.