[geeklog-devel] Plugins and Templates and a bit about the Forum plugin
今駒哲子
komma at ivywe.co.jp
Sat Feb 14 12:32:04 EST 2015
Thanks!
I'm glad to hear you.
The order of operation for the template function is so good.
"default" is template default directory.
This rule is very simple.
2015-02-15 1:09 GMT+09:00 Tom <websitemaster at cogeco.net>:
> 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
>
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> https://pairlist8.pair.net/mailman/listinfo/geeklog-devel
>
More information about the geeklog-devel
mailing list