MyBB Community Forums

Full Version: The 1.9 theme and template system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
A living document outlining the new system's architecture and design choices is available at https://github.com/mybb/meta/blob/main/a...-system.md.

It describes our long-term plans that may go beyond MyBB 1.9, and thus not all elements are expected to be implemented in the near future.

As usual, we invite public comments and suggestions.
my opinion hasn't changed https://community.mybb.com/thread-232217...pid1366765
I think the ideas are brilliant... but this is actually holding back the development of 1.9. Should defer to 1.10.

keep the current template system (hierarchy) and save template (twig) in database in 1.9...

the changes theme and template system ideas Should defer to 1.10.
(2022-05-05, 03:36 AM)martec Wrote: [ -> ]my opinion hasn't changed https://community.mybb.com/thread-232217...pid1366765
I think the ideas are brilliant... but this is actually holding back the development of 1.9. Should defer to 1.10.

keep the current template system (hierarchy) and save template (twig) in database in 1.9...

the changes theme and template system ideas Should defer to 1.10.

I spoke with DS on the discord. Unfortunately... Twig doesn't support DB loading outta the box.
(2022-05-06, 10:23 PM)Raion Wrote: [ -> ]
(2022-05-05, 03:36 AM)martec Wrote: [ -> ]my opinion hasn't changed https://community.mybb.com/thread-232217...pid1366765
I think the ideas are brilliant... but this is actually holding back the development of 1.9. Should defer to 1.10.

keep the current template system (hierarchy) and save template (twig) in database in 1.9...

the changes theme and template system ideas Should defer to 1.10.

I spoke with DS on the discord. Unfortunately... Twig doesn't support DB loading outta the box.

thanks for checking...
anyway, I still think that the work of creating a function to load from the database that there is already an example on the Twig website would take much less time than they are wanting to implement...

https://twig.symfony.com/doc/3.x/recipes...-templates
I already had success in loading from database. I will improve the codes a little and show modification that i done over the weekend.
I did this out of curiosity, I'm not going to require mybb to make a change in that sense, but actually using a database and reusing the hierarchy system and templates requires much less effort.
Sounds good! I look forward to some way to expedite this and get us on there. I've been hindered as I refuse to use Github, and the staff seem not so interested in pushing my modifications themselves.
Here are some thoughts on all of this.

There are, it seems to me, basically three channels of energy in the 1.9 theme system evolution at this point.

First, there is @martec's very respectable view that time is of the essence, and that storing the new Twig templates in the database rather than the filesystem, and leveraging existing eval-based code but making minor changes for Twig, would lead to minimal changes and a faster release date for MyBB 1.9. As I wrote to @martec privately some time back (I hope you got that message, @martec!), this is a correct view, however, since (as best I can tell) the majority of the long-term community prefers that themes (and especially Twig templates) are ultimately stored in the filesystem rather than in the database, this would require us to take one approach (DB-based) and then later switch to the other (filesystem-based), which, in my view, would both confuse users as well as waste (scarce) developer resources - better is to implement the ultimate approach first and for all.

Second, there is the approach strictly outlined in the document, linked to above by @Devilshakerz, which he (@Devilshakerz) has, with input from others, very carefully put together, and which @martec seems to agree has some very powerful ideas in it.

Third, there is the approach I'm taking which is deeply based in that document, except that it prefers a "Processing" approach over the preference in the document itself: the "Cold Duplicate" approach. My "Processing" approach ensures that the MyBB system is aware of all installations and updates of plugins and themes, so that it can archive old versions of the plugin or theme's themelets before installing the new version, as well as update any metadata as necessary. It provides dual themelet subdirectories: devdist for development and distribution, as well as current, for currently-installed version. The "Cold Duplicate" approach of the document in contrast relies on filesystem monitoring to synchronise the current version of a themelet with its archived version. I have a rationale for preferring the "Processing" approach, which I'm happy to share, but suffice it to say that I have made a *start* on implementing it (otherwise respecting the document which @Devilshakerz has put together, which I otherwise see no need to diverge from). That start is in this branch on my GitHub fork of MyBB:

https://github.com/lairdshaw/mybb/commit...eme-system

The fact that there are three channels of energy on this topic is both relieving (the dream of MyBB 1.9 is alive and well!) as well as worrisome (we have limited development resources; splitting them in three is suboptimal).

In any case, that's how I see things right now. Thoughts, comments, questions, and criticism welcome.
(2022-05-12, 12:22 AM)Raion Wrote: [ -> ]I've been hindered as I refuse to use Github, and the staff seem not so interested in pushing my modifications themselves.

It's nothing personal - development in general is kind of moving at a slow pace right now. We need a bit of invigoration. Hopefully that happens bit by bit given the background in which there is a lot of value and commitment tied up in the MyBB codebase, which folks choose to capitalise on.
As promised the changes I made to load database templates.

https://github.com/martec/mybb/commit/26...ed1c96bbbf

My programming skills are pretty bad and it was pretty much done by trial and error.
Of course, I don't even intend to do PR with that level of code quality.

The intention is just to demonstrate that yes it is much less work to reuse the mybb 1.8 hierarchy and template system

With the changes I demonstrated above, I confirmed that the following functions work:

- Edit and create template on ACP
- Duplicate and export theme
- hierarchy system etc...

Well I did just out of curiosity so take this just as a suggestion.
Thanks, @martec. I had a look over your changes but haven't downloaded and tested them. You've put a lot of good work in, and you motivated me to make some further progress on my own branch:

https://github.com/lairdshaw/mybb/commit...8f3a151ff7

My sentiments: there's a lot more work for me (and anybody else who wants to collaborate) to do to get my branch fully functional. It's worth doing, but if I falter and nobody else steps up, we should definitely consider using your branch as a quick-start to finally get a Twig-based 1.9 release out.
Pages: 1 2 3 4 5 6 7