[geeklog-devel] Plugins and Templates and a bit about the Forum plugin
Tom
websitemaster at cogeco.net
Thu Feb 19 10:35:03 EST 2015
Just a quick update…
I have now updated the repository with the new functions along with converting all of the core plugins over to using them.
The next release of the forum plugin will also use it.
Just an update regarding the template path function. Since we now have the ability to provide multiple paths to the plugin template files you can now include just the changed plugin template files with the theme just as long all the original template files can still be found in /plugins/yourplugin/templates/default/ directory.
Tom
From: geeklog-devel [mailto:geeklog-devel-bounces at lists.geeklog.net] On Behalf Of Tom
Sent: February-14-15 11:10 AM
To: 'Geeklog Development'
Subject: [geeklog-devel] Plugins and Templates and a bit about the Forum plugin
Okay,
I have started on updated the forum plugin templates to be responsive. Thanks Ivy for the work you have done so far (which is a lot). I am using your templates as my starting point.
I have created 2 new functions in the template library that the forum and core plugins will use to determine which templates to use when displaying information. I actually based the code on some I found in the plugins that was not being used (must have been a partially implemented feature).
To keep things consistent with the core plugins and to make theme development easier, other plugins should go ahead and use these functions where possible.
The 2 functions are:
CTL_plugin_templatePath($plugin, $path = '')
CTL_plugin_cssURL($plugin, $filename = "style.css")
The template function returns the physical path directory location of the plugin templates. This should be run at the beginning of your plugins functions.inc and stored in your plugins config variables like so:
$CONF_FORUM['path_layout'] = CTL_plugin_templatePath('forum');
Similarly the css function returns the URL of the location of the css file
$CONF_FORUM['css_url'] = CTL_plugin_cssURL('forum', 'forum.css');
The order of operation for the template function is
1) It checks for a sub directory of the plugin’s name in the current theme being displayed root directory. If found it is used.
2) It checks for a sub directory of the theme’s name in the current “plugins/plugin name here/templates/” directory. If found it is used.
3) If 1 or 2 is not found then the default template for the plugin is used. It is always located in “plugins/plugin name here/templates/default/”
This will hopefully make things easier for people when updating plugins to maintain their template changes. It also makes it easier for plugin developers to include plugin templates that support specific themes.
When I have fully implemented everything I will update the repository.
Thanks
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20150219/db65700d/attachment.html>
More information about the geeklog-devel
mailing list