2018-01-05, 06:34 PM
As described in the roadmap I posted recently, the future development of MyBB is going to happen over a series of major releases:
New Features/Changes
As of the time of writing, progress on 1.9 is still very early. Work is happening in a dedicated develop/1.9 branch on GitHub. So far, there is a single template converted to Twig, which is the User CP drafts page. There is still a great deal of work to be done here, such as finishing converting the header and layout templates, and adding the user CP menu to the page. However, it should make clear the structure:
It is planned that 1.9.0 will be available at least as a beta verison within the first quarter (Q1) of 2018, though obviously the sooner the better. We welcome any contributions to the effort that people can provide. For example, if you're used to working on Twig, you can follow the below process:
- 1.9.0
- 1.10.0
- 1.11.0
- etc.
New Features/Changes
- Brand new responsive theme, with more semantic HTML5 structure behind it.
- Changing the template system to use Twig. This brings the following improvements:
- Conditionals and loops within templates, removing the need for plugins like the PHP or Template Conditional plugins.
- Ability to include templates from withina template, leading to more flexibility for theme developers.
- HTML in variables in templates is escaped by default - no need to remember to use
htmlspecialchars_uni()
in backend PHP code everywhere. This should lower the chances of inadvertent holes for XSS attacks to leak through due to output not being filtered.
- Ability to register functions that can be called within templates. Functions such as formatting dates according to MyBB settings, checking permissions, and more will be available from straight within templates, making logic muche asier to reason about.
- Conditionals and loops within templates, removing the need for plugins like the PHP or Template Conditional plugins.
As of the time of writing, progress on 1.9 is still very early. Work is happening in a dedicated develop/1.9 branch on GitHub. So far, there is a single template converted to Twig, which is the User CP drafts page. There is still a great deal of work to be done here, such as finishing converting the header and layout templates, and adding the user CP menu to the page. However, it should make clear the structure:
- All base templates are stored in the "inc/views/base" directory.
- The drafts tmeplate can be found here, and gives a good example of the Twig syntax - it makes use of a loop, layout blocks, comments, and template includes.
- Twig extensions (which provide functions and global templates) live under the "MyBB\Twig\Extensions" namespace. There are currently two extensions registered - one for providing translations inside templates, and another for providing theme support. More extensions will be added as they're needed - such as a User CP extension to provide the User CP menu.
- Twig views are rendered using the "\MyBB\template()" function, as shown here.
It is planned that 1.9.0 will be available at least as a beta verison within the first quarter (Q1) of 2018, though obviously the sooner the better. We welcome any contributions to the effort that people can provide. For example, if you're used to working on Twig, you can follow the below process:
- Fork the MyBB repository to your GitHub branch.
- Create a new branch based upon
develop/1.9
.
- Convert a template to Twig, and test it locally.
- Create a Pull Request to the MyBB repository against the
develop/1.9
branch.
- The team will review and merge the PR, knocking another template off the list to convert!