MyBB Community Forums

Full Version: is there a way to bypass the frontend and just work with flat files (css & templates)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I think it would be way more efficient for experienced css / html developers to be able to work with flat files.

Is there an option that allows to do this? For example I would check an option that makes the forum look for stylesheets and templates on the filesystem. When I'm done creating a theme, I could tell it to save it to the database.

I am really used to Vim, but there are plenty of text editors that front end developers are very proficient with, so editing my stylesheets and templates in the web frontend is very slow and inefficient for my workflow.

If that is not possible then I'm considering making a simple plugin that would map files in the filesystem and flat out replace them in a theme so I can click a button to test my theme, while I work with files... I'd just like to know if it's already in there before I spend hours on thisĀ  Blush

Actually if you know what you are doing... it's possible to turn off Stylesheet Minification and work with the cached stylesheets... Obviously you have to make sure not to edit them in the Admin. Once in a while, selet all > copy > and paste it into the Admin so you don't risk losing too many changes. Still rather cumbersome.
You can use this tutorial http://community.mybb.com/thread-144390.html to get / edit / save mybb templates in sublime text editor (version 3).
Thank you very much!

I don't use this text editor, but the updatecss.php code is very helpful. Sounds like a great method to do it, if I understand correctly he's checking timestamp from a given folder of flat files, and then replacing the content in the database if the file has been modified.



UPDATE

Here is a solution for easier editing of the stylesheets in MyBB 1.8.x , with your text editor of choice.

https://gist.github.com/fabd/6d0955861e65779f1b4d

This lets you edit *.css files in a theme/ folder (configurable, just edit the constants in the script).

Remember to add the rewrite rule to the htaccess file, as described in the php comments at top of file.

This should not be deployed on your live site, I suggest to store in a branch in git. If you don't use GIT just make sure when you deploy to prod and you copied the css files back into the admin via Styles & Templates, to deploy the _original_ css.php file to the server (at which point it will rely on the cache or database as usual).