MyBB Community Forums

Full Version: Inheritable Templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2016-03-18, 07:20 AM)andrewjs18 Wrote: [ -> ]pushing away people who might not be all that technical is a TERRIBLE idea.  hopefully the mybb dev team DOES NOT do this.
I absolutely agree with you. But a technical system, like the template system, that requires an at least a little bit technical admin to be used in a reasonable way should not be blown up with features that barely help a non skilled admin. An admin that is familiar with html and css can learn how to use a VCS within one or two times of using it. And the proposed feature in this thread does only a little to help a not technical admin using the template system. --> useless

(2016-03-18, 07:39 AM)Amaryllion Wrote: [ -> ]Yes. More important. Like getting facebook-likes. And avatars beside the forum titles. And two email adresses. And edit image sizes with a forums software. And implementing a communication center besides all the forums and posts. And restyling the member list.

More than half of these you could manage with plugins or simple template changes. I would think core features are features that cannot be managed with plugins.
And it would simply be a "fall back template system" that simply grabs default templates if it does not find a theme template. Similar how CSS is treated in MyBB.
And all this are core features for a modern forum software, MyBB absolutely needs them out of the box to compete with other forum software. Furthermore every admin profits from those features. A template inheritance ... how many admins are there that use the same theme more than one time with just a few changes? How many admins are there that do template edits every week and how many of them are left, when you have a good widget system? I just do not see this feature widely used ... Furthermore there is an easy workaround --> VCS.

You say it's just a fallback ... But that fallback means every template that is not in the changed template folder leads to two I/O operations - try to load them from template folder --> fails, load them from fallback (with more inheritance layers even more often). I/O is the thing that makes programs slow, so you would need a cache, that stores where to load the templates from --> lot of complexity ... for what? I just do not see it beeing useful for a great mass of admins and the ones that really could use it (theme designers), are familiar with html and css and could use tools like git or svn.
Regarding the earlier mentioned widget system, this is already a plan of mine that is yet to be implemented or even properly planned. In my mind, everything should be a widget, such as the "Who's online" list, the "Statistics" block, the forum listing, the recent topics list, the recent posts list, etc. All of these should be able to be modified and added/removed via the ACP without editing any template code.

One approach I'm considering is to introduce some kind of "template hook" system that can be used to inject code at specific locations in templates without editing the templates themselves - similarly to how plugin hooks work at the moment. Of course, the old method of editing templates will still exist, but template hooks would make changing themes, upgrading themes, etc. much easier.

Of course, none of this is implemented or even properly planned - it's just something I've been floating around in my head since I started work on 2.0. I can't even remember if I have an issue open for it on GitHub...
(2016-03-18, 11:57 AM)Euan T Wrote: [ -> ]Regarding the earlier mentioned widget system, this is already a plan of mine that is yet to be implemented or even properly planned. In my mind, everything should be a widget, such as the "Who's online" list, the "Statistics" block, the forum listing, the recent topics list, the recent posts list, etc. All of these should be able to be modified and added/removed via the ACP without editing any template code.

One approach I'm considering is to introduce some kind of "template hook" system that can be used to inject code at specific locations in templates without editing the templates themselves - similarly to how plugin hooks work at the moment. Of course, the old method of editing templates will still exist, but template hooks would make changing themes, upgrading themes, etc. much easier.

Of course, none of this is implemented or even properly planned - it's just something I've been floating around in my head since I started work on 2.0. I can't even remember if I have an issue open for it on GitHub...

the idea of widgets and simple configurations is very appealing.
So what is happening with the templates?
Why do we NOT have inheritable templates? they are purely revisions that you can roll back if you make a mistake

parent template
--daughter template inherits all templates but the modified ones

Same with CSS: parent css, and then you have page specific css

Widgets are purely inserted code, they are really like iframes and may help loading with delayed loadin of parts of page (lazy loading)
(2016-03-23, 10:20 AM)expat Wrote: [ -> ]So what is happening with the templates?
Why do we NOT have inheritable templates? they are purely revisions that you can roll back if you make a mistake

parent template
--daughter template inherits all templates but the modified ones

Same with CSS: parent css, and then you have page specific css

Widgets are purely inserted code, they are really like iframes and may help loading with delayed loadin of parts of page (lazy loading)

Nobody is saying that we won't. Just trying to work out the best implementation and what exactly is expected. Inheritable templates do not allow rollback - I think you're thinking of template revisions/history here.

We already have something resembling inheritance in 1.x, with most themes being child themes of the default MyBB theme. This will likely continue to be the case in 2.0.
(2016-03-23, 07:25 PM)Euan T Wrote: [ -> ]We already have something resembling inheritance in 1.x, with most themes being child themes of the default MyBB theme. This will likely continue to be the case in 2.0.

So if this inheritence is expanded to cover the templates in the same way CSS is treated, it would be the nicest and consequential thing to have. File based or not. Smile
Parent template/CSS/theme
--child 1 template/CSS/theme
-----child 3 template/CSS/theme
--child 2 template/CSS/theme

is revisioning.....because the only thing recorded is the template/CSS changes. ie if child 3 template breaks the theme, i roll it back to child 1 theme, quickly and efficiently

If the templates are NOT in DB how are they then exported?

whether the cache is read from file or not you would need to keep the templates in DB

Quote:A template inheritance ... how many admins are there that use the same theme more than one time with just a few changes? How many admins are there that do template edits every week and how many of them are left, when you have a good widget system? I just do not see this feature widely used ... Furthermore there is an easy workaround --> VCS.

Fallacy, I do this ALL the time from localhost....I make changes to the templates ALL the time, adding new features, where myBB doesnt offer.....eg. i can add multiple language typing for clients that need them....widgetising a weak template system

There needs to be a way to call one template into another as IPB does, the same way you call CSS into a template....THIS IS THE WEAKNESS OF THE MYBB 1.8X TEMPLATE SYSTEM...

ie. there is NO easy way to call a template into another template AND a way to combine templates into cache
2.0 supports including templates already. We use it in the standard theme heavily. Have you read the Twig documentation at all? I have a feeling a lot of your issues may be solved just by the template language Wink
Pages: 1 2