MyBB Community Forums

Full Version: Theme directory restructure
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently the structure is like so:

forum/
|--->images/

Now that causes several problems, one your images folder becomes huge and cluttered and often times it confuses end users where things go and to believe a theme is broke because they uploaded wrongly thus creating more support request time.


Now, for years myself and other themers have used a theme directory in forum root as it makes more sense and keeps the core image directory clean

forum/
|--->theme/


forum/
|--->theme/
|--------->themename/
|------------------>images/

* other bbs softwares also use similar concept

Many times over the years, I myself and others have mentioned that this makes more sense and should be by default.

forum/
|--->theme/
|--------->default/
|---------------->images/

* often times custom themes include non image based files and adding them to the images directory or root and not to a theme specific folder does not seem logical not to mention makes for a sometimes confusing mess.


forum/
|--->theme/
|--------->themename/
|------------------>images/
|------------------>inc/


Since there is already a focus on revamping the theme/template system, perhaps this uniform concept could be considered and improved upon? Perhaps even to the extent of auto create new custom theme directory on theme creation perhaps and eventually to theme zip pkg import and export?
I'd endorse this. I can see it being useful for people with multiple themes.
(2018-10-06, 07:34 PM)vintagedaddyo Wrote: [ -> ]Currently the structure is like so:

-- SNIP --


Since there is already a focus on revamping the theme/template system, perhaps this uniform concept could be considered and improved upon? Perhaps even to the extent of auto create new custom theme directory on theme creation perhaps and eventually to theme zip pkg import and export?

Yes, I agree with this recommendation.

Also, in the original MyBB installation, there are 2 /inc folders, one at the 'root' and the other inside the /admin.

I propose to rename the /inc inside the admin to /inc-admin to prevent confusion among users when they are uploading plugins and often will place files that are in the /inc, of the plugin, into the incorrect folder because of the identical folder names.

Same goes for the jscripts folder. /jscripts in the 'root', then /jscripts-admin in the /admin folder.
We're already planning some big changes for the theme system in 1.9, which is the next job on my list. The current plan is something like the below:

themes/
    theme_name/
        sass/
            sass_source_files.scss
        css/
            loaded_style.css
        images/
            theme_specific_image.png
        js/
            theme_specific_js.js
        views/
            all_theme_views.twig
        theme.json

Every theme would have some kind of manifest ("theme.json" above) that describes the name of the theme, the author, description, URL, etc.

We've been considering using a "composer.json" as the theme manifest file, then themes could be installed as composer packages, and that way they could be downloaded/installed/updated using the composer CLI and automatically through the ACP (in the future).

I've also been considering allowing themes to ship with PHP service providers that can register hooks and such.

None of this is final, and we've been discussing some options about the structure - for example, there might be a good argument for putting the raw sass somewhere inside "inc/" or something so that access to it can be prevented from the web (to prevent people accessing and copying the sass, which would make ripping themes much easier).