2009-05-01, 03:44 PM
Hello World!
I've written a simple plugin that allows you to use your own custom templates in a theme. I present "Global Templates 1.0!"
Basically, the plugin lets you assign a "PHP name" to a template so that you can use it in other templates. Say, for instance, you create a few templates to let you have pretty windows around certain things. Under normal MyBB, you would have to copy and paste the templates everywhere. With my plugin you can just click the new "Global Templates" item under the Themes/Templates menu in the AdminCP, then add the templates with their PHP names. Then you can use them something like this:
There are a couple of known problems right now, mainly the fact that the plugin will only use templates from the "Global Templates" set instead of template-set-specific templates where available, but this is because there's not a "global_doneLoadingTheme" plugin hook.
The plugin can be found here.
I've written a simple plugin that allows you to use your own custom templates in a theme. I present "Global Templates 1.0!"
Basically, the plugin lets you assign a "PHP name" to a template so that you can use it in other templates. Say, for instance, you create a few templates to let you have pretty windows around certain things. Under normal MyBB, you would have to copy and paste the templates everywhere. With my plugin you can just click the new "Global Templates" item under the Themes/Templates menu in the AdminCP, then add the templates with their PHP names. Then you can use them something like this:
{$winTitle}
Title
{$winContent}
Content
{$winEnd}
There are a couple of known problems right now, mainly the fact that the plugin will only use templates from the "Global Templates" set instead of template-set-specific templates where available, but this is because there's not a "global_doneLoadingTheme" plugin hook.
The plugin can be found here.